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": "2024-12-26 16:01:44.053811",
"spec_repo_commit": "f2e98b01"
"regenerated": "2025-01-02 14:39:40.447374",
"spec_repo_commit": "b4e964b3"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-12-26 16:01:44.071562",
"spec_repo_commit": "f2e98b01"
"regenerated": "2025-01-02 14:39:40.463809",
"spec_repo_commit": "b4e964b3"
}
}
}
21 changes: 21 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24825,6 +24825,12 @@ components:
as the search bar for detection rules.
example: type:log_detection source:cloudtrail
type: string
start_date:
description: A Unix millisecond timestamp giving the start date for the
suppression rule. After this date, it starts suppressing signals.
example: 1703187336000
format: int64
type: integer
suppression_query:
description: The suppression query of the suppression rule. If a signal
matches this query, it is suppressed and not triggered. Same syntax as
Expand Down Expand Up @@ -24880,6 +24886,12 @@ components:
as the search bar for detection rules.
example: type:log_detection source:cloudtrail
type: string
start_date:
description: A Unix millisecond timestamp giving the start date for the
suppression rule. After this date, it starts suppressing signals.
example: 1703187336000
format: int64
type: integer
suppression_query:
description: The suppression query of the suppression rule. If a signal
matches this query, it is suppressed and is not triggered. It uses the
Expand Down Expand Up @@ -24966,6 +24978,15 @@ components:
as the search bar for detection rules.
example: type:log_detection source:cloudtrail
type: string
start_date:
description: A Unix millisecond timestamp giving the start date for the
suppression rule. After this date, it starts suppressing signals. If unset,
the start date of the suppression rule is left untouched. If set to `null`,
the start date is removed.
example: 1703187336000
format: int64
nullable: true
type: integer
suppression_query:
description: The suppression query of the suppression rule. If a signal
matches this query, it is suppressed and not triggered. Same syntax as
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-05-20T17:07:03.155Z
2024-11-27T15:22:34.711Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-05-20T17:07:12.131Z
2024-11-27T15:24:35.169Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
attributes: DatadogAPIClient::V2::SecurityMonitoringSuppressionCreateAttributes.new({
description: "This rule suppresses low-severity signals in staging environments.",
enabled: true,
start_date: 1637493071000,
expiration_date: 1638443471000,
name: "Example-Security-Monitoring",
rule_query: "type:log_detection source:cloudtrail",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
attributes: DatadogAPIClient::V2::SecurityMonitoringSuppressionCreateAttributes.new({
description: "This rule suppresses low-severity signals in staging environments.",
enabled: true,
start_date: 1637493071000,
expiration_date: 1638443471000,
name: "Example-Security-Monitoring",
rule_query: "type:log_detection source:cloudtrail",
Expand Down
14 changes: 7 additions & 7 deletions features/v2/security_monitoring.feature
Original file line number Diff line number Diff line change
Expand Up @@ -264,21 +264,21 @@ Feature: Security Monitoring
@generated @skip @team:DataDog/k9-cloud-security-platform
Scenario: Create a suppression rule returns "Bad Request" response
Given new "CreateSecurityMonitoringSuppression" request
And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}}
And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "start_date": 1703187336000, "suppression_query": "env:staging status:low"}, "type": "suppressions"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/k9-cloud-security-platform
Scenario: Create a suppression rule returns "Conflict" response
Given new "CreateSecurityMonitoringSuppression" request
And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}}
And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "start_date": 1703187336000, "suppression_query": "env:staging status:low"}, "type": "suppressions"}}
When the request is sent
Then the response status is 409 Conflict

@skip-validation @team:DataDog/k9-cloud-security-platform
Scenario: Create a suppression rule returns "OK" response
Given new "CreateSecurityMonitoringSuppression" request
And body with value {"data": {"attributes": {"description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": {{ timestamp('now + 21d') }}000, "name": "{{ unique }}", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}}
And body with value {"data": {"attributes": {"description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "start_date": {{ timestamp('now + 10d') }}000, "expiration_date": {{ timestamp('now + 21d') }}000, "name": "{{ unique }}", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}}
When the request is sent
Then the response status is 200 OK
And the response "data.type" is equal to "suppressions"
Expand All @@ -288,7 +288,7 @@ Feature: Security Monitoring
@skip-validation @team:DataDog/k9-cloud-security-platform
Scenario: Create a suppression rule with an exclusion query returns "OK" response
Given new "CreateSecurityMonitoringSuppression" request
And body with value {"data": {"attributes": {"description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": {{ timestamp('now + 21d') }}000, "name": "{{ unique }}", "rule_query": "type:log_detection source:cloudtrail", "data_exclusion_query": "account_id:12345"}, "type": "suppressions"}}
And body with value {"data": {"attributes": {"description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "start_date": {{ timestamp('now + 10d') }}000, "expiration_date": {{ timestamp('now + 21d') }}000, "name": "{{ unique }}", "rule_query": "type:log_detection source:cloudtrail", "data_exclusion_query": "account_id:12345"}, "type": "suppressions"}}
When the request is sent
Then the response status is 200 OK
And the response "data.type" is equal to "suppressions"
Expand Down Expand Up @@ -867,23 +867,23 @@ Feature: Security Monitoring
Scenario: Update a suppression rule returns "Bad Request" response
Given new "UpdateSecurityMonitoringSuppression" request
And request contains "suppression_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}}
And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "start_date": 1703187336000, "suppression_query": "env:staging status:low"}, "type": "suppressions"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/k9-cloud-security-platform
Scenario: Update a suppression rule returns "Concurrent Modification" response
Given new "UpdateSecurityMonitoringSuppression" request
And request contains "suppression_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}}
And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "start_date": 1703187336000, "suppression_query": "env:staging status:low"}, "type": "suppressions"}}
When the request is sent
Then the response status is 409 Concurrent Modification

@generated @skip @team:DataDog/k9-cloud-security-platform
Scenario: Update a suppression rule returns "Not Found" response
Given new "UpdateSecurityMonitoringSuppression" request
And request contains "suppression_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}}
And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "start_date": 1703187336000, "suppression_query": "env:staging status:low"}, "type": "suppressions"}}
When the request is sent
Then the response status is 404 Not Found

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ class SecurityMonitoringSuppressionAttributes
# The rule query of the suppression rule, with the same syntax as the search bar for detection rules.
attr_accessor :rule_query

# A Unix millisecond timestamp giving the start date for the suppression rule. After this date, it starts suppressing signals.
attr_accessor :start_date

# The suppression query of the suppression rule. If a signal matches this query, it is suppressed and not triggered. Same syntax as the queries to search signals in the signal explorer.
attr_accessor :suppression_query

Expand Down Expand Up @@ -75,6 +78,7 @@ def self.attribute_map
:'expiration_date' => :'expiration_date',
:'name' => :'name',
:'rule_query' => :'rule_query',
:'start_date' => :'start_date',
:'suppression_query' => :'suppression_query',
:'update_date' => :'update_date',
:'updater' => :'updater',
Expand All @@ -95,6 +99,7 @@ def self.openapi_types
:'expiration_date' => :'Integer',
:'name' => :'String',
:'rule_query' => :'String',
:'start_date' => :'Integer',
:'suppression_query' => :'String',
:'update_date' => :'Integer',
:'updater' => :'SecurityMonitoringUser',
Expand Down Expand Up @@ -156,6 +161,10 @@ def initialize(attributes = {})
self.rule_query = attributes[:'rule_query']
end

if attributes.key?(:'start_date')
self.start_date = attributes[:'start_date']
end

if attributes.key?(:'suppression_query')
self.suppression_query = attributes[:'suppression_query']
end
Expand Down Expand Up @@ -226,6 +235,7 @@ def ==(o)
expiration_date == o.expiration_date &&
name == o.name &&
rule_query == o.rule_query &&
start_date == o.start_date &&
suppression_query == o.suppression_query &&
update_date == o.update_date &&
updater == o.updater &&
Expand All @@ -237,7 +247,7 @@ def ==(o)
# @return [Integer] Hash code
# @!visibility private
def hash
[creation_date, creator, data_exclusion_query, description, editable, enabled, expiration_date, name, rule_query, suppression_query, update_date, updater, version, additional_properties].hash
[creation_date, creator, data_exclusion_query, description, editable, enabled, expiration_date, name, rule_query, start_date, suppression_query, update_date, updater, version, additional_properties].hash
end
end
end
Loading
Loading