diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a0d181216789..ce659f72c1bf 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -155,6 +155,14 @@ components: required: false schema: $ref: '#/components/schemas/ApplicationKeysSort' + ApplicationSecurityPolicyIDParam: + description: The ID of the policy. + example: recommended + in: path + name: policy_id + required: true + schema: + type: string ApplicationSecurityWafCustomRuleIDParam: description: The ID of the custom rule. example: 3b5-v82-ns6 @@ -3159,6 +3167,292 @@ components: type: string x-enum-varnames: - APPLICATION_KEYS + ApplicationSecurityPolicyAttributes: + description: A WAF policy. + properties: + description: + description: Description of the WAF policy. + example: Policy applied to internal web applications. + type: string + isDefault: + description: Make this policy the default policy. The default policy is + applied to every services not specifically added to another policy. + example: false + type: boolean + name: + description: The Name of the WAF policy. + example: Internal Network Policy + type: string + protectionPresets: + description: Presets enabled on this policy. + items: + example: attack-tools + type: string + type: array + rules: + description: Rule overrides applied by the policy. + items: + $ref: '#/components/schemas/ApplicationSecurityPolicyRuleOverride' + type: array + scope: + description: The scope of the WAF policy. + items: + $ref: '#/components/schemas/ApplicationSecurityPolicyScope' + type: array + version: + default: 0 + description: Version of the WAF ruleset maintained by Datadog used by this + policy. 0 is the default value. + example: 0 + format: int64 + type: integer + required: + - name + - description + type: object + ApplicationSecurityPolicyCreateAttributes: + description: Create a new WAF policy. + properties: + basedOn: + description: When creating a new policy, clone the policy indicated by this + identifier. + example: recommended + type: string + description: + description: Description of the WAF policy. + example: Policy applied to internal web applications. + type: string + isDefault: + description: Make this policy the default policy. The default policy is + applied to every services not specifically added to another policy. + example: false + type: boolean + name: + description: The Name of the WAF policy. + example: Internal Network Policy + type: string + protectionPresets: + description: Presets enabled on this policy. + items: + example: attack-tools + type: string + type: array + rules: + description: Rule overrides applied by the policy. + items: + $ref: '#/components/schemas/ApplicationSecurityPolicyRuleOverride' + type: array + scope: + description: The scope of the WAF policy. + items: + $ref: '#/components/schemas/ApplicationSecurityPolicyScope' + type: array + version: + default: 0 + description: Version of the WAF ruleset maintained by Datadog used by this + policy. 0 is the default value. + example: 0 + format: int64 + type: integer + required: + - name + - description + - basedOn + type: object + ApplicationSecurityPolicyCreateData: + description: Object for a single WAF policy. + properties: + attributes: + $ref: '#/components/schemas/ApplicationSecurityPolicyCreateAttributes' + type: + $ref: '#/components/schemas/ApplicationSecurityPolicyType' + required: + - attributes + - type + type: object + ApplicationSecurityPolicyCreateRequest: + description: Request object that includes the policy to create. + properties: + data: + $ref: '#/components/schemas/ApplicationSecurityPolicyCreateData' + required: + - data + type: object + ApplicationSecurityPolicyData: + description: Object for a single WAF policy. + properties: + attributes: + $ref: '#/components/schemas/ApplicationSecurityPolicyAttributes' + id: + description: The ID of the policy. + example: 2857c47d-1e3a-4300-8b2f-dc24089c084b + readOnly: true + type: string + metadata: + $ref: '#/components/schemas/ApplicationSecurityPolicyMetadata' + type: + $ref: '#/components/schemas/ApplicationSecurityPolicyType' + type: object + ApplicationSecurityPolicyListResponse: + description: Response object that includes a list of WAF policies. + properties: + data: + description: The WAF policy data. + items: + $ref: '#/components/schemas/ApplicationSecurityPolicyData' + type: array + type: object + ApplicationSecurityPolicyMetadata: + description: Metadata associated with the WAF policy. + properties: + added_at: + description: The date and time the WAF policy was created. + example: '2021-01-01T00:00:00Z' + format: date-time + type: string + added_by: + description: The handle of the user who created the WAF policy. + example: john.doe@datadoghq.com + type: string + added_by_name: + description: The name of the user who created the WAF policy. + example: John Doe + type: string + modified_at: + description: The date and time the WAF policy was last updated. + example: '2021-01-01T00:00:00Z' + format: date-time + type: string + modified_by: + description: The handle of the user who last updated the WAF policy. + example: john.doe@datadoghq.com + type: string + modified_by_name: + description: The name of the user who last updated the WAF policy. + example: John Doe + type: string + readOnly: true + type: object + ApplicationSecurityPolicyResponse: + description: Response object that includes a single WAF policy. + properties: + data: + $ref: '#/components/schemas/ApplicationSecurityPolicyData' + type: object + ApplicationSecurityPolicyRuleOverride: + description: Override WAF rule parameters for services in a policy. + properties: + blocking: + description: When blocking is enabled, the rule will block the traffic matched + by this rule. + example: false + type: boolean + enabled: + description: When false, this rule will not match any traffic. + example: true + type: boolean + id: + description: Override the parameters for this WAF rule identifier. + example: rasp-001-002 + type: string + required: + - id + - enabled + - blocking + type: object + ApplicationSecurityPolicyScope: + description: The scope of the WAF policy. + properties: + env: + description: The environment scope for the WAF policy. + example: prod + type: string + service: + description: The service scope for the WAF policy. + example: billing-service + type: string + required: + - service + - env + type: object + ApplicationSecurityPolicyType: + default: policy + description: The type of the resource. The value should always be `policy`. + enum: + - policy + example: policy + type: string + x-enum-varnames: + - POLICY + ApplicationSecurityPolicyUpdateAttributes: + description: Update a WAF policy. + properties: + description: + description: Description of the WAF policy. + example: Policy applied to internal web applications. + type: string + isDefault: + description: Make this policy the default policy. The default policy is + applied to every services not specifically added to another policy. + example: false + type: boolean + name: + description: The Name of the WAF policy. + example: Internal Network Policy + type: string + protectionPresets: + description: Presets enabled on this policy. + example: + - attack-tools + items: + example: attack-tools + type: string + type: array + rules: + description: Rule overrides applied by the policy. + items: + $ref: '#/components/schemas/ApplicationSecurityPolicyRuleOverride' + type: array + scope: + description: The scope of the WAF policy. + items: + $ref: '#/components/schemas/ApplicationSecurityPolicyScope' + type: array + version: + default: 0 + description: Version of the WAF ruleset maintained by Datadog used by this + policy. 0 is the default value. + example: 0 + format: int64 + type: integer + required: + - name + - description + - version + - isDefault + - rules + - protectionPresets + - scope + type: object + ApplicationSecurityPolicyUpdateData: + description: Object for a single WAF policy. + properties: + attributes: + $ref: '#/components/schemas/ApplicationSecurityPolicyUpdateAttributes' + type: + $ref: '#/components/schemas/ApplicationSecurityPolicyType' + required: + - attributes + - type + type: object + ApplicationSecurityPolicyUpdateRequest: + description: Request object that includes the policy to update. + properties: + data: + $ref: '#/components/schemas/ApplicationSecurityPolicyUpdateData' + required: + - data + type: object ApplicationSecurityWafCustomRuleAction: description: The definition of `ApplicationSecurityWafCustomRuleAction` object. properties: @@ -67009,6 +67303,130 @@ paths: permissions: - appsec_protect_write x-terraform-resource: appsec_waf_exclusion_filter + /api/v2/remote_config/products/asm/waf/policies: + get: + description: Retrieve a list of WAF policies. + operationId: ListApplicationSecurityWAFPolicies + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationSecurityPolicyListResponse' + description: OK + '403': + $ref: '#/components/responses/NotAuthorizedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List all WAF policies + tags: + - Application Security + post: + description: Create a new WAF policy. + operationId: CreateApplicationSecurityWafPolicy + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationSecurityPolicyCreateRequest' + description: The new WAF policy. + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationSecurityPolicyResponse' + description: Created + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/NotAuthorizedResponse' + '409': + $ref: '#/components/responses/ConcurrentModificationResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create a WAF Policy + tags: + - Application Security + x-codegen-request-body-name: body + /api/v2/remote_config/products/asm/waf/policies/{policy_id}: + delete: + description: Delete a specific WAF policy. + operationId: DeleteApplicationSecurityWafPolicy + parameters: + - $ref: '#/components/parameters/ApplicationSecurityPolicyIDParam' + responses: + '204': + description: No Content + '403': + $ref: '#/components/responses/NotAuthorizedResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '409': + $ref: '#/components/responses/ConcurrentModificationResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete a WAF Policy + tags: + - Application Security + x-terraform-resource: appsec_waf_policy + get: + description: Retrieve a WAF policy by ID. + operationId: GetApplicationSecurityWafPolicy + parameters: + - $ref: '#/components/parameters/ApplicationSecurityPolicyIDParam' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationSecurityPolicyResponse' + description: OK + '403': + $ref: '#/components/responses/NotAuthorizedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get a WAF Policy + tags: + - Application Security + x-terraform-resource: appsec_waf_policy + put: + description: 'Update a specific WAF policy. + + Returns the Policy object when the request is successful.' + operationId: UpdateApplicationSecurityWafPolicy + parameters: + - $ref: '#/components/parameters/ApplicationSecurityPolicyIDParam' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationSecurityPolicyUpdateRequest' + description: New WAF Policy. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationSecurityPolicyResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/NotAuthorizedResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '409': + $ref: '#/components/responses/ConcurrentModificationResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update a WAF Policy + tags: + - Application Security + x-codegen-request-body-name: body + x-terraform-resource: appsec_waf_policy /api/v2/remote_config/products/cws/agent_rules: get: description: 'Get the list of Workload Protection agent rules. diff --git a/examples/v2/application-security/CreateApplicationSecurityWafPolicy.ts b/examples/v2/application-security/CreateApplicationSecurityWafPolicy.ts new file mode 100644 index 000000000000..1c34a7cd0490 --- /dev/null +++ b/examples/v2/application-security/CreateApplicationSecurityWafPolicy.ts @@ -0,0 +1,47 @@ +/** + * Create a WAF Policy returns "Created" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.ApplicationSecurityApi(configuration); + +const params: v2.ApplicationSecurityApiCreateApplicationSecurityWafPolicyRequest = + { + body: { + data: { + attributes: { + basedOn: "recommended", + description: "Policy applied to internal web applications.", + isDefault: false, + name: "Internal Network Policy", + protectionPresets: ["attack-tools"], + rules: [ + { + blocking: false, + enabled: true, + id: "rasp-001-002", + }, + ], + scope: [ + { + env: "prod", + service: "billing-service", + }, + ], + version: 0, + }, + type: "policy", + }, + }, + }; + +apiInstance + .createApplicationSecurityWafPolicy(params) + .then((data: v2.ApplicationSecurityPolicyResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/application-security/DeleteApplicationSecurityWafPolicy.ts b/examples/v2/application-security/DeleteApplicationSecurityWafPolicy.ts new file mode 100644 index 000000000000..e3b190dd70b2 --- /dev/null +++ b/examples/v2/application-security/DeleteApplicationSecurityWafPolicy.ts @@ -0,0 +1,22 @@ +/** + * Delete a WAF Policy returns "No Content" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.ApplicationSecurityApi(configuration); + +const params: v2.ApplicationSecurityApiDeleteApplicationSecurityWafPolicyRequest = + { + policyId: "policy_id", + }; + +apiInstance + .deleteApplicationSecurityWafPolicy(params) + .then((data: any) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/application-security/GetApplicationSecurityWafPolicy.ts b/examples/v2/application-security/GetApplicationSecurityWafPolicy.ts new file mode 100644 index 000000000000..0c64576a5d7b --- /dev/null +++ b/examples/v2/application-security/GetApplicationSecurityWafPolicy.ts @@ -0,0 +1,22 @@ +/** + * Get a WAF Policy returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.ApplicationSecurityApi(configuration); + +const params: v2.ApplicationSecurityApiGetApplicationSecurityWafPolicyRequest = + { + policyId: "policy_id", + }; + +apiInstance + .getApplicationSecurityWafPolicy(params) + .then((data: v2.ApplicationSecurityPolicyResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/application-security/ListApplicationSecurityWAFPolicies.ts b/examples/v2/application-security/ListApplicationSecurityWAFPolicies.ts new file mode 100644 index 000000000000..330b531a408d --- /dev/null +++ b/examples/v2/application-security/ListApplicationSecurityWAFPolicies.ts @@ -0,0 +1,17 @@ +/** + * List all WAF policies returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.ApplicationSecurityApi(configuration); + +apiInstance + .listApplicationSecurityWAFPolicies() + .then((data: v2.ApplicationSecurityPolicyListResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/application-security/UpdateApplicationSecurityWafPolicy.ts b/examples/v2/application-security/UpdateApplicationSecurityWafPolicy.ts new file mode 100644 index 000000000000..35b570688ce7 --- /dev/null +++ b/examples/v2/application-security/UpdateApplicationSecurityWafPolicy.ts @@ -0,0 +1,47 @@ +/** + * Update a WAF Policy returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.ApplicationSecurityApi(configuration); + +const params: v2.ApplicationSecurityApiUpdateApplicationSecurityWafPolicyRequest = + { + body: { + data: { + attributes: { + description: "Policy applied to internal web applications.", + isDefault: false, + name: "Internal Network Policy", + protectionPresets: ["attack-tools"], + rules: [ + { + blocking: false, + enabled: true, + id: "rasp-001-002", + }, + ], + scope: [ + { + env: "prod", + service: "billing-service", + }, + ], + version: 0, + }, + type: "policy", + }, + }, + policyId: "policy_id", + }; + +apiInstance + .updateApplicationSecurityWafPolicy(params) + .then((data: v2.ApplicationSecurityPolicyResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index 76bdc128c1dd..ccb8952a60d1 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -7308,6 +7308,41 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "{}", }, + "v2.ListApplicationSecurityWAFPolicies": { + "operationResponseType": "ApplicationSecurityPolicyListResponse", + }, + "v2.CreateApplicationSecurityWafPolicy": { + "body": { + "type": "ApplicationSecurityPolicyCreateRequest", + "format": "", + }, + "operationResponseType": "ApplicationSecurityPolicyResponse", + }, + "v2.GetApplicationSecurityWafPolicy": { + "policyId": { + "type": "string", + "format": "", + }, + "operationResponseType": "ApplicationSecurityPolicyResponse", + }, + "v2.UpdateApplicationSecurityWafPolicy": { + "policyId": { + "type": "string", + "format": "", + }, + "body": { + "type": "ApplicationSecurityPolicyUpdateRequest", + "format": "", + }, + "operationResponseType": "ApplicationSecurityPolicyResponse", + }, + "v2.DeleteApplicationSecurityWafPolicy": { + "policyId": { + "type": "string", + "format": "", + }, + "operationResponseType": "{}", + }, "v2.ListCSMThreatsAgentRules": { "policyId": { "type": "string", diff --git a/features/v2/application_security.feature b/features/v2/application_security.feature index f10a470ff2e0..fa4288ef7caf 100644 --- a/features/v2/application_security.feature +++ b/features/v2/application_security.feature @@ -13,6 +13,27 @@ Feature: Application Security And a valid "appKeyAuth" key in the system And an instance of "ApplicationSecurity" API + @generated @skip @team:DataDog/asm-backend + Scenario: Create a WAF Policy returns "Bad Request" response + Given new "CreateApplicationSecurityWafPolicy" request + And body with value {"data": {"attributes": {"basedOn": "recommended", "description": "Policy applied to internal web applications.", "isDefault": false, "name": "Internal Network Policy", "protectionPresets": ["attack-tools"], "rules": [{"blocking": false, "enabled": true, "id": "rasp-001-002"}], "scope": [{"env": "prod", "service": "billing-service"}], "version": 0}, "type": "policy"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/asm-backend + Scenario: Create a WAF Policy returns "Concurrent Modification" response + Given new "CreateApplicationSecurityWafPolicy" request + And body with value {"data": {"attributes": {"basedOn": "recommended", "description": "Policy applied to internal web applications.", "isDefault": false, "name": "Internal Network Policy", "protectionPresets": ["attack-tools"], "rules": [{"blocking": false, "enabled": true, "id": "rasp-001-002"}], "scope": [{"env": "prod", "service": "billing-service"}], "version": 0}, "type": "policy"}} + When the request is sent + Then the response status is 409 Concurrent Modification + + @generated @skip @team:DataDog/asm-backend + Scenario: Create a WAF Policy returns "Created" response + Given new "CreateApplicationSecurityWafPolicy" request + And body with value {"data": {"attributes": {"basedOn": "recommended", "description": "Policy applied to internal web applications.", "isDefault": false, "name": "Internal Network Policy", "protectionPresets": ["attack-tools"], "rules": [{"blocking": false, "enabled": true, "id": "rasp-001-002"}], "scope": [{"env": "prod", "service": "billing-service"}], "version": 0}, "type": "policy"}} + When the request is sent + Then the response status is 201 Created + @generated @skip @team:DataDog/asm-backend Scenario: Create a WAF custom rule returns "Bad Request" response Given new "CreateApplicationSecurityWafCustomRule" request @@ -84,6 +105,27 @@ Feature: Application Security When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/asm-backend + Scenario: Delete a WAF Policy returns "Concurrent Modification" response + Given new "DeleteApplicationSecurityWafPolicy" request + And request contains "policy_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 409 Concurrent Modification + + @generated @skip @team:DataDog/asm-backend + Scenario: Delete a WAF Policy returns "No Content" response + Given new "DeleteApplicationSecurityWafPolicy" request + And request contains "policy_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/asm-backend + Scenario: Delete a WAF Policy returns "Not Found" response + Given new "DeleteApplicationSecurityWafPolicy" request + And request contains "policy_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/asm-backend Scenario: Delete a WAF exclusion filter returns "Concurrent Modification" response Given new "DeleteApplicationSecurityWafExclusionFilter" request @@ -106,6 +148,13 @@ Feature: Application Security When the request is sent Then the response status is 204 OK + @generated @skip @team:DataDog/asm-backend + Scenario: Get a WAF Policy returns "OK" response + Given new "GetApplicationSecurityWafPolicy" request + And request contains "policy_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/asm-backend Scenario: Get a WAF custom rule returns "OK" response Given new "GetApplicationSecurityWafCustomRule" request @@ -140,6 +189,12 @@ Feature: Application Security When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/asm-backend + Scenario: List all WAF policies returns "OK" response + Given new "ListApplicationSecurityWAFPolicies" request + When the request is sent + Then the response status is 200 OK + @team:DataDog/asm-backend Scenario: Update a WAF Custom Rule returns "Bad Request" response Given there is a valid "custom_rule" in the system @@ -174,6 +229,38 @@ Feature: Application Security When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/asm-backend + Scenario: Update a WAF Policy returns "Bad Request" response + Given new "UpdateApplicationSecurityWafPolicy" request + And request contains "policy_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Policy applied to internal web applications.", "isDefault": false, "name": "Internal Network Policy", "protectionPresets": ["attack-tools"], "rules": [{"blocking": false, "enabled": true, "id": "rasp-001-002"}], "scope": [{"env": "prod", "service": "billing-service"}], "version": 0}, "type": "policy"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/asm-backend + Scenario: Update a WAF Policy returns "Concurrent Modification" response + Given new "UpdateApplicationSecurityWafPolicy" request + And request contains "policy_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Policy applied to internal web applications.", "isDefault": false, "name": "Internal Network Policy", "protectionPresets": ["attack-tools"], "rules": [{"blocking": false, "enabled": true, "id": "rasp-001-002"}], "scope": [{"env": "prod", "service": "billing-service"}], "version": 0}, "type": "policy"}} + When the request is sent + Then the response status is 409 Concurrent Modification + + @generated @skip @team:DataDog/asm-backend + Scenario: Update a WAF Policy returns "Not Found" response + Given new "UpdateApplicationSecurityWafPolicy" request + And request contains "policy_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Policy applied to internal web applications.", "isDefault": false, "name": "Internal Network Policy", "protectionPresets": ["attack-tools"], "rules": [{"blocking": false, "enabled": true, "id": "rasp-001-002"}], "scope": [{"env": "prod", "service": "billing-service"}], "version": 0}, "type": "policy"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/asm-backend + Scenario: Update a WAF Policy returns "OK" response + Given new "UpdateApplicationSecurityWafPolicy" request + And request contains "policy_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Policy applied to internal web applications.", "isDefault": false, "name": "Internal Network Policy", "protectionPresets": ["attack-tools"], "rules": [{"blocking": false, "enabled": true, "id": "rasp-001-002"}], "scope": [{"env": "prod", "service": "billing-service"}], "version": 0}, "type": "policy"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/asm-backend Scenario: Update a WAF exclusion filter returns "Bad Request" response Given there is a valid "custom_rule" in the system diff --git a/features/v2/given.json b/features/v2/given.json index 06f7f855c1a1..24cd82910f04 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -693,6 +693,18 @@ "tag": "Application Security", "operationId": "CreateApplicationSecurityWafExclusionFilter" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"policy\",\n \"attributes\": {\n \"name\": \"Test policy\",\n \"description\": \"This is a test policy.\",\n \"basedOn\": \"recommended\"\n }\n }\n}" + } + ], + "step": "there is a valid \"policy\" in the system", + "key": "policy", + "tag": "Application Security", + "operationId": "CreateApplicationSecurityWafPolicy" + }, { "parameters": [ { diff --git a/features/v2/undo.json b/features/v2/undo.json index c4c269d3cab9..01cf520a88c7 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -2715,6 +2715,43 @@ "type": "idempotent" } }, + "ListApplicationSecurityWAFPolicies": { + "tag": "Application Security", + "undo": { + "type": "safe" + } + }, + "CreateApplicationSecurityWafPolicy": { + "tag": "Application Security", + "undo": { + "operationId": "DeleteApplicationSecurityWafPolicy", + "parameters": [ + { + "name": "policy_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteApplicationSecurityWafPolicy": { + "tag": "Application Security", + "undo": { + "type": "idempotent" + } + }, + "GetApplicationSecurityWafPolicy": { + "tag": "Application Security", + "undo": { + "type": "safe" + } + }, + "UpdateApplicationSecurityWafPolicy": { + "tag": "Application Security", + "undo": { + "type": "idempotent" + } + }, "ListCSMThreatsAgentRules": { "tag": "CSM Threats", "undo": { diff --git a/packages/datadog-api-client-v2/apis/ApplicationSecurityApi.ts b/packages/datadog-api-client-v2/apis/ApplicationSecurityApi.ts index 58970a7cf983..3a98eb088ee6 100644 --- a/packages/datadog-api-client-v2/apis/ApplicationSecurityApi.ts +++ b/packages/datadog-api-client-v2/apis/ApplicationSecurityApi.ts @@ -17,6 +17,10 @@ import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; import { APIErrorResponse } from "../models/APIErrorResponse"; +import { ApplicationSecurityPolicyCreateRequest } from "../models/ApplicationSecurityPolicyCreateRequest"; +import { ApplicationSecurityPolicyListResponse } from "../models/ApplicationSecurityPolicyListResponse"; +import { ApplicationSecurityPolicyResponse } from "../models/ApplicationSecurityPolicyResponse"; +import { ApplicationSecurityPolicyUpdateRequest } from "../models/ApplicationSecurityPolicyUpdateRequest"; import { ApplicationSecurityWafCustomRuleCreateRequest } from "../models/ApplicationSecurityWafCustomRuleCreateRequest"; import { ApplicationSecurityWafCustomRuleListResponse } from "../models/ApplicationSecurityWafCustomRuleListResponse"; import { ApplicationSecurityWafCustomRuleResponse } from "../models/ApplicationSecurityWafCustomRuleResponse"; @@ -125,6 +129,51 @@ export class ApplicationSecurityApiRequestFactory extends BaseAPIRequestFactory return requestContext; } + public async createApplicationSecurityWafPolicy( + body: ApplicationSecurityPolicyCreateRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createApplicationSecurityWafPolicy"); + } + + // Path Params + const localVarPath = "/api/v2/remote_config/products/asm/waf/policies"; + + // Make Request Context + const requestContext = _config + .getServer("v2.ApplicationSecurityApi.createApplicationSecurityWafPolicy") + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize( + body, + "ApplicationSecurityPolicyCreateRequest", + "" + ), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async deleteApplicationSecurityWafCustomRule( customRuleId: string, _options?: Configuration @@ -203,6 +252,40 @@ export class ApplicationSecurityApiRequestFactory extends BaseAPIRequestFactory return requestContext; } + public async deleteApplicationSecurityWafPolicy( + policyId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'policyId' is not null or undefined + if (policyId === null || policyId === undefined) { + throw new RequiredError("policyId", "deleteApplicationSecurityWafPolicy"); + } + + // Path Params + const localVarPath = + "/api/v2/remote_config/products/asm/waf/policies/{policy_id}".replace( + "{policy_id}", + encodeURIComponent(String(policyId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.ApplicationSecurityApi.deleteApplicationSecurityWafPolicy") + .makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async getApplicationSecurityWafCustomRule( customRuleId: string, _options?: Configuration @@ -281,6 +364,40 @@ export class ApplicationSecurityApiRequestFactory extends BaseAPIRequestFactory return requestContext; } + public async getApplicationSecurityWafPolicy( + policyId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'policyId' is not null or undefined + if (policyId === null || policyId === undefined) { + throw new RequiredError("policyId", "getApplicationSecurityWafPolicy"); + } + + // Path Params + const localVarPath = + "/api/v2/remote_config/products/asm/waf/policies/{policy_id}".replace( + "{policy_id}", + encodeURIComponent(String(policyId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.ApplicationSecurityApi.getApplicationSecurityWafPolicy") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async listApplicationSecurityWAFCustomRules( _options?: Configuration ): Promise { @@ -334,6 +451,30 @@ export class ApplicationSecurityApiRequestFactory extends BaseAPIRequestFactory return requestContext; } + public async listApplicationSecurityWAFPolicies( + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // Path Params + const localVarPath = "/api/v2/remote_config/products/asm/waf/policies"; + + // Make Request Context + const requestContext = _config + .getServer("v2.ApplicationSecurityApi.listApplicationSecurityWAFPolicies") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async updateApplicationSecurityWafCustomRule( customRuleId: string, body: ApplicationSecurityWafCustomRuleUpdateRequest, @@ -456,6 +597,61 @@ export class ApplicationSecurityApiRequestFactory extends BaseAPIRequestFactory return requestContext; } + + public async updateApplicationSecurityWafPolicy( + policyId: string, + body: ApplicationSecurityPolicyUpdateRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'policyId' is not null or undefined + if (policyId === null || policyId === undefined) { + throw new RequiredError("policyId", "updateApplicationSecurityWafPolicy"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "updateApplicationSecurityWafPolicy"); + } + + // Path Params + const localVarPath = + "/api/v2/remote_config/products/asm/waf/policies/{policy_id}".replace( + "{policy_id}", + encodeURIComponent(String(policyId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.ApplicationSecurityApi.updateApplicationSecurityWafPolicy") + .makeRequestContext(localVarPath, HttpMethod.PUT); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize( + body, + "ApplicationSecurityPolicyUpdateRequest", + "" + ), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } } export class ApplicationSecurityApiResponseProcessor { @@ -593,22 +789,313 @@ export class ApplicationSecurityApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to deleteApplicationSecurityWafCustomRule + * @params response Response returned by the server for a request to createApplicationSecurityWafPolicy + * @throws ApiException if the response code was not in [200, 299] + */ + public async createApplicationSecurityWafPolicy( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 201) { + const body: ApplicationSecurityPolicyResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ApplicationSecurityPolicyResponse" + ) as ApplicationSecurityPolicyResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 409 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: ApplicationSecurityPolicyResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ApplicationSecurityPolicyResponse", + "" + ) as ApplicationSecurityPolicyResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteApplicationSecurityWafCustomRule + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteApplicationSecurityWafCustomRule( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 204) { + return; + } + if ( + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 409 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + return; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteApplicationSecurityWafExclusionFilter + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteApplicationSecurityWafExclusionFilter( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 204) { + return; + } + if ( + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 409 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + return; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteApplicationSecurityWafPolicy + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteApplicationSecurityWafPolicy( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 204) { + return; + } + if ( + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 409 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + return; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getApplicationSecurityWafCustomRule + * @throws ApiException if the response code was not in [200, 299] + */ + public async getApplicationSecurityWafCustomRule( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: ApplicationSecurityWafCustomRuleResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ApplicationSecurityWafCustomRuleResponse" + ) as ApplicationSecurityWafCustomRuleResponse; + return body; + } + if (response.httpStatusCode === 403 || response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: ApplicationSecurityWafCustomRuleResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ApplicationSecurityWafCustomRuleResponse", + "" + ) as ApplicationSecurityWafCustomRuleResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getApplicationSecurityWafExclusionFilter * @throws ApiException if the response code was not in [200, 299] */ - public async deleteApplicationSecurityWafCustomRule( + public async getApplicationSecurityWafExclusionFilter( response: ResponseContext - ): Promise { + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (response.httpStatusCode === 204) { - return; + if (response.httpStatusCode === 200) { + const body: ApplicationSecurityWafExclusionFilterResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ApplicationSecurityWafExclusionFilterResponse" + ) as ApplicationSecurityWafExclusionFilterResponse; + return body; } if ( response.httpStatusCode === 403 || response.httpStatusCode === 404 || - response.httpStatusCode === 409 || response.httpStatusCode === 429 ) { const bodyText = ObjectSerializer.parse( @@ -633,7 +1120,13 @@ export class ApplicationSecurityApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - return; + const body: ApplicationSecurityWafExclusionFilterResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ApplicationSecurityWafExclusionFilterResponse", + "" + ) as ApplicationSecurityWafExclusionFilterResponse; + return body; } const body = (await response.body.text()) || ""; @@ -647,24 +1140,24 @@ export class ApplicationSecurityApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to deleteApplicationSecurityWafExclusionFilter + * @params response Response returned by the server for a request to getApplicationSecurityWafPolicy * @throws ApiException if the response code was not in [200, 299] */ - public async deleteApplicationSecurityWafExclusionFilter( + public async getApplicationSecurityWafPolicy( response: ResponseContext - ): Promise { + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (response.httpStatusCode === 204) { - return; + if (response.httpStatusCode === 200) { + const body: ApplicationSecurityPolicyResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ApplicationSecurityPolicyResponse" + ) as ApplicationSecurityPolicyResponse; + return body; } - if ( - response.httpStatusCode === 403 || - response.httpStatusCode === 404 || - response.httpStatusCode === 409 || - response.httpStatusCode === 429 - ) { + if (response.httpStatusCode === 403 || response.httpStatusCode === 429) { const bodyText = ObjectSerializer.parse( await response.body.text(), contentType @@ -687,7 +1180,13 @@ export class ApplicationSecurityApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - return; + const body: ApplicationSecurityPolicyResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ApplicationSecurityPolicyResponse", + "" + ) as ApplicationSecurityPolicyResponse; + return body; } const body = (await response.body.text()) || ""; @@ -701,21 +1200,21 @@ export class ApplicationSecurityApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to getApplicationSecurityWafCustomRule + * @params response Response returned by the server for a request to listApplicationSecurityWAFCustomRules * @throws ApiException if the response code was not in [200, 299] */ - public async getApplicationSecurityWafCustomRule( + public async listApplicationSecurityWAFCustomRules( response: ResponseContext - ): Promise { + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); if (response.httpStatusCode === 200) { - const body: ApplicationSecurityWafCustomRuleResponse = + const body: ApplicationSecurityWafCustomRuleListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ApplicationSecurityWafCustomRuleResponse" - ) as ApplicationSecurityWafCustomRuleResponse; + "ApplicationSecurityWafCustomRuleListResponse" + ) as ApplicationSecurityWafCustomRuleListResponse; return body; } if (response.httpStatusCode === 403 || response.httpStatusCode === 429) { @@ -741,12 +1240,12 @@ export class ApplicationSecurityApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: ApplicationSecurityWafCustomRuleResponse = + const body: ApplicationSecurityWafCustomRuleListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ApplicationSecurityWafCustomRuleResponse", + "ApplicationSecurityWafCustomRuleListResponse", "" - ) as ApplicationSecurityWafCustomRuleResponse; + ) as ApplicationSecurityWafCustomRuleListResponse; return body; } @@ -761,28 +1260,24 @@ export class ApplicationSecurityApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to getApplicationSecurityWafExclusionFilter + * @params response Response returned by the server for a request to listApplicationSecurityWafExclusionFilters * @throws ApiException if the response code was not in [200, 299] */ - public async getApplicationSecurityWafExclusionFilter( + public async listApplicationSecurityWafExclusionFilters( response: ResponseContext - ): Promise { + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); if (response.httpStatusCode === 200) { - const body: ApplicationSecurityWafExclusionFilterResponse = + const body: ApplicationSecurityWafExclusionFiltersResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ApplicationSecurityWafExclusionFilterResponse" - ) as ApplicationSecurityWafExclusionFilterResponse; + "ApplicationSecurityWafExclusionFiltersResponse" + ) as ApplicationSecurityWafExclusionFiltersResponse; return body; } - if ( - response.httpStatusCode === 403 || - response.httpStatusCode === 404 || - response.httpStatusCode === 429 - ) { + if (response.httpStatusCode === 403 || response.httpStatusCode === 429) { const bodyText = ObjectSerializer.parse( await response.body.text(), contentType @@ -805,12 +1300,12 @@ export class ApplicationSecurityApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: ApplicationSecurityWafExclusionFilterResponse = + const body: ApplicationSecurityWafExclusionFiltersResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ApplicationSecurityWafExclusionFilterResponse", + "ApplicationSecurityWafExclusionFiltersResponse", "" - ) as ApplicationSecurityWafExclusionFilterResponse; + ) as ApplicationSecurityWafExclusionFiltersResponse; return body; } @@ -825,21 +1320,21 @@ export class ApplicationSecurityApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to listApplicationSecurityWAFCustomRules + * @params response Response returned by the server for a request to listApplicationSecurityWAFPolicies * @throws ApiException if the response code was not in [200, 299] */ - public async listApplicationSecurityWAFCustomRules( + public async listApplicationSecurityWAFPolicies( response: ResponseContext - ): Promise { + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); if (response.httpStatusCode === 200) { - const body: ApplicationSecurityWafCustomRuleListResponse = + const body: ApplicationSecurityPolicyListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ApplicationSecurityWafCustomRuleListResponse" - ) as ApplicationSecurityWafCustomRuleListResponse; + "ApplicationSecurityPolicyListResponse" + ) as ApplicationSecurityPolicyListResponse; return body; } if (response.httpStatusCode === 403 || response.httpStatusCode === 429) { @@ -865,12 +1360,12 @@ export class ApplicationSecurityApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: ApplicationSecurityWafCustomRuleListResponse = + const body: ApplicationSecurityPolicyListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ApplicationSecurityWafCustomRuleListResponse", + "ApplicationSecurityPolicyListResponse", "" - ) as ApplicationSecurityWafCustomRuleListResponse; + ) as ApplicationSecurityPolicyListResponse; return body; } @@ -885,24 +1380,30 @@ export class ApplicationSecurityApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to listApplicationSecurityWafExclusionFilters + * @params response Response returned by the server for a request to updateApplicationSecurityWafCustomRule * @throws ApiException if the response code was not in [200, 299] */ - public async listApplicationSecurityWafExclusionFilters( + public async updateApplicationSecurityWafCustomRule( response: ResponseContext - ): Promise { + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); if (response.httpStatusCode === 200) { - const body: ApplicationSecurityWafExclusionFiltersResponse = + const body: ApplicationSecurityWafCustomRuleResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ApplicationSecurityWafExclusionFiltersResponse" - ) as ApplicationSecurityWafExclusionFiltersResponse; + "ApplicationSecurityWafCustomRuleResponse" + ) as ApplicationSecurityWafCustomRuleResponse; return body; } - if (response.httpStatusCode === 403 || response.httpStatusCode === 429) { + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 409 || + response.httpStatusCode === 429 + ) { const bodyText = ObjectSerializer.parse( await response.body.text(), contentType @@ -925,12 +1426,12 @@ export class ApplicationSecurityApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: ApplicationSecurityWafExclusionFiltersResponse = + const body: ApplicationSecurityWafCustomRuleResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ApplicationSecurityWafExclusionFiltersResponse", + "ApplicationSecurityWafCustomRuleResponse", "" - ) as ApplicationSecurityWafExclusionFiltersResponse; + ) as ApplicationSecurityWafCustomRuleResponse; return body; } @@ -945,21 +1446,21 @@ export class ApplicationSecurityApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to updateApplicationSecurityWafCustomRule + * @params response Response returned by the server for a request to updateApplicationSecurityWafExclusionFilter * @throws ApiException if the response code was not in [200, 299] */ - public async updateApplicationSecurityWafCustomRule( + public async updateApplicationSecurityWafExclusionFilter( response: ResponseContext - ): Promise { + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); if (response.httpStatusCode === 200) { - const body: ApplicationSecurityWafCustomRuleResponse = + const body: ApplicationSecurityWafExclusionFilterResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ApplicationSecurityWafCustomRuleResponse" - ) as ApplicationSecurityWafCustomRuleResponse; + "ApplicationSecurityWafExclusionFilterResponse" + ) as ApplicationSecurityWafExclusionFilterResponse; return body; } if ( @@ -991,12 +1492,12 @@ export class ApplicationSecurityApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: ApplicationSecurityWafCustomRuleResponse = + const body: ApplicationSecurityWafExclusionFilterResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ApplicationSecurityWafCustomRuleResponse", + "ApplicationSecurityWafExclusionFilterResponse", "" - ) as ApplicationSecurityWafCustomRuleResponse; + ) as ApplicationSecurityWafExclusionFilterResponse; return body; } @@ -1011,21 +1512,21 @@ export class ApplicationSecurityApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to updateApplicationSecurityWafExclusionFilter + * @params response Response returned by the server for a request to updateApplicationSecurityWafPolicy * @throws ApiException if the response code was not in [200, 299] */ - public async updateApplicationSecurityWafExclusionFilter( + public async updateApplicationSecurityWafPolicy( response: ResponseContext - ): Promise { + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); if (response.httpStatusCode === 200) { - const body: ApplicationSecurityWafExclusionFilterResponse = + const body: ApplicationSecurityPolicyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ApplicationSecurityWafExclusionFilterResponse" - ) as ApplicationSecurityWafExclusionFilterResponse; + "ApplicationSecurityPolicyResponse" + ) as ApplicationSecurityPolicyResponse; return body; } if ( @@ -1057,12 +1558,12 @@ export class ApplicationSecurityApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: ApplicationSecurityWafExclusionFilterResponse = + const body: ApplicationSecurityPolicyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ApplicationSecurityWafExclusionFilterResponse", + "ApplicationSecurityPolicyResponse", "" - ) as ApplicationSecurityWafExclusionFilterResponse; + ) as ApplicationSecurityPolicyResponse; return body; } @@ -1090,6 +1591,14 @@ export interface ApplicationSecurityApiCreateApplicationSecurityWafExclusionFilt body: ApplicationSecurityWafExclusionFilterCreateRequest; } +export interface ApplicationSecurityApiCreateApplicationSecurityWafPolicyRequest { + /** + * The new WAF policy. + * @type ApplicationSecurityPolicyCreateRequest + */ + body: ApplicationSecurityPolicyCreateRequest; +} + export interface ApplicationSecurityApiDeleteApplicationSecurityWafCustomRuleRequest { /** * The ID of the custom rule. @@ -1106,6 +1615,14 @@ export interface ApplicationSecurityApiDeleteApplicationSecurityWafExclusionFilt exclusionFilterId: string; } +export interface ApplicationSecurityApiDeleteApplicationSecurityWafPolicyRequest { + /** + * The ID of the policy. + * @type string + */ + policyId: string; +} + export interface ApplicationSecurityApiGetApplicationSecurityWafCustomRuleRequest { /** * The ID of the custom rule. @@ -1122,6 +1639,14 @@ export interface ApplicationSecurityApiGetApplicationSecurityWafExclusionFilterR exclusionFilterId: string; } +export interface ApplicationSecurityApiGetApplicationSecurityWafPolicyRequest { + /** + * The ID of the policy. + * @type string + */ + policyId: string; +} + export interface ApplicationSecurityApiUpdateApplicationSecurityWafCustomRuleRequest { /** * The ID of the custom rule. @@ -1148,6 +1673,19 @@ export interface ApplicationSecurityApiUpdateApplicationSecurityWafExclusionFilt body: ApplicationSecurityWafExclusionFilterUpdateRequest; } +export interface ApplicationSecurityApiUpdateApplicationSecurityWafPolicyRequest { + /** + * The ID of the policy. + * @type string + */ + policyId: string; + /** + * New WAF Policy. + * @type ApplicationSecurityPolicyUpdateRequest + */ + body: ApplicationSecurityPolicyUpdateRequest; +} + export class ApplicationSecurityApi { private requestFactory: ApplicationSecurityApiRequestFactory; private responseProcessor: ApplicationSecurityApiResponseProcessor; @@ -1216,6 +1754,30 @@ export class ApplicationSecurityApi { }); } + /** + * Create a new WAF policy. + * @param param The request object + */ + public createApplicationSecurityWafPolicy( + param: ApplicationSecurityApiCreateApplicationSecurityWafPolicyRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.createApplicationSecurityWafPolicy( + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createApplicationSecurityWafPolicy( + responseContext + ); + }); + }); + } + /** * Delete a specific WAF custom rule. * @param param The request object @@ -1264,6 +1826,30 @@ export class ApplicationSecurityApi { }); } + /** + * Delete a specific WAF policy. + * @param param The request object + */ + public deleteApplicationSecurityWafPolicy( + param: ApplicationSecurityApiDeleteApplicationSecurityWafPolicyRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.deleteApplicationSecurityWafPolicy( + param.policyId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.deleteApplicationSecurityWafPolicy( + responseContext + ); + }); + }); + } + /** * Retrieve a WAF custom rule by ID. * @param param The request object @@ -1312,6 +1898,30 @@ export class ApplicationSecurityApi { }); } + /** + * Retrieve a WAF policy by ID. + * @param param The request object + */ + public getApplicationSecurityWafPolicy( + param: ApplicationSecurityApiGetApplicationSecurityWafPolicyRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.getApplicationSecurityWafPolicy( + param.policyId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getApplicationSecurityWafPolicy( + responseContext + ); + }); + }); + } + /** * Retrieve a list of WAF custom rule. * @param param The request object @@ -1352,6 +1962,26 @@ export class ApplicationSecurityApi { }); } + /** + * Retrieve a list of WAF policies. + * @param param The request object + */ + public listApplicationSecurityWAFPolicies( + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.listApplicationSecurityWAFPolicies(options); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listApplicationSecurityWAFPolicies( + responseContext + ); + }); + }); + } + /** * Update a specific WAF custom Rule. * Returns the Custom Rule object when the request is successful. @@ -1403,4 +2033,30 @@ export class ApplicationSecurityApi { }); }); } + + /** + * Update a specific WAF policy. + * Returns the Policy object when the request is successful. + * @param param The request object + */ + public updateApplicationSecurityWafPolicy( + param: ApplicationSecurityApiUpdateApplicationSecurityWafPolicyRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.updateApplicationSecurityWafPolicy( + param.policyId, + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.updateApplicationSecurityWafPolicy( + responseContext + ); + }); + }); + } } diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index ac7f4793f391..9f4113d589e9 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -80,12 +80,16 @@ export { export { ApplicationSecurityApiCreateApplicationSecurityWafCustomRuleRequest, ApplicationSecurityApiCreateApplicationSecurityWafExclusionFilterRequest, + ApplicationSecurityApiCreateApplicationSecurityWafPolicyRequest, ApplicationSecurityApiDeleteApplicationSecurityWafCustomRuleRequest, ApplicationSecurityApiDeleteApplicationSecurityWafExclusionFilterRequest, + ApplicationSecurityApiDeleteApplicationSecurityWafPolicyRequest, ApplicationSecurityApiGetApplicationSecurityWafCustomRuleRequest, ApplicationSecurityApiGetApplicationSecurityWafExclusionFilterRequest, + ApplicationSecurityApiGetApplicationSecurityWafPolicyRequest, ApplicationSecurityApiUpdateApplicationSecurityWafCustomRuleRequest, ApplicationSecurityApiUpdateApplicationSecurityWafExclusionFilterRequest, + ApplicationSecurityApiUpdateApplicationSecurityWafPolicyRequest, ApplicationSecurityApi, } from "./apis/ApplicationSecurityApi"; @@ -934,6 +938,20 @@ export { ApplicationKeysType } from "./models/ApplicationKeysType"; export { ApplicationKeyUpdateAttributes } from "./models/ApplicationKeyUpdateAttributes"; export { ApplicationKeyUpdateData } from "./models/ApplicationKeyUpdateData"; export { ApplicationKeyUpdateRequest } from "./models/ApplicationKeyUpdateRequest"; +export { ApplicationSecurityPolicyAttributes } from "./models/ApplicationSecurityPolicyAttributes"; +export { ApplicationSecurityPolicyCreateAttributes } from "./models/ApplicationSecurityPolicyCreateAttributes"; +export { ApplicationSecurityPolicyCreateData } from "./models/ApplicationSecurityPolicyCreateData"; +export { ApplicationSecurityPolicyCreateRequest } from "./models/ApplicationSecurityPolicyCreateRequest"; +export { ApplicationSecurityPolicyData } from "./models/ApplicationSecurityPolicyData"; +export { ApplicationSecurityPolicyListResponse } from "./models/ApplicationSecurityPolicyListResponse"; +export { ApplicationSecurityPolicyMetadata } from "./models/ApplicationSecurityPolicyMetadata"; +export { ApplicationSecurityPolicyResponse } from "./models/ApplicationSecurityPolicyResponse"; +export { ApplicationSecurityPolicyRuleOverride } from "./models/ApplicationSecurityPolicyRuleOverride"; +export { ApplicationSecurityPolicyScope } from "./models/ApplicationSecurityPolicyScope"; +export { ApplicationSecurityPolicyType } from "./models/ApplicationSecurityPolicyType"; +export { ApplicationSecurityPolicyUpdateAttributes } from "./models/ApplicationSecurityPolicyUpdateAttributes"; +export { ApplicationSecurityPolicyUpdateData } from "./models/ApplicationSecurityPolicyUpdateData"; +export { ApplicationSecurityPolicyUpdateRequest } from "./models/ApplicationSecurityPolicyUpdateRequest"; export { ApplicationSecurityWafCustomRuleAction } from "./models/ApplicationSecurityWafCustomRuleAction"; export { ApplicationSecurityWafCustomRuleActionAction } from "./models/ApplicationSecurityWafCustomRuleActionAction"; export { ApplicationSecurityWafCustomRuleActionParameters } from "./models/ApplicationSecurityWafCustomRuleActionParameters"; diff --git a/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyAttributes.ts b/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyAttributes.ts new file mode 100644 index 000000000000..4947744d3f98 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyAttributes.ts @@ -0,0 +1,105 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ApplicationSecurityPolicyRuleOverride } from "./ApplicationSecurityPolicyRuleOverride"; +import { ApplicationSecurityPolicyScope } from "./ApplicationSecurityPolicyScope"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A WAF policy. + */ +export class ApplicationSecurityPolicyAttributes { + /** + * Description of the WAF policy. + */ + "description": string; + /** + * Make this policy the default policy. The default policy is applied to every services not specifically added to another policy. + */ + "isDefault"?: boolean; + /** + * The Name of the WAF policy. + */ + "name": string; + /** + * Presets enabled on this policy. + */ + "protectionPresets"?: Array; + /** + * Rule overrides applied by the policy. + */ + "rules"?: Array; + /** + * The scope of the WAF policy. + */ + "scope"?: Array; + /** + * Version of the WAF ruleset maintained by Datadog used by this policy. 0 is the default value. + */ + "version"?: number; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + description: { + baseName: "description", + type: "string", + required: true, + }, + isDefault: { + baseName: "isDefault", + type: "boolean", + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + protectionPresets: { + baseName: "protectionPresets", + type: "Array", + }, + rules: { + baseName: "rules", + type: "Array", + }, + scope: { + baseName: "scope", + type: "Array", + }, + version: { + baseName: "version", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ApplicationSecurityPolicyAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyCreateAttributes.ts b/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyCreateAttributes.ts new file mode 100644 index 000000000000..a0aa8fde4b7e --- /dev/null +++ b/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyCreateAttributes.ts @@ -0,0 +1,114 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ApplicationSecurityPolicyRuleOverride } from "./ApplicationSecurityPolicyRuleOverride"; +import { ApplicationSecurityPolicyScope } from "./ApplicationSecurityPolicyScope"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Create a new WAF policy. + */ +export class ApplicationSecurityPolicyCreateAttributes { + /** + * When creating a new policy, clone the policy indicated by this identifier. + */ + "basedOn": string; + /** + * Description of the WAF policy. + */ + "description": string; + /** + * Make this policy the default policy. The default policy is applied to every services not specifically added to another policy. + */ + "isDefault"?: boolean; + /** + * The Name of the WAF policy. + */ + "name": string; + /** + * Presets enabled on this policy. + */ + "protectionPresets"?: Array; + /** + * Rule overrides applied by the policy. + */ + "rules"?: Array; + /** + * The scope of the WAF policy. + */ + "scope"?: Array; + /** + * Version of the WAF ruleset maintained by Datadog used by this policy. 0 is the default value. + */ + "version"?: number; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + basedOn: { + baseName: "basedOn", + type: "string", + required: true, + }, + description: { + baseName: "description", + type: "string", + required: true, + }, + isDefault: { + baseName: "isDefault", + type: "boolean", + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + protectionPresets: { + baseName: "protectionPresets", + type: "Array", + }, + rules: { + baseName: "rules", + type: "Array", + }, + scope: { + baseName: "scope", + type: "Array", + }, + version: { + baseName: "version", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ApplicationSecurityPolicyCreateAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyCreateData.ts b/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyCreateData.ts new file mode 100644 index 000000000000..1529cc6ced99 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyCreateData.ts @@ -0,0 +1,64 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ApplicationSecurityPolicyCreateAttributes } from "./ApplicationSecurityPolicyCreateAttributes"; +import { ApplicationSecurityPolicyType } from "./ApplicationSecurityPolicyType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Object for a single WAF policy. + */ +export class ApplicationSecurityPolicyCreateData { + /** + * Create a new WAF policy. + */ + "attributes": ApplicationSecurityPolicyCreateAttributes; + /** + * The type of the resource. The value should always be `policy`. + */ + "type": ApplicationSecurityPolicyType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "ApplicationSecurityPolicyCreateAttributes", + required: true, + }, + type: { + baseName: "type", + type: "ApplicationSecurityPolicyType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ApplicationSecurityPolicyCreateData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyCreateRequest.ts b/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyCreateRequest.ts new file mode 100644 index 000000000000..e128beaf3445 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyCreateRequest.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ApplicationSecurityPolicyCreateData } from "./ApplicationSecurityPolicyCreateData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Request object that includes the policy to create. + */ +export class ApplicationSecurityPolicyCreateRequest { + /** + * Object for a single WAF policy. + */ + "data": ApplicationSecurityPolicyCreateData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "ApplicationSecurityPolicyCreateData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ApplicationSecurityPolicyCreateRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyData.ts b/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyData.ts new file mode 100644 index 000000000000..6a63e4f758f7 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyData.ts @@ -0,0 +1,79 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ApplicationSecurityPolicyAttributes } from "./ApplicationSecurityPolicyAttributes"; +import { ApplicationSecurityPolicyMetadata } from "./ApplicationSecurityPolicyMetadata"; +import { ApplicationSecurityPolicyType } from "./ApplicationSecurityPolicyType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Object for a single WAF policy. + */ +export class ApplicationSecurityPolicyData { + /** + * A WAF policy. + */ + "attributes"?: ApplicationSecurityPolicyAttributes; + /** + * The ID of the policy. + */ + "id"?: string; + /** + * Metadata associated with the WAF policy. + */ + "metadata"?: ApplicationSecurityPolicyMetadata; + /** + * The type of the resource. The value should always be `policy`. + */ + "type"?: ApplicationSecurityPolicyType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "ApplicationSecurityPolicyAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + metadata: { + baseName: "metadata", + type: "ApplicationSecurityPolicyMetadata", + }, + type: { + baseName: "type", + type: "ApplicationSecurityPolicyType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ApplicationSecurityPolicyData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyListResponse.ts b/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyListResponse.ts new file mode 100644 index 000000000000..b543f5e3727d --- /dev/null +++ b/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyListResponse.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ApplicationSecurityPolicyData } from "./ApplicationSecurityPolicyData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response object that includes a list of WAF policies. + */ +export class ApplicationSecurityPolicyListResponse { + /** + * The WAF policy data. + */ + "data"?: Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ApplicationSecurityPolicyListResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyMetadata.ts b/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyMetadata.ts new file mode 100644 index 000000000000..b3fe75750d7b --- /dev/null +++ b/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyMetadata.ts @@ -0,0 +1,94 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Metadata associated with the WAF policy. + */ +export class ApplicationSecurityPolicyMetadata { + /** + * The date and time the WAF policy was created. + */ + "addedAt"?: Date; + /** + * The handle of the user who created the WAF policy. + */ + "addedBy"?: string; + /** + * The name of the user who created the WAF policy. + */ + "addedByName"?: string; + /** + * The date and time the WAF policy was last updated. + */ + "modifiedAt"?: Date; + /** + * The handle of the user who last updated the WAF policy. + */ + "modifiedBy"?: string; + /** + * The name of the user who last updated the WAF policy. + */ + "modifiedByName"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + addedAt: { + baseName: "added_at", + type: "Date", + format: "date-time", + }, + addedBy: { + baseName: "added_by", + type: "string", + }, + addedByName: { + baseName: "added_by_name", + type: "string", + }, + modifiedAt: { + baseName: "modified_at", + type: "Date", + format: "date-time", + }, + modifiedBy: { + baseName: "modified_by", + type: "string", + }, + modifiedByName: { + baseName: "modified_by_name", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ApplicationSecurityPolicyMetadata.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyResponse.ts b/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyResponse.ts new file mode 100644 index 000000000000..66bd7b3d94a5 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyResponse.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ApplicationSecurityPolicyData } from "./ApplicationSecurityPolicyData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response object that includes a single WAF policy. + */ +export class ApplicationSecurityPolicyResponse { + /** + * Object for a single WAF policy. + */ + "data"?: ApplicationSecurityPolicyData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "ApplicationSecurityPolicyData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ApplicationSecurityPolicyResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyRuleOverride.ts b/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyRuleOverride.ts new file mode 100644 index 000000000000..c9c28873ad7d --- /dev/null +++ b/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyRuleOverride.ts @@ -0,0 +1,71 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Override WAF rule parameters for services in a policy. + */ +export class ApplicationSecurityPolicyRuleOverride { + /** + * When blocking is enabled, the rule will block the traffic matched by this rule. + */ + "blocking": boolean; + /** + * When false, this rule will not match any traffic. + */ + "enabled": boolean; + /** + * Override the parameters for this WAF rule identifier. + */ + "id": string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + blocking: { + baseName: "blocking", + type: "boolean", + required: true, + }, + enabled: { + baseName: "enabled", + type: "boolean", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ApplicationSecurityPolicyRuleOverride.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyScope.ts b/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyScope.ts new file mode 100644 index 000000000000..357326245316 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyScope.ts @@ -0,0 +1,62 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The scope of the WAF policy. + */ +export class ApplicationSecurityPolicyScope { + /** + * The environment scope for the WAF policy. + */ + "env": string; + /** + * The service scope for the WAF policy. + */ + "service": string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + env: { + baseName: "env", + type: "string", + required: true, + }, + service: { + baseName: "service", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ApplicationSecurityPolicyScope.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyType.ts b/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyType.ts new file mode 100644 index 000000000000..f2b206ca18fe --- /dev/null +++ b/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyType.ts @@ -0,0 +1,14 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The type of the resource. The value should always be `policy`. + */ + +export type ApplicationSecurityPolicyType = typeof POLICY | UnparsedObject; +export const POLICY = "policy"; diff --git a/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyUpdateAttributes.ts b/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyUpdateAttributes.ts new file mode 100644 index 000000000000..6ad94d03db36 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyUpdateAttributes.ts @@ -0,0 +1,110 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ApplicationSecurityPolicyRuleOverride } from "./ApplicationSecurityPolicyRuleOverride"; +import { ApplicationSecurityPolicyScope } from "./ApplicationSecurityPolicyScope"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Update a WAF policy. + */ +export class ApplicationSecurityPolicyUpdateAttributes { + /** + * Description of the WAF policy. + */ + "description": string; + /** + * Make this policy the default policy. The default policy is applied to every services not specifically added to another policy. + */ + "isDefault": boolean; + /** + * The Name of the WAF policy. + */ + "name": string; + /** + * Presets enabled on this policy. + */ + "protectionPresets": Array; + /** + * Rule overrides applied by the policy. + */ + "rules": Array; + /** + * The scope of the WAF policy. + */ + "scope": Array; + /** + * Version of the WAF ruleset maintained by Datadog used by this policy. 0 is the default value. + */ + "version": number; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + description: { + baseName: "description", + type: "string", + required: true, + }, + isDefault: { + baseName: "isDefault", + type: "boolean", + required: true, + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + protectionPresets: { + baseName: "protectionPresets", + type: "Array", + required: true, + }, + rules: { + baseName: "rules", + type: "Array", + required: true, + }, + scope: { + baseName: "scope", + type: "Array", + required: true, + }, + version: { + baseName: "version", + type: "number", + required: true, + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ApplicationSecurityPolicyUpdateAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyUpdateData.ts b/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyUpdateData.ts new file mode 100644 index 000000000000..c7b5f2430fe4 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyUpdateData.ts @@ -0,0 +1,64 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ApplicationSecurityPolicyType } from "./ApplicationSecurityPolicyType"; +import { ApplicationSecurityPolicyUpdateAttributes } from "./ApplicationSecurityPolicyUpdateAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Object for a single WAF policy. + */ +export class ApplicationSecurityPolicyUpdateData { + /** + * Update a WAF policy. + */ + "attributes": ApplicationSecurityPolicyUpdateAttributes; + /** + * The type of the resource. The value should always be `policy`. + */ + "type": ApplicationSecurityPolicyType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "ApplicationSecurityPolicyUpdateAttributes", + required: true, + }, + type: { + baseName: "type", + type: "ApplicationSecurityPolicyType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ApplicationSecurityPolicyUpdateData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyUpdateRequest.ts b/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyUpdateRequest.ts new file mode 100644 index 000000000000..3a72d7d16388 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ApplicationSecurityPolicyUpdateRequest.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ApplicationSecurityPolicyUpdateData } from "./ApplicationSecurityPolicyUpdateData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Request object that includes the policy to update. + */ +export class ApplicationSecurityPolicyUpdateRequest { + /** + * Object for a single WAF policy. + */ + "data": ApplicationSecurityPolicyUpdateData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "ApplicationSecurityPolicyUpdateData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ApplicationSecurityPolicyUpdateRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index 24806d701347..f47a075efccc 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -94,6 +94,19 @@ import { ApplicationKeyResponseMetaPage } from "./ApplicationKeyResponseMetaPage import { ApplicationKeyUpdateAttributes } from "./ApplicationKeyUpdateAttributes"; import { ApplicationKeyUpdateData } from "./ApplicationKeyUpdateData"; import { ApplicationKeyUpdateRequest } from "./ApplicationKeyUpdateRequest"; +import { ApplicationSecurityPolicyAttributes } from "./ApplicationSecurityPolicyAttributes"; +import { ApplicationSecurityPolicyCreateAttributes } from "./ApplicationSecurityPolicyCreateAttributes"; +import { ApplicationSecurityPolicyCreateData } from "./ApplicationSecurityPolicyCreateData"; +import { ApplicationSecurityPolicyCreateRequest } from "./ApplicationSecurityPolicyCreateRequest"; +import { ApplicationSecurityPolicyData } from "./ApplicationSecurityPolicyData"; +import { ApplicationSecurityPolicyListResponse } from "./ApplicationSecurityPolicyListResponse"; +import { ApplicationSecurityPolicyMetadata } from "./ApplicationSecurityPolicyMetadata"; +import { ApplicationSecurityPolicyResponse } from "./ApplicationSecurityPolicyResponse"; +import { ApplicationSecurityPolicyRuleOverride } from "./ApplicationSecurityPolicyRuleOverride"; +import { ApplicationSecurityPolicyScope } from "./ApplicationSecurityPolicyScope"; +import { ApplicationSecurityPolicyUpdateAttributes } from "./ApplicationSecurityPolicyUpdateAttributes"; +import { ApplicationSecurityPolicyUpdateData } from "./ApplicationSecurityPolicyUpdateData"; +import { ApplicationSecurityPolicyUpdateRequest } from "./ApplicationSecurityPolicyUpdateRequest"; import { ApplicationSecurityWafCustomRuleAction } from "./ApplicationSecurityWafCustomRuleAction"; import { ApplicationSecurityWafCustomRuleActionParameters } from "./ApplicationSecurityWafCustomRuleActionParameters"; import { ApplicationSecurityWafCustomRuleAttributes } from "./ApplicationSecurityWafCustomRuleAttributes"; @@ -2468,6 +2481,7 @@ const enumsMap: { [key: string]: any[] } = { "-name", ], ApplicationKeysType: ["application_keys"], + ApplicationSecurityPolicyType: ["policy"], ApplicationSecurityWafCustomRuleActionAction: [ "redirect_request", "block_request", @@ -4015,6 +4029,23 @@ const typeMap: { [index: string]: any } = { ApplicationKeyUpdateAttributes: ApplicationKeyUpdateAttributes, ApplicationKeyUpdateData: ApplicationKeyUpdateData, ApplicationKeyUpdateRequest: ApplicationKeyUpdateRequest, + ApplicationSecurityPolicyAttributes: ApplicationSecurityPolicyAttributes, + ApplicationSecurityPolicyCreateAttributes: + ApplicationSecurityPolicyCreateAttributes, + ApplicationSecurityPolicyCreateData: ApplicationSecurityPolicyCreateData, + ApplicationSecurityPolicyCreateRequest: + ApplicationSecurityPolicyCreateRequest, + ApplicationSecurityPolicyData: ApplicationSecurityPolicyData, + ApplicationSecurityPolicyListResponse: ApplicationSecurityPolicyListResponse, + ApplicationSecurityPolicyMetadata: ApplicationSecurityPolicyMetadata, + ApplicationSecurityPolicyResponse: ApplicationSecurityPolicyResponse, + ApplicationSecurityPolicyRuleOverride: ApplicationSecurityPolicyRuleOverride, + ApplicationSecurityPolicyScope: ApplicationSecurityPolicyScope, + ApplicationSecurityPolicyUpdateAttributes: + ApplicationSecurityPolicyUpdateAttributes, + ApplicationSecurityPolicyUpdateData: ApplicationSecurityPolicyUpdateData, + ApplicationSecurityPolicyUpdateRequest: + ApplicationSecurityPolicyUpdateRequest, ApplicationSecurityWafCustomRuleAction: ApplicationSecurityWafCustomRuleAction, ApplicationSecurityWafCustomRuleActionParameters: