From 44ee85df33486e123d57cf001636f0c6dd68767c Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 22 Dec 2021 23:24:05 +0000 Subject: [PATCH] Regenerate client from commit 2f072b0 of spec repo --- .apigentools-info | 8 +-- .generator/schemas/v2/openapi.yaml | 22 -------- api/v2/datadog/.openapi-generator/FILES | 2 - api/v2/datadog/README.md | 1 - .../docs/SecurityMonitoringRuleQuery.md | 26 --------- .../docs/SecurityMonitoringRuleQueryCreate.md | 26 --------- .../model_security_monitoring_rule_query.go | 38 ------------- ...l_security_monitoring_rule_query_create.go | 38 ------------- .../CreateSecurityMonitoringRule_498211763.go | 4 -- ...rkload_security_returns_OK_response.freeze | 2 +- ...workload_security_returns_OK_response.yaml | 54 +++++++++---------- .../features/v2/security_monitoring.feature | 8 +-- 12 files changed, 35 insertions(+), 194 deletions(-) diff --git a/.apigentools-info b/.apigentools-info index 91e3c08f384..1e85aec7c36 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.5.1.dev2", - "regenerated": "2021-12-22 22:13:09.436091", - "spec_repo_commit": "861a3c0" + "regenerated": "2021-12-22 23:23:11.898875", + "spec_repo_commit": "2f072b0" }, "v2": { "apigentools_version": "1.5.1.dev2", - "regenerated": "2021-12-22 22:13:09.456795", - "spec_repo_commit": "861a3c0" + "regenerated": "2021-12-22 23:23:11.918615", + "spec_repo_commit": "2f072b0" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index c51c82ffed0..bf3700745d7 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -4695,8 +4695,6 @@ components: SecurityMonitoringRuleQuery: description: Query for matching rule. properties: - agentRule: - $ref: '#/components/schemas/SecurityMonitoringRuntimeAgentRule' aggregation: $ref: '#/components/schemas/SecurityMonitoringRuleQueryAggregation' distinctFields: @@ -4741,8 +4739,6 @@ components: SecurityMonitoringRuleQueryCreate: description: Query for matching rule. properties: - agentRule: - $ref: '#/components/schemas/SecurityMonitoringRuntimeAgentRule' aggregation: $ref: '#/components/schemas/SecurityMonitoringRuleQueryAggregation' distinctFields: @@ -4925,24 +4921,6 @@ components: maximum: 2147483647 type: integer type: object - SecurityMonitoringRuntimeAgentRule: - description: The Agent rule. - properties: - agentRuleId: - description: The Agent rule ID. Must be unique within the rule. - example: etc_shadow - type: string - expression: - description: 'A Runtime Security expression determines what activity should - be collected by the Datadog Agent. - - These logical expressions can use predefined operators and attributes. - Tags cannot be used in Runtime - - Security expressions. Instead, allow or deny based on tags under the advanced - option.' - type: string - type: object SecurityMonitoringSignal: description: Object description of a security signal. properties: diff --git a/api/v2/datadog/.openapi-generator/FILES b/api/v2/datadog/.openapi-generator/FILES index 0d5d455b940..f4aae5eac56 100644 --- a/api/v2/datadog/.openapi-generator/FILES +++ b/api/v2/datadog/.openapi-generator/FILES @@ -328,7 +328,6 @@ docs/SecurityMonitoringRuleSeverity.md docs/SecurityMonitoringRuleTypeCreate.md docs/SecurityMonitoringRuleTypeRead.md docs/SecurityMonitoringRuleUpdatePayload.md -docs/SecurityMonitoringRuntimeAgentRule.md docs/SecurityMonitoringSignal.md docs/SecurityMonitoringSignalAttributes.md docs/SecurityMonitoringSignalListRequest.md @@ -667,7 +666,6 @@ model_security_monitoring_rule_severity.go model_security_monitoring_rule_type_create.go model_security_monitoring_rule_type_read.go model_security_monitoring_rule_update_payload.go -model_security_monitoring_runtime_agent_rule.go model_security_monitoring_signal.go model_security_monitoring_signal_attributes.go model_security_monitoring_signal_list_request.go diff --git a/api/v2/datadog/README.md b/api/v2/datadog/README.md index 94d6f0a8195..c3ace838566 100644 --- a/api/v2/datadog/README.md +++ b/api/v2/datadog/README.md @@ -482,7 +482,6 @@ Class | Method | HTTP request | Description - [SecurityMonitoringRuleTypeCreate](docs/SecurityMonitoringRuleTypeCreate.md) - [SecurityMonitoringRuleTypeRead](docs/SecurityMonitoringRuleTypeRead.md) - [SecurityMonitoringRuleUpdatePayload](docs/SecurityMonitoringRuleUpdatePayload.md) - - [SecurityMonitoringRuntimeAgentRule](docs/SecurityMonitoringRuntimeAgentRule.md) - [SecurityMonitoringSignal](docs/SecurityMonitoringSignal.md) - [SecurityMonitoringSignalAttributes](docs/SecurityMonitoringSignalAttributes.md) - [SecurityMonitoringSignalListRequest](docs/SecurityMonitoringSignalListRequest.md) diff --git a/api/v2/datadog/docs/SecurityMonitoringRuleQuery.md b/api/v2/datadog/docs/SecurityMonitoringRuleQuery.md index 672046385ad..abe8c33eb10 100644 --- a/api/v2/datadog/docs/SecurityMonitoringRuleQuery.md +++ b/api/v2/datadog/docs/SecurityMonitoringRuleQuery.md @@ -4,7 +4,6 @@ Name | Type | Description | Notes ---- | ---- | ----------- | ------ -**AgentRule** | Pointer to [**SecurityMonitoringRuntimeAgentRule**](SecurityMonitoringRuntimeAgentRule.md) | | [optional] **Aggregation** | Pointer to [**SecurityMonitoringRuleQueryAggregation**](SecurityMonitoringRuleQueryAggregation.md) | | [optional] **DistinctFields** | Pointer to **[]string** | Field for which the cardinality is measured. Sent as an array. | [optional] **GroupByFields** | Pointer to **[]string** | Fields to group by. | [optional] @@ -31,31 +30,6 @@ NewSecurityMonitoringRuleQueryWithDefaults instantiates a new SecurityMonitoring This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set. -### GetAgentRule - -`func (o *SecurityMonitoringRuleQuery) GetAgentRule() SecurityMonitoringRuntimeAgentRule` - -GetAgentRule returns the AgentRule field if non-nil, zero value otherwise. - -### GetAgentRuleOk - -`func (o *SecurityMonitoringRuleQuery) GetAgentRuleOk() (*SecurityMonitoringRuntimeAgentRule, bool)` - -GetAgentRuleOk returns a tuple with the AgentRule field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetAgentRule - -`func (o *SecurityMonitoringRuleQuery) SetAgentRule(v SecurityMonitoringRuntimeAgentRule)` - -SetAgentRule sets AgentRule field to given value. - -### HasAgentRule - -`func (o *SecurityMonitoringRuleQuery) HasAgentRule() bool` - -HasAgentRule returns a boolean if a field has been set. - ### GetAggregation `func (o *SecurityMonitoringRuleQuery) GetAggregation() SecurityMonitoringRuleQueryAggregation` diff --git a/api/v2/datadog/docs/SecurityMonitoringRuleQueryCreate.md b/api/v2/datadog/docs/SecurityMonitoringRuleQueryCreate.md index 2da0222722d..b2fd2b4df60 100644 --- a/api/v2/datadog/docs/SecurityMonitoringRuleQueryCreate.md +++ b/api/v2/datadog/docs/SecurityMonitoringRuleQueryCreate.md @@ -4,7 +4,6 @@ Name | Type | Description | Notes ---- | ---- | ----------- | ------ -**AgentRule** | Pointer to [**SecurityMonitoringRuntimeAgentRule**](SecurityMonitoringRuntimeAgentRule.md) | | [optional] **Aggregation** | Pointer to [**SecurityMonitoringRuleQueryAggregation**](SecurityMonitoringRuleQueryAggregation.md) | | [optional] **DistinctFields** | Pointer to **[]string** | Field for which the cardinality is measured. Sent as an array. | [optional] **GroupByFields** | Pointer to **[]string** | Fields to group by. | [optional] @@ -31,31 +30,6 @@ NewSecurityMonitoringRuleQueryCreateWithDefaults instantiates a new SecurityMoni This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set. -### GetAgentRule - -`func (o *SecurityMonitoringRuleQueryCreate) GetAgentRule() SecurityMonitoringRuntimeAgentRule` - -GetAgentRule returns the AgentRule field if non-nil, zero value otherwise. - -### GetAgentRuleOk - -`func (o *SecurityMonitoringRuleQueryCreate) GetAgentRuleOk() (*SecurityMonitoringRuntimeAgentRule, bool)` - -GetAgentRuleOk returns a tuple with the AgentRule field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetAgentRule - -`func (o *SecurityMonitoringRuleQueryCreate) SetAgentRule(v SecurityMonitoringRuntimeAgentRule)` - -SetAgentRule sets AgentRule field to given value. - -### HasAgentRule - -`func (o *SecurityMonitoringRuleQueryCreate) HasAgentRule() bool` - -HasAgentRule returns a boolean if a field has been set. - ### GetAggregation `func (o *SecurityMonitoringRuleQueryCreate) GetAggregation() SecurityMonitoringRuleQueryAggregation` diff --git a/api/v2/datadog/model_security_monitoring_rule_query.go b/api/v2/datadog/model_security_monitoring_rule_query.go index d1f1d2e8a13..822aae0b2d9 100644 --- a/api/v2/datadog/model_security_monitoring_rule_query.go +++ b/api/v2/datadog/model_security_monitoring_rule_query.go @@ -14,7 +14,6 @@ import ( // SecurityMonitoringRuleQuery Query for matching rule. type SecurityMonitoringRuleQuery struct { - AgentRule *SecurityMonitoringRuntimeAgentRule `json:"agentRule,omitempty"` Aggregation *SecurityMonitoringRuleQueryAggregation `json:"aggregation,omitempty"` // Field for which the cardinality is measured. Sent as an array. DistinctFields *[]string `json:"distinctFields,omitempty"` @@ -47,38 +46,6 @@ func NewSecurityMonitoringRuleQueryWithDefaults() *SecurityMonitoringRuleQuery { return &this } -// GetAgentRule returns the AgentRule field value if set, zero value otherwise. -func (o *SecurityMonitoringRuleQuery) GetAgentRule() SecurityMonitoringRuntimeAgentRule { - if o == nil || o.AgentRule == nil { - var ret SecurityMonitoringRuntimeAgentRule - return ret - } - return *o.AgentRule -} - -// GetAgentRuleOk returns a tuple with the AgentRule field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SecurityMonitoringRuleQuery) GetAgentRuleOk() (*SecurityMonitoringRuntimeAgentRule, bool) { - if o == nil || o.AgentRule == nil { - return nil, false - } - return o.AgentRule, true -} - -// HasAgentRule returns a boolean if a field has been set. -func (o *SecurityMonitoringRuleQuery) HasAgentRule() bool { - if o != nil && o.AgentRule != nil { - return true - } - - return false -} - -// SetAgentRule gets a reference to the given SecurityMonitoringRuntimeAgentRule and assigns it to the AgentRule field. -func (o *SecurityMonitoringRuleQuery) SetAgentRule(v SecurityMonitoringRuntimeAgentRule) { - o.AgentRule = &v -} - // GetAggregation returns the Aggregation field value if set, zero value otherwise. func (o *SecurityMonitoringRuleQuery) GetAggregation() SecurityMonitoringRuleQueryAggregation { if o == nil || o.Aggregation == nil { @@ -276,9 +243,6 @@ func (o SecurityMonitoringRuleQuery) MarshalJSON() ([]byte, error) { if o.UnparsedObject != nil { return json.Marshal(o.UnparsedObject) } - if o.AgentRule != nil { - toSerialize["agentRule"] = o.AgentRule - } if o.Aggregation != nil { toSerialize["aggregation"] = o.Aggregation } @@ -303,7 +267,6 @@ func (o SecurityMonitoringRuleQuery) MarshalJSON() ([]byte, error) { func (o *SecurityMonitoringRuleQuery) UnmarshalJSON(bytes []byte) (err error) { raw := map[string]interface{}{} all := struct { - AgentRule *SecurityMonitoringRuntimeAgentRule `json:"agentRule,omitempty"` Aggregation *SecurityMonitoringRuleQueryAggregation `json:"aggregation,omitempty"` DistinctFields *[]string `json:"distinctFields,omitempty"` GroupByFields *[]string `json:"groupByFields,omitempty"` @@ -328,7 +291,6 @@ func (o *SecurityMonitoringRuleQuery) UnmarshalJSON(bytes []byte) (err error) { o.UnparsedObject = raw return nil } - o.AgentRule = all.AgentRule o.Aggregation = all.Aggregation o.DistinctFields = all.DistinctFields o.GroupByFields = all.GroupByFields diff --git a/api/v2/datadog/model_security_monitoring_rule_query_create.go b/api/v2/datadog/model_security_monitoring_rule_query_create.go index 17dbc5dc9a0..80563b1460d 100644 --- a/api/v2/datadog/model_security_monitoring_rule_query_create.go +++ b/api/v2/datadog/model_security_monitoring_rule_query_create.go @@ -15,7 +15,6 @@ import ( // SecurityMonitoringRuleQueryCreate Query for matching rule. type SecurityMonitoringRuleQueryCreate struct { - AgentRule *SecurityMonitoringRuntimeAgentRule `json:"agentRule,omitempty"` Aggregation *SecurityMonitoringRuleQueryAggregation `json:"aggregation,omitempty"` // Field for which the cardinality is measured. Sent as an array. DistinctFields *[]string `json:"distinctFields,omitempty"` @@ -49,38 +48,6 @@ func NewSecurityMonitoringRuleQueryCreateWithDefaults() *SecurityMonitoringRuleQ return &this } -// GetAgentRule returns the AgentRule field value if set, zero value otherwise. -func (o *SecurityMonitoringRuleQueryCreate) GetAgentRule() SecurityMonitoringRuntimeAgentRule { - if o == nil || o.AgentRule == nil { - var ret SecurityMonitoringRuntimeAgentRule - return ret - } - return *o.AgentRule -} - -// GetAgentRuleOk returns a tuple with the AgentRule field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SecurityMonitoringRuleQueryCreate) GetAgentRuleOk() (*SecurityMonitoringRuntimeAgentRule, bool) { - if o == nil || o.AgentRule == nil { - return nil, false - } - return o.AgentRule, true -} - -// HasAgentRule returns a boolean if a field has been set. -func (o *SecurityMonitoringRuleQueryCreate) HasAgentRule() bool { - if o != nil && o.AgentRule != nil { - return true - } - - return false -} - -// SetAgentRule gets a reference to the given SecurityMonitoringRuntimeAgentRule and assigns it to the AgentRule field. -func (o *SecurityMonitoringRuleQueryCreate) SetAgentRule(v SecurityMonitoringRuntimeAgentRule) { - o.AgentRule = &v -} - // GetAggregation returns the Aggregation field value if set, zero value otherwise. func (o *SecurityMonitoringRuleQueryCreate) GetAggregation() SecurityMonitoringRuleQueryAggregation { if o == nil || o.Aggregation == nil { @@ -270,9 +237,6 @@ func (o SecurityMonitoringRuleQueryCreate) MarshalJSON() ([]byte, error) { if o.UnparsedObject != nil { return json.Marshal(o.UnparsedObject) } - if o.AgentRule != nil { - toSerialize["agentRule"] = o.AgentRule - } if o.Aggregation != nil { toSerialize["aggregation"] = o.Aggregation } @@ -300,7 +264,6 @@ func (o *SecurityMonitoringRuleQueryCreate) UnmarshalJSON(bytes []byte) (err err Query *string `json:"query"` }{} all := struct { - AgentRule *SecurityMonitoringRuntimeAgentRule `json:"agentRule,omitempty"` Aggregation *SecurityMonitoringRuleQueryAggregation `json:"aggregation,omitempty"` DistinctFields *[]string `json:"distinctFields,omitempty"` GroupByFields *[]string `json:"groupByFields,omitempty"` @@ -332,7 +295,6 @@ func (o *SecurityMonitoringRuleQueryCreate) UnmarshalJSON(bytes []byte) (err err o.UnparsedObject = raw return nil } - o.AgentRule = all.AgentRule o.Aggregation = all.Aggregation o.DistinctFields = all.DistinctFields o.GroupByFields = all.GroupByFields diff --git a/examples/v2/security-monitoring/CreateSecurityMonitoringRule_498211763.go b/examples/v2/security-monitoring/CreateSecurityMonitoringRule_498211763.go index c32d9bd5c8c..87b3b24ea20 100644 --- a/examples/v2/security-monitoring/CreateSecurityMonitoringRule_498211763.go +++ b/examples/v2/security-monitoring/CreateSecurityMonitoringRule_498211763.go @@ -21,10 +21,6 @@ func main() { GroupByFields: &[]string{}, DistinctFields: &[]string{}, Metric: datadog.PtrString(""), - AgentRule: &datadog.SecurityMonitoringRuntimeAgentRule{ - AgentRuleId: datadog.PtrString("kernel_module_unlink_2"), - Expression: datadog.PtrString("(open.flags & ((O_CREAT|O_RDWR|O_WRONLY|O_TRUNC)) > 0)"), - }, }, }, Filters: &[]datadog.SecurityMonitoringFilter{}, diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_a_detection_rule_with_type_workload_security_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_a_detection_rule_with_type_workload_security_returns_OK_response.freeze index e9291f58884..e5129362926 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_a_detection_rule_with_type_workload_security_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_a_detection_rule_with_type_workload_security_returns_OK_response.freeze @@ -1 +1 @@ -2021-08-16T07:49:00.464Z \ No newline at end of file +2021-12-22T16:20:11.758Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_a_detection_rule_with_type_workload_security_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_a_detection_rule_with_type_workload_security_returns_OK_response.yaml index 451598d9f8a..86f1be1f65b 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_a_detection_rule_with_type_workload_security_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_a_detection_rule_with_type_workload_security_returns_OK_response.yaml @@ -1,33 +1,31 @@ interactions: - request: body: | - {"cases":[{"condition":"a \u003e 0","name":"","notifications":[],"status":"info"}],"filters":[],"isEnabled":true,"message":"Test rule","name":"Test-Create_a_detection_rule_with_type_workload_security_returns_OK_response-1629100140","options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"queries":[{"agentRule":{"agentRuleId":"kernel_module_unlink_2","expression":"(open.flags \u0026 ((O_CREAT|O_RDWR|O_WRONLY|O_TRUNC)) \u003e 0)"},"aggregation":"count","distinctFields":[],"groupByFields":[],"metric":"","query":"@test:true"}],"tags":[],"type":"workload_security"} + {"cases":[{"condition":"a \u003e 0","name":"","notifications":[],"status":"info"}],"filters":[],"isEnabled":true,"message":"Test rule","name":"Test-Create_a_detection_rule_with_type_workload_security_returns_OK_response-1640190011","options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"queries":[{"aggregation":"count","distinctFields":[],"groupByFields":[],"metric":"","query":"@test:true"}],"tags":[],"type":"workload_security"} form: {} headers: Accept: - - application/json, */*;q=0.8 + - '*/*' Connection: - close Content-Length: - - '573' + - '450' Content-Type: - application/json Host: - api.datadoghq.com User-Agent: - - datadog-api-client-typescript/1.0.0-beta.4 (node 14.17.4; os Linux; arch x64) + - datadog-api-spec/scripts/bdd-runner X-Datadog-Parent-Id: - - '6698455153852476541' + - '8108364429224444138' X-Datadog-Trace-Id: - - '1792726140053302697' + - '2704165638157319877' method: POST url: https://api.datadoghq.com/api/v2/security_monitoring/rules response: body: '{"creationAuthorId":1445416,"tags":[],"isEnabled":true,"hasExtendedTitle":false,"message":"Test - rule","options":{"detectionMethod":"threshold","evaluationWindow":900,"maxSignalDuration":86400,"keepAlive":3600},"version":1,"createdAt":1629100140907,"filters":[],"queries":[{"distinctFields":[],"name":"","metric":"","aggregation":"count","groupByFields":[],"query":"@agent.rule_id:(Test_Create_a_detection_rule_with_type_workload_security_returns_OK_response_1629100140_kernel_module_unlink_2 - OR kernel_module_unlink_2)","agentRule":{"expression":"(open.flags & ((O_CREAT|O_RDWR|O_WRONLY|O_TRUNC)) - > 0)","agentRuleId":"kernel_module_unlink_2"}}],"isDeleted":false,"cases":[{"status":"info","notifications":[],"name":"","condition":"a - > 0"}],"type":"workload_security","id":"csl-lpm-o3j","isDefault":false,"name":"Test-Create_a_detection_rule_with_type_workload_security_returns_OK_response-1629100140"}' + rule","options":{"detectionMethod":"threshold","evaluationWindow":900,"maxSignalDuration":86400,"keepAlive":3600},"version":1,"createdAt":1640190012032,"filters":[],"queries":[{"distinctFields":[],"name":"","metric":"","aggregation":"count","groupByFields":[],"query":"@test:true"}],"isDeleted":false,"cases":[{"status":"info","notifications":[],"name":"","condition":"a + > 0"}],"type":"workload_security","id":"h4i-5nf-xci","isDefault":false,"name":"Test-Create_a_detection_rule_with_type_workload_security_returns_OK_response-1640190011"}' code: 200 duration: '' headers: @@ -38,13 +36,13 @@ interactions: Content-Disposition: - inline Content-Length: - - '901' + - '635' Content-Security-Policy: - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report Content-Type: - application/json;charset=utf-8 Date: - - Mon, 16 Aug 2021 07:49:00 GMT + - Wed, 22 Dec 2021 16:20:12 GMT Pragma: - no-cache Strict-Transport-Security: @@ -56,32 +54,32 @@ interactions: X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: - - '600' + - '1000' X-Ratelimit-Period: - - '60' + - '10' X-Ratelimit-Remaining: - - '599' + - '999' X-Ratelimit-Reset: - - '60' + - '8' status: 200 OK - request: body: '' form: {} headers: Accept: - - application/json, */*;q=0.8 + - '*/*' Connection: - close Host: - api.datadoghq.com User-Agent: - - datadog-api-client-typescript/1.0.0-beta.4 (node 14.17.4; os Linux; arch x64) + - datadog-api-spec/scripts/bdd-runner X-Datadog-Parent-Id: - - '2468041391897675304' + - '7513683422594914900' X-Datadog-Trace-Id: - - '1792726140053302697' + - '2704165638157319877' method: DELETE - url: https://api.datadoghq.com/api/v2/security_monitoring/rules/csl-lpm-o3j + url: https://api.datadoghq.com/api/v2/security_monitoring/rules/h4i-5nf-xci response: body: '' code: 204 @@ -93,27 +91,27 @@ interactions: - close Content-Disposition: - inline - Content-Length: - - '0' Content-Security-Policy: - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report Date: - - Mon, 16 Aug 2021 07:49:01 GMT + - Wed, 22 Dec 2021 16:20:12 GMT Pragma: - no-cache Strict-Transport-Security: - max-age=15724800; + Vary: + - Accept-Encoding X-Content-Type-Options: - nosniff X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: - - '600' + - '1000' X-Ratelimit-Period: - - '60' + - '10' X-Ratelimit-Remaining: - - '598' + - '998' X-Ratelimit-Reset: - - '59' + - '8' status: 204 No Content version: 1 diff --git a/tests/scenarios/features/v2/security_monitoring.feature b/tests/scenarios/features/v2/security_monitoring.feature index b7cbb09495d..4a91d1f4c5d 100644 --- a/tests/scenarios/features/v2/security_monitoring.feature +++ b/tests/scenarios/features/v2/security_monitoring.feature @@ -24,7 +24,7 @@ Feature: Security Monitoring @team:DataDog/security-monitoring Scenario: Create a detection rule with type 'workload_security' returns "OK" response Given new "CreateSecurityMonitoringRule" request - And body with value {"name":"{{ unique }}", "queries":[{"query":"@test:true","aggregation":"count","groupByFields":[],"distinctFields":[],"metric":"", "agentRule":{"agentRuleId": "kernel_module_unlink_2", "expression": "(open.flags & ((O_CREAT|O_RDWR|O_WRONLY|O_TRUNC)) > 0)"}}],"filters":[],"cases":[{"name":"","status":"info","condition":"a > 0","notifications":[]}],"options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"message":"Test rule","tags":[],"isEnabled":true, "type": "workload_security"} + And body with value {"name":"{{ unique }}", "queries":[{"query":"@test:true","aggregation":"count","groupByFields":[],"distinctFields":[],"metric":""}],"filters":[],"cases":[{"name":"","status":"info","condition":"a > 0","notifications":[]}],"options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"message":"Test rule","tags":[],"isEnabled":true, "type": "workload_security"} When the request is sent Then the response status is 200 OK @@ -207,7 +207,7 @@ Feature: Security Monitoring Scenario: Update an existing rule returns "Bad Request" response Given new "UpdateSecurityMonitoringRule" request And request contains "rule_id" parameter from "REPLACE.ME" - And body with value {"cases": [{"condition": null, "name": null, "notifications": [null], "status": "critical"}], "filters": [{"action": "require", "query": null}], "hasExtendedTitle": true, "isEnabled": null, "message": null, "name": null, "options": {"detectionMethod": "threshold", "evaluationWindow": 0, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0}}, "queries": [{"agentRule": {"agentRuleId": "etc_shadow", "expression": null}, "aggregation": "count", "distinctFields": [null], "groupByFields": [null], "metric": null, "name": null, "query": null}], "tags": [null], "version": 1} + And body with value {"cases": [{"condition": null, "name": null, "notifications": [null], "status": "critical"}], "filters": [{"action": "require", "query": null}], "hasExtendedTitle": true, "isEnabled": null, "message": null, "name": null, "options": {"detectionMethod": "threshold", "evaluationWindow": 0, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0}}, "queries": [{"aggregation": "count", "distinctFields": [null], "groupByFields": [null], "metric": null, "name": null, "query": null}], "tags": [null], "version": 1} When the request is sent Then the response status is 400 Bad Request @@ -215,7 +215,7 @@ Feature: Security Monitoring Scenario: Update an existing rule returns "Not Found" response Given new "UpdateSecurityMonitoringRule" request And request contains "rule_id" parameter from "REPLACE.ME" - And body with value {"cases": [{"condition": null, "name": null, "notifications": [null], "status": "critical"}], "filters": [{"action": "require", "query": null}], "hasExtendedTitle": true, "isEnabled": null, "message": null, "name": null, "options": {"detectionMethod": "threshold", "evaluationWindow": 0, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0}}, "queries": [{"agentRule": {"agentRuleId": "etc_shadow", "expression": null}, "aggregation": "count", "distinctFields": [null], "groupByFields": [null], "metric": null, "name": null, "query": null}], "tags": [null], "version": 1} + And body with value {"cases": [{"condition": null, "name": null, "notifications": [null], "status": "critical"}], "filters": [{"action": "require", "query": null}], "hasExtendedTitle": true, "isEnabled": null, "message": null, "name": null, "options": {"detectionMethod": "threshold", "evaluationWindow": 0, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0}}, "queries": [{"aggregation": "count", "distinctFields": [null], "groupByFields": [null], "metric": null, "name": null, "query": null}], "tags": [null], "version": 1} When the request is sent Then the response status is 404 Not Found @@ -223,6 +223,6 @@ Feature: Security Monitoring Scenario: Update an existing rule returns "OK" response Given new "UpdateSecurityMonitoringRule" request And request contains "rule_id" parameter from "REPLACE.ME" - And body with value {"cases": [{"condition": null, "name": null, "notifications": [null], "status": "critical"}], "filters": [{"action": "require", "query": null}], "hasExtendedTitle": true, "isEnabled": null, "message": null, "name": null, "options": {"detectionMethod": "threshold", "evaluationWindow": 0, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0}}, "queries": [{"agentRule": {"agentRuleId": "etc_shadow", "expression": null}, "aggregation": "count", "distinctFields": [null], "groupByFields": [null], "metric": null, "name": null, "query": null}], "tags": [null], "version": 1} + And body with value {"cases": [{"condition": null, "name": null, "notifications": [null], "status": "critical"}], "filters": [{"action": "require", "query": null}], "hasExtendedTitle": true, "isEnabled": null, "message": null, "name": null, "options": {"detectionMethod": "threshold", "evaluationWindow": 0, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0}}, "queries": [{"aggregation": "count", "distinctFields": [null], "groupByFields": [null], "metric": null, "name": null, "query": null}], "tags": [null], "version": 1} When the request is sent Then the response status is 200 OK