ves-io-schema-waf-API-Create

Examples of creating waf

Usecase:

Create waf-1

Request using vesctl:

vesctl configuration create waf -i waf.yaml

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

metadata:
  name: waf-1
  namespace: documentation
spec:
  appProfile:
    cms:
    - DOKUWIKI
    - DRUPAL
    - WORDPRESS
    - NEXTCLOUD
    - CPANEL
    language:
    - PHP
    - JAVA
    webserver:
    - IIS
  disabledDetectionTags:
    detectionTagType:
    - DATA_LEAKAGE
    - SQLI_ATTACK
    - XSS_ATTACK
    - PROTOCOL_ATTACK
    - RCE_ATTACK

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: waf-1
  namespace: documentation
spec:
  appProfile:
    cms:
    - DOKUWIKI
    - DRUPAL
    - WORDPRESS
    - NEXTCLOUD
    - CPANEL
    language:
    - PHP
    - JAVA
    webserver:
    - IIS
  disabledDetectionTags:
    detectionTagType:
    - DATA_LEAKAGE
    - SQLI_ATTACK
    - XSS_ATTACK
    - PROTOCOL_ATTACK
    - RCE_ATTACK
systemMetadata:
  creationTimestamp: "2020-07-02T15:53:44.031136100Z"
  creatorClass: examplesvc.ves.io
  finalizers: []
  tenant: acmecorp
  uid: e461dcc4-3adf-4a52-ab51-ea05edef3821

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"waf-1","namespace":"documentation"},"spec":{"appProfile":{"language":["PHP","JAVA"],"cms":["DOKUWIKI","DRUPAL","WORDPRESS","NEXTCLOUD","CPANEL"],"webserver":["IIS"]},"disabledDetectionTags":{"detectionTagType":["DATA_LEAKAGE","SQLI_ATTACK","XSS_ATTACK","PROTOCOL_ATTACK","RCE_ATTACK"]}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build743694289_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/wafs'

curl response:

HTTP/1.1 200 OK
Content-Length: 1052
Content-Type: application/json
Date: Thu, 02 Jul 2020 15:53:44 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "waf-1",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "e461dcc4-3adf-4a52-ab51-ea05edef3821",
    "creation_timestamp": "2020-07-02T15:53:44.031136100Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc.ves.io",
    "creator_id": "",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "app_profile": {
      "language": [
        "PHP",
        "JAVA"
      ],
      "cms": [
        "DOKUWIKI",
        "DRUPAL",
        "WORDPRESS",
        "NEXTCLOUD",
        "CPANEL"
      ],
      "webserver": [
        "IIS"
      ]
    },
    "mode": "BLOCK",
    "disabled_detection_tags": {
      "detection_tag_type": [
        "DATA_LEAKAGE",
        "SQLI_ATTACK",
        "XSS_ATTACK",
        "PROTOCOL_ATTACK",
        "RCE_ATTACK"
      ]
    }
  }
}