Skip to content

Commit

Permalink
Improve the spec of Cloud SIEM historical jobs (#2588)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Dec 19, 2024
1 parent eae2a0d commit 183e0dd
Show file tree
Hide file tree
Showing 27 changed files with 813 additions and 120 deletions.
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": "2024-12-18 19:23:44.640997",
"spec_repo_commit": "3f22290a"
"regenerated": "2024-12-19 07:26:23.728211",
"spec_repo_commit": "5dd2cbe4"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-12-18 19:23:44.656520",
"spec_repo_commit": "3f22290a"
"regenerated": "2024-12-19 07:26:23.743147",
"spec_repo_commit": "5dd2cbe4"
}
}
}
99 changes: 76 additions & 23 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12250,6 +12250,65 @@ components:
maximum: 2147483647
type: integer
type: object
HistoricalJobOptions:
description: Job options.
properties:
detectionMethod:
$ref: '#/components/schemas/SecurityMonitoringRuleDetectionMethod'
evaluationWindow:
$ref: '#/components/schemas/SecurityMonitoringRuleEvaluationWindow'
impossibleTravelOptions:
$ref: '#/components/schemas/SecurityMonitoringRuleImpossibleTravelOptions'
keepAlive:
$ref: '#/components/schemas/SecurityMonitoringRuleKeepAlive'
maxSignalDuration:
$ref: '#/components/schemas/SecurityMonitoringRuleMaxSignalDuration'
newValueOptions:
$ref: '#/components/schemas/SecurityMonitoringRuleNewValueOptions'
thirdPartyRuleOptions:
$ref: '#/components/schemas/SecurityMonitoringRuleThirdPartyOptions'
type: object
HistoricalJobQuery:
description: Query for selecting logs analyzed by the historical job.
properties:
aggregation:
$ref: '#/components/schemas/SecurityMonitoringRuleQueryAggregation'
distinctFields:
description: Field for which the cardinality is measured. Sent as an array.
items:
description: Field.
type: string
type: array
groupByFields:
description: Fields to group by.
items:
description: Field.
type: string
type: array
hasOptionalGroupByFields:
description: When false, events without a group-by value are ignored by
the query. When true, events with missing group-by fields are processed
with `N/A`, replacing the missing values.
example: false
readOnly: true
type: boolean
metrics:
description: Group of target fields to aggregate over when using the sum,
max, geo data, or new value aggregations. The sum, max, and geo data aggregations
only accept one value in this list, whereas the new value aggregation
accepts up to five values.
items:
description: Field.
type: string
type: array
name:
description: Name of the query.
type: string
query:
description: Query to run on logs.
example: a > 3
type: string
type: object
HistoricalJobResponse:
description: Historical job response.
properties:
Expand Down Expand Up @@ -14824,13 +14883,6 @@ components:
items:
$ref: '#/components/schemas/SecurityMonitoringRuleCaseCreate'
type: array
filters:
description: Additional queries to filter matched events before they are
processed. This field is deprecated for log detection, signal correlation,
and workload security rules.
items:
$ref: '#/components/schemas/SecurityMonitoringFilter'
type: array
from:
description: Starting time of data analyzed by the job.
example: 1729843470000
Expand All @@ -14849,14 +14901,14 @@ components:
example: Excessive number of failed attempts.
type: string
options:
$ref: '#/components/schemas/SecurityMonitoringRuleOptions'
$ref: '#/components/schemas/HistoricalJobOptions'
queries:
description: Queries for selecting logs analyzed by the job.
items:
$ref: '#/components/schemas/SecurityMonitoringStandardRuleQuery'
$ref: '#/components/schemas/HistoricalJobQuery'
type: array
referenceTables:
description: Reference tables for the rule.
description: Reference tables used in the queries.
items:
$ref: '#/components/schemas/SecurityMonitoringReferenceTable'
type: array
Expand All @@ -14866,8 +14918,8 @@ components:
type: string
type: array
thirdPartyCases:
description: Cases for generating results from third-party rules. Only available
for third-party rules.
description: Cases for generating results from third-party detection method.
Only available for third-party detection method.
example: []
items:
$ref: '#/components/schemas/SecurityMonitoringThirdPartyRuleCaseCreate'
Expand Down Expand Up @@ -22792,7 +22844,7 @@ components:
$ref: '#/components/schemas/ResponseMetaAttributes'
type: object
SecurityMonitoringReferenceTable:
description: Reference table for the rule.
description: Reference tables used in the queries.
properties:
checkPresence:
description: Whether to include or exclude the matched values.
Expand All @@ -22804,7 +22856,7 @@ components:
description: The field in the log to match against the reference table.
type: string
ruleQueryName:
description: The name of the rule query to apply the reference table to.
description: The name of the query to apply the reference table to.
type: string
tableName:
description: The name of the reference table.
Expand Down Expand Up @@ -22835,7 +22887,7 @@ components:
description: Case when signal is generated.
properties:
condition:
description: 'A rule case contains logical operations (`>`,`>=`, `&&`, `||`)
description: 'A case contains logical operations (`>`,`>=`, `&&`, `||`)
to determine if a signal should be generated

based on the event counts in the previously defined queries.'
Expand All @@ -22844,7 +22896,7 @@ components:
description: Name of the case.
type: string
notifications:
description: Notification targets for each rule case.
description: Notification targets.
items:
description: Notification.
type: string
Expand Down Expand Up @@ -22906,7 +22958,8 @@ components:
description: 'A time window is specified to match when at least one of the cases
matches true. This is a sliding window

and evaluates in real time. For third party rules, this field is not used.'
and evaluates in real time. For third party detection method, this field is
not used.'
enum:
- 0
- 60
Expand Down Expand Up @@ -22935,7 +22988,7 @@ components:
x-enum-varnames:
- LOG4SHELL
SecurityMonitoringRuleImpossibleTravelOptions:
description: Options on impossible travel rules.
description: Options on impossible travel detection method.
properties:
baselineUserLocations:
$ref: '#/components/schemas/SecurityMonitoringRuleImpossibleTravelOptionsBaselineUserLocations'
Expand All @@ -22951,7 +23004,7 @@ components:
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 rules, this field is not used."
party detection method, this field is not used."
enum:
- 0
- 60
Expand Down Expand Up @@ -23009,7 +23062,7 @@ components:
- TWELVE_HOURS
- ONE_DAY
SecurityMonitoringRuleNewValueOptions:
description: Options on new value rules.
description: Options on new value detection method.
properties:
forgetAfter:
$ref: '#/components/schemas/SecurityMonitoringRuleNewValueOptionsForgetAfter'
Expand Down Expand Up @@ -23079,7 +23132,7 @@ components:
- ZERO_OCCURRENCES
- ONE_OCCURRENCE
SecurityMonitoringRuleOptions:
description: Options on rules.
description: Options.
properties:
complianceRuleOptions:
$ref: '#/components/schemas/CloudConfigurationComplianceRuleOptions'
Expand Down Expand Up @@ -23221,7 +23274,7 @@ components:
type: array
type: object
SecurityMonitoringRuleThirdPartyOptions:
description: Options on third party rules.
description: Options on third party detection method.
properties:
defaultNotifications:
description: Notification targets for the logs that do not correspond to
Expand Down Expand Up @@ -24621,7 +24674,7 @@ components:
description: Name of the case.
type: string
notifications:
description: Notification targets for each rule case.
description: Notification targets for each case.
items:
description: Notification.
type: string
Expand Down
8 changes: 4 additions & 4 deletions examples/v2/security-monitoring/RunHistoricalJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.SecurityMonitoringApi;
import com.datadog.api.client.v2.model.HistoricalJobOptions;
import com.datadog.api.client.v2.model.HistoricalJobQuery;
import com.datadog.api.client.v2.model.JobCreateResponse;
import com.datadog.api.client.v2.model.JobDefinition;
import com.datadog.api.client.v2.model.RunHistoricalJobRequest;
Expand All @@ -13,10 +15,8 @@
import com.datadog.api.client.v2.model.SecurityMonitoringRuleEvaluationWindow;
import com.datadog.api.client.v2.model.SecurityMonitoringRuleKeepAlive;
import com.datadog.api.client.v2.model.SecurityMonitoringRuleMaxSignalDuration;
import com.datadog.api.client.v2.model.SecurityMonitoringRuleOptions;
import com.datadog.api.client.v2.model.SecurityMonitoringRuleQueryAggregation;
import com.datadog.api.client.v2.model.SecurityMonitoringRuleSeverity;
import com.datadog.api.client.v2.model.SecurityMonitoringStandardRuleQuery;
import java.util.Collections;

public class Example {
Expand All @@ -38,7 +38,7 @@ public static void main(String[] args) {
.name("Excessive number of failed attempts.")
.queries(
Collections.singletonList(
new SecurityMonitoringStandardRuleQuery()
new HistoricalJobQuery()
.query("source:non_existing_src_weekend")
.aggregation(
SecurityMonitoringRuleQueryAggregation.COUNT)))
Expand All @@ -49,7 +49,7 @@ public static void main(String[] args) {
.status(SecurityMonitoringRuleSeverity.INFO)
.condition("a > 1")))
.options(
new SecurityMonitoringRuleOptions()
new HistoricalJobOptions()
.keepAlive(SecurityMonitoringRuleKeepAlive.ONE_HOUR)
.maxSignalDuration(
SecurityMonitoringRuleMaxSignalDuration.ONE_DAY)
Expand Down
Loading

0 comments on commit 183e0dd

Please sign in to comment.