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-04-10 11:41:57.737818",
"spec_repo_commit": "7f98e0a9"
"regenerated": "2025-04-10 18:01:24.451821",
"spec_repo_commit": "c0a45137"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-04-10 11:41:57.752970",
"spec_repo_commit": "7f98e0a9"
"regenerated": "2025-04-10 18:01:24.467888",
"spec_repo_commit": "c0a45137"
}
}
}
9 changes: 9 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27215,6 +27215,7 @@ components:
$ref: '#/components/schemas/SecurityMonitoringRuleCaseActionType'
type: object
SecurityMonitoringRuleCaseActionOptions:
additionalProperties: {}
description: Options for the rule action
properties:
duration:
Expand All @@ -27223,16 +27224,24 @@ components:
format: int64
minimum: 0
type: integer
userBehaviorName:
$ref: '#/components/schemas/SecurityMonitoringRuleCaseActionOptionsUserBehaviorName'
type: object
SecurityMonitoringRuleCaseActionOptionsUserBehaviorName:
description: Used with the case action of type 'user_behavior'. The value specified
in this field is applied as a risk tag to all users affected by the rule.
type: string
SecurityMonitoringRuleCaseActionType:
description: The action type.
enum:
- block_ip
- block_user
- user_behavior
type: string
x-enum-varnames:
- BLOCK_IP
- BLOCK_USER
- USER_BEHAVIOR
SecurityMonitoringRuleCaseCreate:
description: Case when signal is generated.
properties:
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2025-02-06T16:50:39.787Z
2025-04-09T15:02:05.047Z

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 @@ -31,6 +31,12 @@
duration: 900,
}),
}),
DatadogAPIClient::V2::SecurityMonitoringRuleCaseAction.new({
type: DatadogAPIClient::V2::SecurityMonitoringRuleCaseActionType::USER_BEHAVIOR,
options: DatadogAPIClient::V2::SecurityMonitoringRuleCaseActionOptions.new({
user_behavior_name: "behavior",
}),
}),
],
}),
],
Expand Down
2 changes: 1 addition & 1 deletion features/v2/security_monitoring.feature
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ Feature: Security Monitoring
@skip-validation @team:DataDog/k9-cloud-security-platform
Scenario: Create a detection rule with type 'application_security 'returns "OK" response
Given new "CreateSecurityMonitoringRule" request
And body with value {"type":"application_security","name":"{{unique}}_appsec_rule","queries":[{"query":"@appsec.security_activity:business_logic.users.login.failure","aggregation":"count","groupByFields":["service","@http.client_ip"],"distinctFields":[]}],"filters":[],"cases":[{"name":"","status":"info","notifications":[],"condition":"a > 100000","actions":[{"type":"block_ip","options":{"duration":900}}]}],"options":{"keepAlive":3600,"maxSignalDuration":86400,"evaluationWindow":900,"detectionMethod":"threshold"},"isEnabled":true,"message":"Test rule","tags":[],"groupSignalsBy":["service"]}
And body with value {"type":"application_security","name":"{{unique}}_appsec_rule","queries":[{"query":"@appsec.security_activity:business_logic.users.login.failure","aggregation":"count","groupByFields":["service","@http.client_ip"],"distinctFields":[]}],"filters":[],"cases":[{"name":"","status":"info","notifications":[],"condition":"a > 100000","actions":[{"type":"block_ip","options":{"duration":900}}, {"type":"user_behavior","options":{"userBehaviorName":"behavior"}}]}],"options":{"keepAlive":3600,"maxSignalDuration":86400,"evaluationWindow":900,"detectionMethod":"threshold"},"isEnabled":true,"message":"Test rule","tags":[],"groupSignalsBy":["service"]}
When the request is sent
Then the response status is 200 OK
And the response "name" is equal to "{{ unique }}_appsec_rule"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,26 @@ class SecurityMonitoringRuleCaseActionOptions
# Duration of the action in seconds. 0 indicates no expiration.
attr_reader :duration

# Used with the case action of type 'user_behavior'. The value specified in this field is applied as a risk tag to all users affected by the rule.
attr_accessor :user_behavior_name

attr_accessor :additional_properties

# Attribute mapping from ruby-style variable name to JSON key.
# @!visibility private
def self.attribute_map
{
:'duration' => :'duration'
:'duration' => :'duration',
:'user_behavior_name' => :'userBehaviorName'
}
end

# Attribute type mapping.
# @!visibility private
def self.openapi_types
{
:'duration' => :'Integer'
:'duration' => :'Integer',
:'user_behavior_name' => :'String'
}
end

Expand All @@ -63,6 +68,10 @@ def initialize(attributes = {})
if attributes.key?(:'duration')
self.duration = attributes[:'duration']
end

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

# Check to see if the all the properties in the model are valid
Expand Down Expand Up @@ -110,14 +119,15 @@ def ==(o)
return true if self.equal?(o)
self.class == o.class &&
duration == o.duration &&
user_behavior_name == o.user_behavior_name &&
additional_properties == o.additional_properties
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[duration, additional_properties].hash
[duration, user_behavior_name, additional_properties].hash
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ class SecurityMonitoringRuleCaseActionType

BLOCK_IP = "block_ip".freeze
BLOCK_USER = "block_user".freeze
USER_BEHAVIOR = "user_behavior".freeze
end
end
Loading