Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-06-17 18:21:58.620175",
"spec_repo_commit": "b1a1c000"
"regenerated": "2025-06-18 09:42:19.367411",
"spec_repo_commit": "b6151f30"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-06-17 18:21:58.636299",
"spec_repo_commit": "b1a1c000"
"regenerated": "2025-06-18 09:42:19.383303",
"spec_repo_commit": "b6151f30"
}
}
}
6 changes: 6 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7540,13 +7540,19 @@ components:
description: SECL expression used to target the container to apply the action
on
type: string
hash:
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActionHash'
kill:
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleKill'
metadata:
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActionMetadata'
set:
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActionSet'
type: object
CloudWorkloadSecurityAgentRuleActionHash:
additionalProperties: {}
description: An empty object indicating the hash action
type: object
CloudWorkloadSecurityAgentRuleActionMetadata:
description: The metadata action applied on the scope matching the rule
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleCreateRequest;
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleResponse;
import com.datadog.api.client.v2.model.CloudWorkloadSecurityAgentRuleType;
import java.util.Collections;
import java.util.Arrays;
import java.util.Map;

public class Example {
public static void main(String[] args) {
Expand All @@ -34,13 +35,15 @@ public static void main(String[] args) {
.name("examplecsmthreat")
.policyId(POLICY_DATA_ID)
.actions(
Collections.singletonList(
Arrays.asList(
new CloudWorkloadSecurityAgentRuleAction()
.set(
new CloudWorkloadSecurityAgentRuleActionSet()
.name("test_set")
.value("test_value")
.scope("process")))))
.scope("process")),
new CloudWorkloadSecurityAgentRuleAction()
.hash(Map.ofEntries()))))
.type(CloudWorkloadSecurityAgentRuleType.AGENT_RULE));

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
/** The action the rule can perform if triggered */
@JsonPropertyOrder({
CloudWorkloadSecurityAgentRuleAction.JSON_PROPERTY_FILTER,
CloudWorkloadSecurityAgentRuleAction.JSON_PROPERTY_HASH,
CloudWorkloadSecurityAgentRuleAction.JSON_PROPERTY_KILL,
CloudWorkloadSecurityAgentRuleAction.JSON_PROPERTY_METADATA,
CloudWorkloadSecurityAgentRuleAction.JSON_PROPERTY_SET
Expand All @@ -30,6 +31,9 @@ public class CloudWorkloadSecurityAgentRuleAction {
public static final String JSON_PROPERTY_FILTER = "filter";
private String filter;

public static final String JSON_PROPERTY_HASH = "hash";
private Map<String, Object> hash = null;

public static final String JSON_PROPERTY_KILL = "kill";
private CloudWorkloadSecurityAgentRuleKill kill;

Expand Down Expand Up @@ -60,6 +64,35 @@ public void setFilter(String filter) {
this.filter = filter;
}

public CloudWorkloadSecurityAgentRuleAction hash(Map<String, Object> hash) {
this.hash = hash;
return this;
}

public CloudWorkloadSecurityAgentRuleAction putHashItem(String key, Object hashItem) {
if (this.hash == null) {
this.hash = new HashMap<>();
}
this.hash.put(key, hashItem);
return this;
}

/**
* An empty object indicating the hash action
*
* @return hash
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_HASH)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Map<String, Object> getHash() {
return hash;
}

public void setHash(Map<String, Object> hash) {
this.hash = hash;
}

public CloudWorkloadSecurityAgentRuleAction kill(CloudWorkloadSecurityAgentRuleKill kill) {
this.kill = kill;
this.unparsed |= kill.unparsed;
Expand Down Expand Up @@ -185,6 +218,7 @@ public boolean equals(Object o) {
CloudWorkloadSecurityAgentRuleAction cloudWorkloadSecurityAgentRuleAction =
(CloudWorkloadSecurityAgentRuleAction) o;
return Objects.equals(this.filter, cloudWorkloadSecurityAgentRuleAction.filter)
&& Objects.equals(this.hash, cloudWorkloadSecurityAgentRuleAction.hash)
&& Objects.equals(this.kill, cloudWorkloadSecurityAgentRuleAction.kill)
&& Objects.equals(this.metadata, cloudWorkloadSecurityAgentRuleAction.metadata)
&& Objects.equals(this.set, cloudWorkloadSecurityAgentRuleAction.set)
Expand All @@ -194,14 +228,15 @@ public boolean equals(Object o) {

@Override
public int hashCode() {
return Objects.hash(filter, kill, metadata, set, additionalProperties);
return Objects.hash(filter, hash, kill, metadata, set, additionalProperties);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CloudWorkloadSecurityAgentRuleAction {\n");
sb.append(" filter: ").append(toIndentedString(filter)).append("\n");
sb.append(" hash: ").append(toIndentedString(hash)).append("\n");
sb.append(" kill: ").append(toIndentedString(kill)).append("\n");
sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n");
sb.append(" set: ").append(toIndentedString(set)).append("\n");
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2025-05-27T10:24:57.049Z
2025-06-13T15:16:58.034Z
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"httpRequest": {
"body": {
"type": "JSON",
"json": "{\"data\":{\"attributes\":{\"description\":\"My agent policy\",\"enabled\":true,\"hostTags\":[\"env:staging\"],\"name\":\"testcreateaworkloadprotectionagentrulewithsetactionreturnsokresponse1748341497\"},\"type\":\"policy\"}}"
"json": "{\"data\":{\"attributes\":{\"description\":\"My agent policy\",\"enabled\":true,\"hostTags\":[\"env:staging\"],\"name\":\"testcreateaworkloadprotectionagentrulewithsetactionreturnsokresponse1749827818\"},\"type\":\"policy\"}}"
},
"headers": {},
"method": "POST",
Expand All @@ -12,7 +12,7 @@
"secure": true
},
"httpResponse": {
"body": "{\"data\":{\"id\":\"qyj-iza-vbu\",\"type\":\"policy\",\"attributes\":{\"blockingRulesCount\":0,\"datadogManaged\":false,\"description\":\"My agent policy\",\"disabledRulesCount\":1,\"enabled\":true,\"hostTags\":[\"env:staging\"],\"monitoringRulesCount\":225,\"name\":\"testcreateaworkloadprotectionagentrulewithsetactionreturnsokresponse1748341497\",\"policyVersion\":\"1\",\"priority\":1000000011,\"ruleCount\":226,\"updateDate\":1748341497346,\"updater\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"}}}}",
"body": "{\"data\":{\"id\":\"alt-4q4-baa\",\"type\":\"policy\",\"attributes\":{\"blockingRulesCount\":0,\"datadogManaged\":false,\"description\":\"My agent policy\",\"disabledRulesCount\":1,\"enabled\":true,\"hostTags\":[\"env:staging\"],\"monitoringRulesCount\":225,\"name\":\"testcreateaworkloadprotectionagentrulewithsetactionreturnsokresponse1749827818\",\"policyVersion\":\"1\",\"priority\":1000000013,\"ruleCount\":226,\"updateDate\":1749827818428,\"updater\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"}}}}",
"headers": {
"Content-Type": [
"application/json"
Expand All @@ -27,13 +27,13 @@
"timeToLive": {
"unlimited": true
},
"id": "573b0a46-29e1-7d6b-1e24-65f1ebbabc50"
"id": "258766a3-d0c8-5c2b-27cf-0f2ddc6a4c23"
},
{
"httpRequest": {
"body": {
"type": "JSON",
"json": "{\"data\":{\"attributes\":{\"actions\":[{\"set\":{\"name\":\"test_set\",\"scope\":\"process\",\"value\":\"test_value\"}}],\"description\":\"My Agent rule with set action\",\"enabled\":true,\"expression\":\"exec.file.name == \\\"sh\\\"\",\"filters\":[],\"name\":\"testcreateaworkloadprotectionagentrulewithsetactionreturnsokresponse1748341497\",\"policy_id\":\"qyj-iza-vbu\",\"product_tags\":[]},\"type\":\"agent_rule\"}}"
"json": "{\"data\":{\"attributes\":{\"actions\":[{\"set\":{\"name\":\"test_set\",\"scope\":\"process\",\"value\":\"test_value\"}},{\"hash\":{}}],\"description\":\"My Agent rule with set action\",\"enabled\":true,\"expression\":\"exec.file.name == \\\"sh\\\"\",\"filters\":[],\"name\":\"testcreateaworkloadprotectionagentrulewithsetactionreturnsokresponse1749827818\",\"policy_id\":\"alt-4q4-baa\",\"product_tags\":[]},\"type\":\"agent_rule\"}}"
},
"headers": {},
"method": "POST",
Expand All @@ -42,7 +42,7 @@
"secure": true
},
"httpResponse": {
"body": "{\"data\":{\"id\":\"zux-bp8-zov\",\"type\":\"agent_rule\",\"attributes\":{\"actions\":[{\"set\":{\"name\":\"test_set\",\"value\":\"test_value\",\"scope\":\"process\"},\"disabled\":false}],\"category\":\"Process Activity\",\"creationDate\":1748341498175,\"creator\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"defaultRule\":false,\"description\":\"My Agent rule with set action\",\"enabled\":true,\"expression\":\"exec.file.name == \\\"sh\\\"\",\"filters\":[\"os == \\\"linux\\\"\"],\"monitoring\":[\"qyj-iza-vbu\"],\"name\":\"testcreateaworkloadprotectionagentrulewithsetactionreturnsokresponse1748341497\",\"product_tags\":[],\"updateDate\":1748341498175,\"updater\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"}}}}",
"body": "{\"data\":{\"id\":\"ps3-64e-shx\",\"type\":\"agent_rule\",\"attributes\":{\"actions\":[{\"set\":{\"name\":\"test_set\",\"value\":\"test_value\",\"scope\":\"process\"},\"disabled\":false},{\"hash\":{},\"disabled\":false}],\"category\":\"Process Activity\",\"creationDate\":1749827819065,\"creator\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"defaultRule\":false,\"description\":\"My Agent rule with set action\",\"enabled\":true,\"expression\":\"exec.file.name == \\\"sh\\\"\",\"filters\":[\"os == \\\"linux\\\"\"],\"monitoring\":[\"alt-4q4-baa\"],\"name\":\"testcreateaworkloadprotectionagentrulewithsetactionreturnsokresponse1749827818\",\"product_tags\":[],\"updateDate\":1749827819065,\"updater\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"}}}}",
"headers": {
"Content-Type": [
"application/json"
Expand All @@ -57,13 +57,13 @@
"timeToLive": {
"unlimited": true
},
"id": "c5a84c2d-4c46-8dbb-0a32-cdd061c7370a"
"id": "b8d1628e-7339-06f6-38f5-374d03cf338b"
},
{
"httpRequest": {
"headers": {},
"method": "DELETE",
"path": "/api/v2/remote_config/products/cws/agent_rules/zux-bp8-zov",
"path": "/api/v2/remote_config/products/cws/agent_rules/ps3-64e-shx",
"keepAlive": false,
"secure": true
},
Expand All @@ -82,13 +82,13 @@
"timeToLive": {
"unlimited": true
},
"id": "de4853db-6fb4-726f-2321-f1eb00c650fc"
"id": "2e30739b-44e5-f2cd-6998-ce6f2d27a7b6"
},
{
"httpRequest": {
"headers": {},
"method": "DELETE",
"path": "/api/v2/remote_config/products/cws/policy/qyj-iza-vbu",
"path": "/api/v2/remote_config/products/cws/policy/alt-4q4-baa",
"keepAlive": false,
"secure": true
},
Expand All @@ -107,6 +107,6 @@
"timeToLive": {
"unlimited": true
},
"id": "aae849c3-ab82-d6f0-8976-5674ade5c71d"
"id": "8c258b51-4925-24fa-c829-d30a4be958c3"
}
]
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2025-05-27T10:25:02.351Z
2025-06-13T15:16:43.100Z
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"httpRequest": {
"body": {
"type": "JSON",
"json": "{\"data\":{\"attributes\":{\"description\":\"My agent policy\",\"enabled\":true,\"hostTags\":[\"env:staging\"],\"name\":\"testdeleteaworkloadprotectionagentrulereturnsokresponse1748341502\"},\"type\":\"policy\"}}"
"json": "{\"data\":{\"attributes\":{\"description\":\"My agent policy\",\"enabled\":true,\"hostTags\":[\"env:staging\"],\"name\":\"testdeleteaworkloadprotectionagentrulereturnsokresponse1749827803\"},\"type\":\"policy\"}}"
},
"headers": {},
"method": "POST",
Expand All @@ -12,7 +12,7 @@
"secure": true
},
"httpResponse": {
"body": "{\"data\":{\"id\":\"ney-zeu-tex\",\"type\":\"policy\",\"attributes\":{\"blockingRulesCount\":0,\"datadogManaged\":false,\"description\":\"My agent policy\",\"disabledRulesCount\":1,\"enabled\":true,\"hostTags\":[\"env:staging\"],\"monitoringRulesCount\":225,\"name\":\"testdeleteaworkloadprotectionagentrulereturnsokresponse1748341502\",\"policyVersion\":\"1\",\"priority\":1000000011,\"ruleCount\":226,\"updateDate\":1748341502642,\"updater\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"}}}}",
"body": "{\"data\":{\"id\":\"tn0-tjy-vwh\",\"type\":\"policy\",\"attributes\":{\"blockingRulesCount\":0,\"datadogManaged\":false,\"description\":\"My agent policy\",\"disabledRulesCount\":1,\"enabled\":true,\"hostTags\":[\"env:staging\"],\"monitoringRulesCount\":225,\"name\":\"testdeleteaworkloadprotectionagentrulereturnsokresponse1749827803\",\"policyVersion\":\"1\",\"priority\":1000000013,\"ruleCount\":226,\"updateDate\":1749827803539,\"updater\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"}}}}",
"headers": {
"Content-Type": [
"application/json"
Expand All @@ -27,13 +27,13 @@
"timeToLive": {
"unlimited": true
},
"id": "35bbae56-8f61-568e-de69-47c665ea0e01"
"id": "f5263bd7-a7e1-425a-b112-3cab47f353c2"
},
{
"httpRequest": {
"body": {
"type": "JSON",
"json": "{\"data\":{\"attributes\":{\"actions\":[{\"set\":{\"name\":\"test_set\",\"scope\":\"process\",\"value\":\"test_value\"}}],\"description\":\"My Agent rule\",\"enabled\":true,\"expression\":\"exec.file.name == \\\"sh\\\"\",\"name\":\"testdeleteaworkloadprotectionagentrulereturnsokresponse1748341502\",\"policy_id\":\"ney-zeu-tex\",\"product_tags\":[\"security:attack\",\"technique:T1059\"]},\"type\":\"agent_rule\"}}"
"json": "{\"data\":{\"attributes\":{\"actions\":[{\"set\":{\"name\":\"test_set\",\"scope\":\"process\",\"value\":\"test_value\"}},{\"hash\":{}}],\"description\":\"My Agent rule\",\"enabled\":true,\"expression\":\"exec.file.name == \\\"sh\\\"\",\"name\":\"testdeleteaworkloadprotectionagentrulereturnsokresponse1749827803\",\"policy_id\":\"tn0-tjy-vwh\",\"product_tags\":[\"security:attack\",\"technique:T1059\"]},\"type\":\"agent_rule\"}}"
},
"headers": {},
"method": "POST",
Expand All @@ -42,7 +42,7 @@
"secure": true
},
"httpResponse": {
"body": "{\"data\":{\"id\":\"gys-bzk-zs4\",\"type\":\"agent_rule\",\"attributes\":{\"actions\":[{\"set\":{\"name\":\"test_set\",\"value\":\"test_value\",\"scope\":\"process\"},\"disabled\":false}],\"category\":\"Process Activity\",\"creationDate\":1748341503254,\"creator\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"defaultRule\":false,\"description\":\"My Agent rule\",\"enabled\":true,\"expression\":\"exec.file.name == \\\"sh\\\"\",\"filters\":[\"os == \\\"linux\\\"\"],\"monitoring\":[\"ney-zeu-tex\"],\"name\":\"testdeleteaworkloadprotectionagentrulereturnsokresponse1748341502\",\"product_tags\":[\"security:attack\",\"technique:T1059\"],\"updateDate\":1748341503254,\"updater\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"}}}}",
"body": "{\"data\":{\"id\":\"hm0-n7p-hq7\",\"type\":\"agent_rule\",\"attributes\":{\"actions\":[{\"set\":{\"name\":\"test_set\",\"value\":\"test_value\",\"scope\":\"process\"},\"disabled\":false},{\"hash\":{},\"disabled\":false}],\"category\":\"Process Activity\",\"creationDate\":1749827804150,\"creator\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"defaultRule\":false,\"description\":\"My Agent rule\",\"enabled\":true,\"expression\":\"exec.file.name == \\\"sh\\\"\",\"filters\":[\"os == \\\"linux\\\"\"],\"monitoring\":[\"tn0-tjy-vwh\"],\"name\":\"testdeleteaworkloadprotectionagentrulereturnsokresponse1749827803\",\"product_tags\":[\"security:attack\",\"technique:T1059\"],\"updateDate\":1749827804150,\"updater\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"}}}}",
"headers": {
"Content-Type": [
"application/json"
Expand All @@ -57,16 +57,16 @@
"timeToLive": {
"unlimited": true
},
"id": "47e2316e-b74b-8f0c-c1d3-3fd0692e4107"
"id": "77fdc0ba-cd06-5c8b-d115-0767402fb565"
},
{
"httpRequest": {
"headers": {},
"method": "DELETE",
"path": "/api/v2/remote_config/products/cws/agent_rules/gys-bzk-zs4",
"path": "/api/v2/remote_config/products/cws/agent_rules/hm0-n7p-hq7",
"queryStringParameters": {
"policy_id": [
"ney-zeu-tex"
"tn0-tjy-vwh"
]
},
"keepAlive": false,
Expand All @@ -87,13 +87,13 @@
"timeToLive": {
"unlimited": true
},
"id": "b7ea5ab7-5071-abc5-f069-2aed3ff8500f"
"id": "102a27ad-c486-6948-f39a-3ac93ef7120f"
},
{
"httpRequest": {
"headers": {},
"method": "DELETE",
"path": "/api/v2/remote_config/products/cws/agent_rules/gys-bzk-zs4",
"path": "/api/v2/remote_config/products/cws/agent_rules/hm0-n7p-hq7",
"keepAlive": false,
"secure": true
},
Expand All @@ -113,13 +113,13 @@
"timeToLive": {
"unlimited": true
},
"id": "a8735ec0-33f5-01cc-f0ad-79bb449d8764"
"id": "071c70f0-e64c-9b29-92b1-d30b8ae116a8"
},
{
"httpRequest": {
"headers": {},
"method": "DELETE",
"path": "/api/v2/remote_config/products/cws/policy/ney-zeu-tex",
"path": "/api/v2/remote_config/products/cws/policy/tn0-tjy-vwh",
"keepAlive": false,
"secure": true
},
Expand All @@ -138,6 +138,6 @@
"timeToLive": {
"unlimited": true
},
"id": "5c3879bc-7035-b3e1-518b-a3df1638b00a"
"id": "df9f53da-3e41-888c-18aa-2a10201ae88e"
}
]
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2025-05-27T10:25:11.236Z
2025-06-13T15:16:09.321Z
Loading