ves-io-schema-malicious_user_mitigation-API-Create

Examples of creating malicioususermitigation

Usecase:

Create malicioususermitigation in namespace documentation that uses apptype bookinfo. There can only be one malicioususer_mitigation in a namespace.

Request using vesctl:

vesctl configuration create malicious_user_mitigation -i malicious_user_mitigation.yaml

where file malicioususermitigation.yaml has following contents (malicioususermitigation.CreateRequest):

metadata:
  name: malicious-user-mitigation
  namespace: documentation
spec:
  mitigationType:
    rules:
    - mitigationAction:
        javascriptChallenge: null
      threatLevel:
        low: null

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: malicious-user-mitigation
  namespace: documentation
spec:
  mitigationType:
    rules:
    - mitigationAction: {}
      threatLevel: {}
systemMetadata:
  creationTimestamp: "2021-07-14T08:07:32.896649458Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 542ac395-fcf5-468b-a155-0022989904eb

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"malicious-user-mitigation","namespace":"documentation"},"spec":{"mitigationType":{"rules":[{"threatLevel":{"low":null},"mitigationAction":{"javascriptChallenge":null}}]}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build381173587_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/malicious_user_mitigations'

curl response:

HTTP/1.1 200 OK
Content-Length: 773
Content-Type: application/json
Date: Wed, 14 Jul 2021 08:07:32 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "malicious-user-mitigation",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "542ac395-fcf5-468b-a155-0022989904eb",
    "creation_timestamp": "2021-07-14T08:07:32.896649458Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "mitigation_type": {
      "rules": [
        {
          "threat_level": {

          },
          "mitigation_action": {

          }
        }
      ]
    }
  }
}