Skip to content

[security_monitoring] Make Historical Jobs endpoints public #2139

New issue

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

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

Already on GitHub? # 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-04-04 20:19:32.825096",
"spec_repo_commit": "3909ab62"
"regenerated": "2025-04-06 16:06:33.352816",
"spec_repo_commit": "fe3756c4"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-04-04 20:19:32.841813",
"spec_repo_commit": "3909ab62"
"regenerated": "2025-04-06 16:06:33.369022",
"spec_repo_commit": "fe3756c4"
}
}
}
18 changes: 0 additions & 18 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50645,9 +50645,6 @@ paths:
summary: List historical jobs
tags:
- Security Monitoring
x-unstable: '**Note**: This endpoint is in beta and may be subject to changes.

Please check the documentation regularly for updates.'
post:
description: Run a historical job.
operationId: RunHistoricalJob
Expand Down Expand Up @@ -50687,9 +50684,6 @@ paths:
operator: OR
permissions:
- security_monitoring_rules_write
x-unstable: '**Note**: This endpoint is in beta and may be subject to changes.

Please check the documentation regularly for updates.'
/api/v2/siem-historical-detections/jobs/signal_convert:
post:
description: Convert a job result to a signal.
Expand Down Expand Up @@ -50721,9 +50715,6 @@ paths:
operator: OR
permissions:
- security_monitoring_signals_write
x-unstable: '**Note**: This endpoint is in beta and may be subject to changes.

Please check the documentation regularly for updates.'
/api/v2/siem-historical-detections/jobs/{job_id}:
delete:
description: Delete an existing job.
Expand Down Expand Up @@ -50752,9 +50743,6 @@ paths:
summary: Delete an existing job
tags:
- Security Monitoring
x-unstable: '**Note**: This endpoint is in beta and may be subject to changes.

Please check the documentation regularly for updates.'
get:
description: Get a job's details.
operationId: GetHistoricalJob
Expand Down Expand Up @@ -50787,9 +50775,6 @@ paths:
operator: OR
permissions:
- security_monitoring_rules_read
x-unstable: '**Note**: This endpoint is in beta and may be subject to changes.

Please check the documentation regularly for updates.'
/api/v2/siem-historical-detections/jobs/{job_id}/cancel:
patch:
description: Cancel a historical job.
Expand Down Expand Up @@ -50823,9 +50808,6 @@ paths:
operator: OR
permissions:
- security_monitoring_rules_write
x-unstable: '**Note**: This endpoint is in beta and may be subject to changes.

Please check the documentation regularly for updates.'
/api/v2/slo/report:
post:
description: 'Create a job to generate an SLO report. The report job is processed
Expand Down
2 changes: 0 additions & 2 deletions examples/v2/security-monitoring/CancelHistoricalJob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.cancelHistoricalJob"] = true;
configuration.unstableOperations["v2.runHistoricalJob"] = true;
const apiInstance = new v2.SecurityMonitoringApi(configuration);

// there is a valid "historical_job" in the system
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.convertJobResultToSignal"] = true;
const apiInstance = new v2.SecurityMonitoringApi(configuration);

const params: v2.SecurityMonitoringApiConvertJobResultToSignalRequest = {
Expand Down
1 change: 0 additions & 1 deletion examples/v2/security-monitoring/DeleteHistoricalJob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.deleteHistoricalJob"] = true;
const apiInstance = new v2.SecurityMonitoringApi(configuration);

const params: v2.SecurityMonitoringApiDeleteHistoricalJobRequest = {
Expand Down
2 changes: 0 additions & 2 deletions examples/v2/security-monitoring/GetHistoricalJob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.getHistoricalJob"] = true;
configuration.unstableOperations["v2.runHistoricalJob"] = true;
const apiInstance = new v2.SecurityMonitoringApi(configuration);

// there is a valid "historical_job" in the system
Expand Down
2 changes: 0 additions & 2 deletions examples/v2/security-monitoring/ListHistoricalJobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.listHistoricalJobs"] = true;
configuration.unstableOperations["v2.runHistoricalJob"] = true;
const apiInstance = new v2.SecurityMonitoringApi(configuration);

// there is a valid "historical_job" in the system
Expand Down
1 change: 0 additions & 1 deletion examples/v2/security-monitoring/RunHistoricalJob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.runHistoricalJob"] = true;
const apiInstance = new v2.SecurityMonitoringApi(configuration);

const params: v2.SecurityMonitoringApiRunHistoricalJobRequest = {
Expand Down
60 changes: 19 additions & 41 deletions features/v2/security_monitoring.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,28 @@ Feature: Security Monitoring

@team:DataDog/k9-cloud-security-platform
Scenario: Cancel a historical job returns "Bad Request" response
Given operation "CancelHistoricalJob" enabled
And new "CancelHistoricalJob" request
Given new "CancelHistoricalJob" request
And request contains "job_id" parameter with value "inva-lid"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/k9-cloud-security-platform
Scenario: Cancel a historical job returns "Conflict" response
Given operation "CancelHistoricalJob" enabled
And new "CancelHistoricalJob" request
Given new "CancelHistoricalJob" request
And request contains "job_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 409 Conflict

@team:DataDog/k9-cloud-security-platform
Scenario: Cancel a historical job returns "Not Found" response
Given operation "CancelHistoricalJob" enabled
And new "CancelHistoricalJob" request
Given new "CancelHistoricalJob" request
And request contains "job_id" parameter with value "8e2a37fb-b0c8-4761-a7f0-0a8d6a98ba93"
When the request is sent
Then the response status is 404 Not Found

@team:DataDog/k9-cloud-security-platform
Scenario: Cancel a historical job returns "OK" response
Given operation "CancelHistoricalJob" enabled
And operation "RunHistoricalJob" enabled
And new "CancelHistoricalJob" request
Given new "CancelHistoricalJob" request
And there is a valid "historical_job" in the system
And request contains "job_id" parameter from "historical_job.data.id"
When the request is sent
Expand Down Expand Up @@ -93,24 +88,21 @@ Feature: Security Monitoring

@team:DataDog/k9-cloud-security-platform
Scenario: Convert a job result to a signal returns "Bad Request" response
Given operation "ConvertJobResultToSignal" enabled
And new "ConvertJobResultToSignal" request
Given new "ConvertJobResultToSignal" request
And body with value {"data": {"attributes": {"jobResultIds": [""], "notifications": [""], "signalMessage": "A large number of failed login attempts.", "signalSeverity": "critical"}, "type": "historicalDetectionsJobResultSignalConversion"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/k9-cloud-security-platform
Scenario: Convert a job result to a signal returns "Not Found" response
Given operation "ConvertJobResultToSignal" enabled
And new "ConvertJobResultToSignal" request
Given new "ConvertJobResultToSignal" request
And body with value {"data": {"attributes": {"jobResultIds": [""], "notifications": [""], "signalMessage": "A large number of failed login attempts.", "signalSeverity": "critical"}, "type": "historicalDetectionsJobResultSignalConversion"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/k9-cloud-security-platform
Scenario: Convert a job result to a signal returns "OK" response
Given operation "ConvertJobResultToSignal" enabled
And new "ConvertJobResultToSignal" request
Given new "ConvertJobResultToSignal" request
And body with value {"data": {"attributes": {"jobResultIds": [""], "notifications": [""], "signalMessage": "A large number of failed login attempts.", "signalSeverity": "critical"}, "type": "historicalDetectionsJobResultSignalConversion"}}
When the request is sent
Then the response status is 204 OK
Expand Down Expand Up @@ -410,32 +402,28 @@ Feature: Security Monitoring

@team:DataDog/k9-cloud-security-platform
Scenario: Delete an existing job returns "Bad Request" response
Given operation "DeleteHistoricalJob" enabled
And new "DeleteHistoricalJob" request
Given new "DeleteHistoricalJob" request
And request contains "job_id" parameter with value "inva-lid"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/k9-cloud-security-platform
Scenario: Delete an existing job returns "Conflict" response
Given operation "DeleteHistoricalJob" enabled
And new "DeleteHistoricalJob" request
Given new "DeleteHistoricalJob" request
And request contains "job_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 409 Conflict

@team:DataDog/k9-cloud-security-platform
Scenario: Delete an existing job returns "Not Found" response
Given operation "DeleteHistoricalJob" enabled
And new "DeleteHistoricalJob" request
Given new "DeleteHistoricalJob" request
And request contains "job_id" parameter with value "8e2a37fb-b0c8-4761-a7f0-0a8d6a98ba93"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/k9-cloud-security-platform
Scenario: Delete an existing job returns "OK" response
Given operation "DeleteHistoricalJob" enabled
And new "DeleteHistoricalJob" request
Given new "DeleteHistoricalJob" request
And request contains "job_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 204 OK
Expand Down Expand Up @@ -519,25 +507,21 @@ Feature: Security Monitoring

@team:DataDog/k9-cloud-security-platform
Scenario: Get a job's details returns "Bad Request" response
Given operation "GetHistoricalJob" enabled
And new "GetHistoricalJob" request
Given new "GetHistoricalJob" request
And request contains "job_id" parameter with value "inva-lid"
When the request is sent
Then the response status is 400 Bad Request

@team:DataDog/k9-cloud-security-platform
Scenario: Get a job's details returns "Not Found" response
Given operation "GetHistoricalJob" enabled
And new "GetHistoricalJob" request
Given new "GetHistoricalJob" request
And request contains "job_id" parameter with value "8e2a37fb-b0c8-4761-a7f0-0a8d6a98ba93"
When the request is sent
Then the response status is 404 Not Found

@team:DataDog/k9-cloud-security-platform
Scenario: Get a job's details returns "OK" response
Given operation "GetHistoricalJob" enabled
And operation "RunHistoricalJob" enabled
And new "GetHistoricalJob" request
Given new "GetHistoricalJob" request
And there is a valid "historical_job" in the system
And request contains "job_id" parameter from "historical_job.data.id"
When the request is sent
Expand Down Expand Up @@ -801,16 +785,13 @@ Feature: Security Monitoring

@generated @skip @team:DataDog/k9-cloud-security-platform
Scenario: List historical jobs returns "Bad Request" response
Given operation "ListHistoricalJobs" enabled
And new "ListHistoricalJobs" request
Given new "ListHistoricalJobs" request
When the request is sent
Then the response status is 400 Bad Request

@team:DataDog/k9-cloud-security-platform
Scenario: List historical jobs returns "OK" response
Given operation "ListHistoricalJobs" enabled
And operation "RunHistoricalJob" enabled
And new "ListHistoricalJobs" request
Given new "ListHistoricalJobs" request
And there is a valid "historical_job" in the system
And request contains "filter[query]" parameter with value "id:{{historical_job.data.id}}"
When the request is sent
Expand Down Expand Up @@ -1006,24 +987,21 @@ Feature: Security Monitoring

@team:DataDog/k9-cloud-security-platform
Scenario: Run a historical job returns "Bad Request" response
Given operation "RunHistoricalJob" enabled
And new "RunHistoricalJob" request
Given new "RunHistoricalJob" request
And body with value {"data":{"type":"historicalDetectionsJobCreate","attributes":{"jobDefinition":{"type":"log_detection","name":"Excessive number of failed attempts.","queries":[{"query":"source:non_existing_src_weekend","aggregation":"count","groupByFields":[],"distinctFields":[]}],"cases":[{"name":"Condition 1","status":"info","notifications":[],"condition":"a > 1"}],"options":{"keepAlive":3600,"maxSignalDuration":86400,"evaluationWindow":900},"message":"A large number of failed login attempts.","tags":[],"from":1730387522611,"to":1730391122611,"index":"non_existing_index"}}}}
When the request is sent
Then the response status is 400 Bad Request

@team:DataDog/k9-cloud-security-platform
Scenario: Run a historical job returns "Not Found" response
Given operation "RunHistoricalJob" enabled
And new "RunHistoricalJob" request
Given new "RunHistoricalJob" request
And body with value {"data": { "type": "historicalDetectionsJobCreate", "attributes": {"fromRule": {"caseIndex": 0, "from": 1730201035064, "id": "non-existng", "index": "main", "notifications": [], "to": 1730204635115}}}}
When the request is sent
Then the response status is 404 Not Found

@team:DataDog/k9-cloud-security-platform
Scenario: Run a historical job returns "Status created" response
Given operation "RunHistoricalJob" enabled
And new "RunHistoricalJob" request
Given new "RunHistoricalJob" request
And body with value {"data":{"type":"historicalDetectionsJobCreate","attributes":{"jobDefinition":{"type":"log_detection","name":"Excessive number of failed attempts.","queries":[{"query":"source:non_existing_src_weekend","aggregation":"count","groupByFields":[],"distinctFields":[]}],"cases":[{"name":"Condition 1","status":"info","notifications":[],"condition":"a > 1"}],"options":{"keepAlive":3600,"maxSignalDuration":86400,"evaluationWindow":900},"message":"A large number of failed login attempts.","tags":[],"from":1730387522611,"to":1730387532611,"index":"main"}}}}
When the request is sent
Then the response status is 201 Status created
Expand Down
6 changes: 0 additions & 6 deletions packages/datadog-api-client-common/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,19 +264,13 @@ export function createConfiguration(
"v2.updateAWSAccount": false,
"v2.listAWSLogsServices": false,
"v2.getAggregatedConnections": false,
"v2.cancelHistoricalJob": false,
"v2.convertJobResultToSignal": false,
"v2.deleteHistoricalJob": false,
"v2.getFinding": false,
"v2.getHistoricalJob": false,
"v2.getRuleVersionHistory": false,
"v2.getSBOM": false,
"v2.listFindings": false,
"v2.listHistoricalJobs": false,
"v2.listVulnerabilities": false,
"v2.listVulnerableAssets": false,
"v2.muteFindings": false,
"v2.runHistoricalJob": false,
"v2.createScorecardOutcomesBatch": false,
"v2.createScorecardRule": false,
"v2.deleteScorecardRule": false,
Expand Down
Loading
Loading