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
162 changes: 154 additions & 8 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18048,7 +18048,8 @@ components:
description: "The value of the set action"
oneOf:
- type: string
- format: int64
- format: int32
maximum: 2147483647
type: integer
- type: boolean
CloudWorkloadSecurityAgentRuleActions:
Expand Down Expand Up @@ -29999,6 +30000,25 @@ components:
data:
$ref: "#/components/schemas/ListDeploymentRuleResponseData"
type: object
DeploymentGatesEvaluationConfiguration:
description: |-
Inline rule definitions for a deployment gate evaluation. When provided, rules are evaluated
directly from this configuration instead of using the preconfigured gate rules.
At least one rule is required.
properties:
dry_run:
description: Gate-level dry run. When enabled, the rules are evaluated normally but the gate always returns `pass`. The real result is visible in the Datadog UI.
example: false
type: boolean
rules:
description: The list of rules to evaluate. At least one rule is required.
items:
$ref: "#/components/schemas/DeploymentGatesEvaluationRule"
minItems: 1
type: array
required:
- rules
type: object
DeploymentGatesEvaluationRequest:
description: Request body for triggering a deployment gate evaluation.
properties:
Expand All @@ -30008,8 +30028,13 @@ components:
- data
type: object
DeploymentGatesEvaluationRequestAttributes:
description: Attributes for a deployment gate evaluation request.
description: |-
Attributes for a deployment gate evaluation request.
When `configuration` is provided, rules are evaluated inline from that configuration.
When omitted, rules are resolved from the preconfigured gate for the given service and environment.
properties:
configuration:
$ref: "#/components/schemas/DeploymentGatesEvaluationConfiguration"
env:
description: The environment of the deployment.
example: "staging"
Expand Down Expand Up @@ -30179,6 +30204,60 @@ components:
type: string
x-enum-varnames:
- DEPLOYMENT_GATES_EVALUATION_RESULT_RESPONSE
DeploymentGatesEvaluationRule:
description: A rule to evaluate as part of a deployment gate evaluation.
discriminator:
mapping:
faulty_deployment_detection: "#/components/schemas/DeploymentGatesFDDRule"
monitor: "#/components/schemas/DeploymentGatesMonitorRule"
propertyName: type
oneOf:
- $ref: "#/components/schemas/DeploymentGatesMonitorRule"
- $ref: "#/components/schemas/DeploymentGatesFDDRule"
DeploymentGatesFDDRule:
description: A faulty deployment detection rule to evaluate as part of a deployment gate evaluation.
properties:
dry_run:
description: Rule-level dry run. When enabled, the rule is evaluated normally but it always returns `pass`. The real result is visible in the Datadog UI.
example: false
type: boolean
name:
description: Human-readable name for this rule.
example: "apm faulty deployment"
type: string
options:
$ref: "#/components/schemas/DeploymentGatesFDDRuleOptions"
type:
$ref: "#/components/schemas/DeploymentGatesFDDRuleType"
required:
- type
- name
type: object
DeploymentGatesFDDRuleOptions:
description: Options for a `faulty_deployment_detection` rule.
properties:
duration:
description: Evaluation window in seconds. Maximum 7200 (2 hours).
example: 900
format: int64
maximum: 7200
type: integer
excluded_resources:
description: APM resource names to exclude from analysis.
example:
- "GET /healthcheck"
items:
type: string
type: array
type: object
DeploymentGatesFDDRuleType:
description: The type identifier for a faulty deployment detection rule.
enum:
- faulty_deployment_detection
example: faulty_deployment_detection
type: string
x-enum-varnames:
- FAULTY_DEPLOYMENT_DETECTION
DeploymentGatesListResponse:
description: Response containing a paginated list of deployment gates.
properties:
Expand Down Expand Up @@ -30213,6 +30292,49 @@ components:
minimum: 1
type: integer
type: object
DeploymentGatesMonitorRule:
description: A monitor rule to evaluate as part of a deployment gate evaluation.
properties:
dry_run:
description: Rule-level dry run. When enabled, the rule is evaluated normally but always returns `pass`. The real result is visible in the Datadog UI.
example: false
type: boolean
name:
description: Human-readable name for this rule.
example: "error rate monitors"
type: string
options:
$ref: "#/components/schemas/DeploymentGatesMonitorRuleOptions"
type:
$ref: "#/components/schemas/DeploymentGatesMonitorRuleType"
required:
- type
- name
type: object
DeploymentGatesMonitorRuleOptions:
description: Options for a `monitor` rule.
properties:
duration:
description: Evaluation window in seconds. Maximum 7200 (2 hours).
example: 300
format: int64
maximum: 7200
type: integer
query:
description: Monitor search query.
example: "service:transaction-backend env:production"
type: string
required:
- query
type: object
DeploymentGatesMonitorRuleType:
description: The type identifier for a monitor rule.
enum:
- monitor
example: monitor
type: string
x-enum-varnames:
- MONITOR
DeploymentGatesRuleResponse:
description: The result of a single rule evaluation.
properties:
Expand Down Expand Up @@ -127285,12 +127407,17 @@ paths:
Triggers an asynchronous deployment gate evaluation for the given service and environment.
Returns an evaluation ID that can be used to poll for the result via the
`GET /api/v2/deployments/gates/evaluation/{id}` endpoint.

When the `configuration` attribute is provided, rules are evaluated inline from that configuration
and no pre-configured gate is required. When `configuration` is omitted, rules are resolved from the
gate pre-configured for the given service and environment through the Datadog UI, API, or Terraform.
operationId: TriggerDeploymentGatesEvaluation
requestBody:
content:
application/json:
examples:
default:
summary: Evaluate a preconfigured gate
value:
data:
attributes:
Expand All @@ -127300,6 +127427,31 @@ paths:
service: transaction-backend
version: v1.2.3
type: deployment_gates_evaluation_request
with-configuration:
summary: Evaluate with inline rule configuration
value:
data:
attributes:
configuration:
dry_run: false
rules:
- dry_run: false
name: error rate monitors
options:
duration: 300
query: "service:transaction-backend env:production"
type: monitor
- dry_run: false
name: apm faulty deployment
options:
duration: 900
excluded_resources:
- "GET /healthcheck"
type: faulty_deployment_detection
env: production
service: transaction-backend
version: 1.2.3
type: deployment_gates_evaluation_request
schema:
$ref: "#/components/schemas/DeploymentGatesEvaluationRequest"
required: true
Expand Down Expand Up @@ -166319,9 +166471,6 @@ paths:
permissions:
- security_monitoring_findings_write
- appsec_vm_write
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
post:
description: >-
Create ServiceNow tickets for security findings.
Expand Down Expand Up @@ -166392,9 +166541,6 @@ paths:
permissions:
- security_monitoring_findings_write
- appsec_vm_write
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/security/sboms:
get:
description: |-
Expand Down
14 changes: 14 additions & 0 deletions examples/v2/deployment-gates/TriggerDeploymentGatesEvaluation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@
body = DatadogAPIClient::V2::DeploymentGatesEvaluationRequest.new({
data: DatadogAPIClient::V2::DeploymentGatesEvaluationRequestData.new({
attributes: DatadogAPIClient::V2::DeploymentGatesEvaluationRequestAttributes.new({
configuration: DatadogAPIClient::V2::DeploymentGatesEvaluationConfiguration.new({
dry_run: false,
rules: [
DatadogAPIClient::V2::DeploymentGatesMonitorRule.new({
dry_run: false,
name: "error rate monitors",
options: DatadogAPIClient::V2::DeploymentGatesMonitorRuleOptions.new({
duration: 300,
query: "service:transaction-backend env:production",
}),
type: DatadogAPIClient::V2::DeploymentGatesMonitorRuleType::MONITOR,
}),
],
}),
env: "staging",
identifier: "pre-deploy",
primary_tag: "region:us-east-1",
Expand Down
3 changes: 0 additions & 3 deletions examples/v2/security-monitoring/AttachServiceNowTicket.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Attach security findings to a ServiceNow ticket returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.attach_service_now_ticket".to_sym] = true
end
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new

body = DatadogAPIClient::V2::AttachServiceNowTicketRequest.new({
Expand Down
3 changes: 0 additions & 3 deletions examples/v2/security-monitoring/CreateServiceNowTickets.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Create ServiceNow tickets for security findings returns "Created" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.create_service_now_tickets".to_sym] = true
end
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new

body = DatadogAPIClient::V2::CreateServiceNowTicketRequestArray.new({
Expand Down
6 changes: 3 additions & 3 deletions features/v2/deployment_gates.feature
Original file line number Diff line number Diff line change
Expand Up @@ -286,23 +286,23 @@ Feature: Deployment Gates
Scenario: Trigger a deployment gate evaluation returns "Accepted" response
Given operation "TriggerDeploymentGatesEvaluation" enabled
And new "TriggerDeploymentGatesEvaluation" request
And body with value {"data": {"attributes": {"env": "staging", "identifier": "pre-deploy", "primary_tag": "region:us-east-1", "service": "transaction-backend", "version": "v1.2.3"}, "type": "deployment_gates_evaluation_request"}}
And body with value {"data": {"attributes": {"configuration": {"dry_run": false, "rules": [{"dry_run": false, "name": "error rate monitors", "options": {"duration": 300, "query": "service:transaction-backend env:production"}, "type": "monitor"}]}, "env": "staging", "identifier": "pre-deploy", "primary_tag": "region:us-east-1", "service": "transaction-backend", "version": "v1.2.3"}, "type": "deployment_gates_evaluation_request"}}
When the request is sent
Then the response status is 202 Accepted

@generated @skip @team:DataDog/ci-app-backend
Scenario: Trigger a deployment gate evaluation returns "Bad request." response
Given operation "TriggerDeploymentGatesEvaluation" enabled
And new "TriggerDeploymentGatesEvaluation" request
And body with value {"data": {"attributes": {"env": "staging", "identifier": "pre-deploy", "primary_tag": "region:us-east-1", "service": "transaction-backend", "version": "v1.2.3"}, "type": "deployment_gates_evaluation_request"}}
And body with value {"data": {"attributes": {"configuration": {"dry_run": false, "rules": [{"dry_run": false, "name": "error rate monitors", "options": {"duration": 300, "query": "service:transaction-backend env:production"}, "type": "monitor"}]}, "env": "staging", "identifier": "pre-deploy", "primary_tag": "region:us-east-1", "service": "transaction-backend", "version": "v1.2.3"}, "type": "deployment_gates_evaluation_request"}}
When the request is sent
Then the response status is 400 Bad request.

@generated @skip @team:DataDog/ci-app-backend
Scenario: Trigger a deployment gate evaluation returns "Deployment gate not found." response
Given operation "TriggerDeploymentGatesEvaluation" enabled
And new "TriggerDeploymentGatesEvaluation" request
And body with value {"data": {"attributes": {"env": "staging", "identifier": "pre-deploy", "primary_tag": "region:us-east-1", "service": "transaction-backend", "version": "v1.2.3"}, "type": "deployment_gates_evaluation_request"}}
And body with value {"data": {"attributes": {"configuration": {"dry_run": false, "rules": [{"dry_run": false, "name": "error rate monitors", "options": {"duration": 300, "query": "service:transaction-backend env:production"}, "type": "monitor"}]}, "env": "staging", "identifier": "pre-deploy", "primary_tag": "region:us-east-1", "service": "transaction-backend", "version": "v1.2.3"}, "type": "deployment_gates_evaluation_request"}}
When the request is sent
Then the response status is 404 Deployment gate not found.

Expand Down
18 changes: 6 additions & 12 deletions features/v2/security_monitoring.feature
Original file line number Diff line number Diff line change
Expand Up @@ -113,24 +113,21 @@ Feature: Security Monitoring

@generated @skip @team:DataDog/k9-investigation
Scenario: Attach security findings to a ServiceNow ticket returns "Bad Request" response
Given operation "AttachServiceNowTicket" enabled
And new "AttachServiceNowTicket" request
Given new "AttachServiceNowTicket" request
And body with value {"data": {"attributes": {"servicenow_ticket_url": "https://example.service-now.com/now/nav/ui/classic/params/target/incident.do?sys_id=abcdef0123456789abcdef0123456789"}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "servicenow_tickets"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/k9-investigation
Scenario: Attach security findings to a ServiceNow ticket returns "Not Found" response
Given operation "AttachServiceNowTicket" enabled
And new "AttachServiceNowTicket" request
Given new "AttachServiceNowTicket" request
And body with value {"data": {"attributes": {"servicenow_ticket_url": "https://example.service-now.com/now/nav/ui/classic/params/target/incident.do?sys_id=abcdef0123456789abcdef0123456789"}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "servicenow_tickets"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/k9-investigation
Scenario: Attach security findings to a ServiceNow ticket returns "OK" response
Given operation "AttachServiceNowTicket" enabled
And new "AttachServiceNowTicket" request
Given new "AttachServiceNowTicket" request
And body with value {"data": {"attributes": {"servicenow_ticket_url": "https://example.service-now.com/now/nav/ui/classic/params/target/incident.do?sys_id=abcdef0123456789abcdef0123456789"}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "servicenow_tickets"}}
When the request is sent
Then the response status is 200 OK
Expand Down Expand Up @@ -532,24 +529,21 @@ Feature: Security Monitoring

@generated @skip @team:DataDog/k9-investigation
Scenario: Create ServiceNow tickets for security findings returns "Bad Request" response
Given operation "CreateServiceNowTickets" enabled
And new "CreateServiceNowTickets" request
Given new "CreateServiceNowTickets" request
And body with value {"data": [{"attributes": {"assignee_id": "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0", "description": "A description of the ServiceNow ticket.", "priority": "NOT_DEFINED", "title": "A title for the ServiceNow ticket."}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "servicenow_tickets"}]}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/k9-investigation
Scenario: Create ServiceNow tickets for security findings returns "Created" response
Given operation "CreateServiceNowTickets" enabled
And new "CreateServiceNowTickets" request
Given new "CreateServiceNowTickets" request
And body with value {"data": [{"attributes": {"assignee_id": "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0", "description": "A description of the ServiceNow ticket.", "priority": "NOT_DEFINED", "title": "A title for the ServiceNow ticket."}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "servicenow_tickets"}]}
When the request is sent
Then the response status is 201 Created

@generated @skip @team:DataDog/k9-investigation
Scenario: Create ServiceNow tickets for security findings returns "Not Found" response
Given operation "CreateServiceNowTickets" enabled
And new "CreateServiceNowTickets" request
Given new "CreateServiceNowTickets" request
And body with value {"data": [{"attributes": {"assignee_id": "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0", "description": "A description of the ServiceNow ticket.", "priority": "NOT_DEFINED", "title": "A title for the ServiceNow ticket."}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "servicenow_tickets"}]}
When the request is sent
Then the response status is 404 Not Found
Expand Down
2 changes: 0 additions & 2 deletions lib/datadog_api_client/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,6 @@ def initialize
"v2.get_aws_cloud_auth_persona_mapping": false,
"v2.list_aws_cloud_auth_persona_mappings": false,
"v2.activate_content_pack": false,
"v2.attach_service_now_ticket": false,
"v2.batch_get_security_monitoring_dataset_dependencies": false,
"v2.bulk_create_sample_log_generation_subscriptions": false,
"v2.bulk_export_security_monitoring_terraform_resources": false,
Expand All @@ -347,7 +346,6 @@ def initialize
"v2.create_sample_log_generation_subscription": false,
"v2.create_security_monitoring_dataset": false,
"v2.create_security_monitoring_integration_config": false,
"v2.create_service_now_tickets": false,
"v2.create_static_analysis_ast": false,
"v2.create_static_analysis_server_analysis": false,
"v2.deactivate_content_pack": false,
Expand Down
Loading
Loading