-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathUpdateApplicationSecurityWafPolicy.ts
More file actions
47 lines (43 loc) · 1.18 KB
/
UpdateApplicationSecurityWafPolicy.ts
File metadata and controls
47 lines (43 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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));