Skip to content

Add resource evaluation filter endpoints #2214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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-05-06 15:05:57.976406",
"spec_repo_commit": "d0ee626b"
"regenerated": "2025-05-06 16:27:23.193754",
"spec_repo_commit": "9dc9f742"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-05-06 15:05:57.992373",
"spec_repo_commit": "d0ee626b"
"regenerated": "2025-05-06 16:27:23.209287",
"spec_repo_commit": "9dc9f742"
}
}
}
207 changes: 201 additions & 6 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,23 @@ components:
required: true
schema:
type: string
ResourceFilterAccountID:
description: Filter resource filters by cloud provider account ID. This parameter
is only valid when provider is specified.
in: query
name: account_id
required: false
schema:
description: The cloud provider account ID (e.g. AWS account ID, GCP project
ID, Azure subscription ID)
type: string
ResourceFilterProvider:
description: Filter resource filters by cloud provider (e.g. aws, gcp, azure).
in: query
name: cloud_provider
required: false
schema:
$ref: '#/components/schemas/ResourceFilterProviderEnum'
ResourceID:
description: 'Identifier, formatted as `type:id`. Supported types: `connection`,
`dashboard`, `integration-account`, `integration-service`, `integration-webhook`,
Expand Down Expand Up @@ -15419,6 +15436,25 @@ components:
$ref: '#/components/schemas/GetInterfacesData'
type: array
type: object
GetResourceEvaluationFiltersResponse:
description: The definition of `GetResourceEvaluationFiltersResponse` object.
properties:
data:
$ref: '#/components/schemas/GetResourceEvaluationFiltersResponseData'
required:
- data
type: object
GetResourceEvaluationFiltersResponseData:
description: The definition of `GetResourceFilterResponseData` object.
properties:
attributes:
$ref: '#/components/schemas/ResourceFilterAttributes'
id:
description: The `data` `id`.
type: string
type:
$ref: '#/components/schemas/ResourceFilterRequestType'
type: object
GetRuleVersionHistoryData:
description: Data for the rule version history.
properties:
Expand Down Expand Up @@ -29051,6 +29087,57 @@ components:
required:
- data
type: object
ResourceFilterAttributes:
description: Attributes of a resource filter.
properties:
cloud_provider:
additionalProperties:
additionalProperties:
items:
description: Tag filter in format "key:value"
example: environment:production
type: string
type: array
type: object
description: A map of cloud provider names (e.g., "aws", "gcp", "azure")
to a map of account/resource IDs and their associated tag filters.
example:
aws:
'123456789':
- environment:production
- team:devops
azure:
sub-001:
- app:frontend
gcp:
project-abc:
- region:us-central1
type: object
uuid:
description: The UUID of the resource filter.
type: string
required:
- cloud_provider
type: object
ResourceFilterProviderEnum:
description: The name of the cloud provider.
enum:
- aws
- gcp
- azure
type: string
x-enum-varnames:
- AWS
- GCP
- AZURE
ResourceFilterRequestType:
description: Constant string to identify the resource type.
enum:
- csm_resource_filter
example: csm_resource_filter
type: string
x-enum-varnames:
- CSM_RESOURCE_FILTER
ResponseMetaAttributes:
description: Object describing meta attributes of response.
properties:
Expand Down Expand Up @@ -32299,9 +32386,11 @@ components:
example: true
type: boolean
SecurityMonitoringRuleKeepAlive:
description: "Once a signal is generated, the signal will remain \u201Copen\u201D
if a case is matched at least once within\nthis keep alive window. For third
party detection method, this field is not used."
description: 'Once a signal is generated, the signal will remain "open" if a
case is matched at least once within

this keep alive window. For third party detection method, this field is not
used.'
enum:
- 0
- 60
Expand Down Expand Up @@ -32331,9 +32420,10 @@ components:
- TWELVE_HOURS
- ONE_DAY
SecurityMonitoringRuleMaxSignalDuration:
description: "A signal will \u201Cclose\u201D regardless of the query being
matched once the time exceeds the maximum duration.\nThis time is calculated
from the first seen timestamp."
description: 'A signal will "close" regardless of the query being matched once
the time exceeds the maximum duration.

This time is calculated from the first seen timestamp.'
enum:
- 0
- 60
Expand Down Expand Up @@ -38625,6 +38715,44 @@ components:
id:
$ref: '#/components/schemas/ApiID'
type: object
UpdateResourceEvaluationFiltersRequest:
description: Request object to update a resource filter.
properties:
data:
$ref: '#/components/schemas/UpdateResourceEvaluationFiltersRequestData'
required:
- data
type: object
UpdateResourceEvaluationFiltersRequestData:
description: The definition of `UpdateResourceFilterRequestData` object.
properties:
attributes:
$ref: '#/components/schemas/ResourceFilterAttributes'
id:
description: The `UpdateResourceEvaluationFiltersRequestData` `id`.
type: string
type:
$ref: '#/components/schemas/ResourceFilterRequestType'
type: object
UpdateResourceEvaluationFiltersResponse:
description: The definition of `UpdateResourceEvaluationFiltersResponse` object.
properties:
data:
$ref: '#/components/schemas/UpdateResourceEvaluationFiltersResponseData'
required:
- data
type: object
UpdateResourceEvaluationFiltersResponseData:
description: The definition of `UpdateResourceFilterResponseData` object.
properties:
attributes:
$ref: '#/components/schemas/ResourceFilterAttributes'
id:
description: The `data` `id`.
type: string
type:
$ref: '#/components/schemas/ResourceFilterRequestType'
type: object
UpdateRuleRequest:
description: Request to update a scorecard rule.
properties:
Expand Down Expand Up @@ -43559,6 +43687,73 @@ paths:
permissions:
- security_monitoring_rules_read
- security_monitoring_rules_write
/api/v2/cloud_security_management/resource_filters:
get:
description: List resource filters.
operationId: GetResourceEvaluationFilters
parameters:
- $ref: '#/components/parameters/ResourceFilterProvider'
- $ref: '#/components/parameters/ResourceFilterAccountID'
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/GetResourceEvaluationFiltersResponse'
description: OK
'400':
$ref: '#/components/responses/BadRequestResponse'
'403':
$ref: '#/components/responses/NotAuthorizedResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- security_monitoring_filters_read
summary: List resource filters
tags:
- Security Monitoring
x-permission:
operator: OR
permissions:
- security_monitoring_filters_read
put:
description: Update resource filters.
operationId: UpdateResourceEvaluationFilters
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateResourceEvaluationFiltersRequest'
required: true
responses:
'201':
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateResourceEvaluationFiltersResponse'
description: OK
'400':
$ref: '#/components/responses/BadRequestResponse'
'403':
$ref: '#/components/responses/NotAuthorizedResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- security_monitoring_filters_write
summary: Update resource filters
tags:
- Security Monitoring
x-codegen-request-body-name: body
x-permission:
operator: OR
permissions:
- security_monitoring_filters_write
/api/v2/container_images:
get:
description: Get all Container Images for your organization.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"2025-05-06T08:24:43.362Z"
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"log": {
"_recordingName": "Security Monitoring/List resource filters returns \"Bad Request\" response",
"creator": {
"comment": "persister:fs",
"name": "Polly.JS",
"version": "6.0.5"
},
"entries": [
{
"_id": "08839a3d63fc9127123ffc356c178826",
"_order": 0,
"cache": {},
"request": {
"bodySize": 0,
"cookies": [],
"headers": [
{
"_fromType": "array",
"name": "accept",
"value": "application/json"
}
],
"headersSize": 562,
"httpVersion": "HTTP/1.1",
"method": "GET",
"queryString": [
{
"name": "account_id",
"value": "123456789"
}
],
"url": "https://api.datadoghq.com/api/v2/cloud_security_management/resource_filters?account_id=123456789"
},
"response": {
"bodySize": 151,
"content": {
"mimeType": "application/vnd.api+json",
"size": 151,
"text": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"Field 'account_id' is invalid: account_id provided without specifying the cloud provider\"}]}"
},
"cookies": [],
"headers": [
{
"name": "content-type",
"value": "application/vnd.api+json"
}
],
"headersSize": 675,
"httpVersion": "HTTP/1.1",
"redirectURL": "",
"status": 400,
"statusText": "Bad Request"
},
"startedDateTime": "2025-05-06T08:24:43.777Z",
"time": 153
}
],
"pages": [],
"version": "1.2"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"2025-05-06T10:03:18.837Z"
Loading