diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index d57aebc821ad..a8908359f488 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -52613,6 +52613,153 @@ components: x-enum-varnames: - DONE - TIMEOUT + SecurityMonitoringContentPackActivation: + description: The activation status of a content pack + enum: + - never_activated + - activated + - deactivated + example: activated + type: string + x-enum-varnames: + - NEVER_ACTIVATED + - ACTIVATED + - DEACTIVATED + SecurityMonitoringContentPackIntegrationStatus: + description: The installation status of the related integration + enum: + - installed + - available + - partially_installed + - detected + - error + example: installed + type: string + x-enum-varnames: + - INSTALLED + - AVAILABLE + - PARTIALLY_INSTALLED + - DETECTED + - ERROR + SecurityMonitoringContentPackStateAttributes: + description: Attributes of a content pack state + properties: + cloud_siem_index_incorrect: + description: Whether the cloud SIEM index configuration is incorrect (only + applies to certain pricing models) + example: false + type: boolean + cp_activation: + $ref: '#/components/schemas/SecurityMonitoringContentPackActivation' + filters_configured_for_logs: + description: Whether filters (Security Filters or Index Query depending + on the pricing model) are configured for logs + example: true + type: boolean + integration_installed_status: + $ref: '#/components/schemas/SecurityMonitoringContentPackIntegrationStatus' + logs_last_collected: + $ref: '#/components/schemas/SecurityMonitoringContentPackTimestampBucket' + logs_seen_from_any_index: + description: Whether logs have been seen from any index + example: true + type: boolean + state: + $ref: '#/components/schemas/SecurityMonitoringContentPackStatus' + required: + - state + - cp_activation + - logs_seen_from_any_index + - logs_last_collected + - cloud_siem_index_incorrect + - filters_configured_for_logs + type: object + SecurityMonitoringContentPackStateData: + description: Content pack state data. + properties: + attributes: + $ref: '#/components/schemas/SecurityMonitoringContentPackStateAttributes' + id: + description: The content pack identifier. + example: aws-cloudtrail + type: string + type: + $ref: '#/components/schemas/SecurityMonitoringContentPackStateType' + required: + - id + - type + - attributes + type: object + SecurityMonitoringContentPackStateMeta: + description: Metadata for content pack states + properties: + cloud_siem_index_incorrect: + description: Whether the cloud SIEM index configuration is incorrect at + the organization level + example: false + type: boolean + sku: + $ref: '#/components/schemas/SecurityMonitoringSKU' + required: + - cloud_siem_index_incorrect + - sku + type: object + SecurityMonitoringContentPackStateType: + description: Type for content pack state object + enum: + - content_pack_state + example: content_pack_state + type: string + x-enum-varnames: + - CONTENT_PACK_STATE + SecurityMonitoringContentPackStatesResponse: + description: Response containing content pack states. + properties: + data: + description: Array of content pack states. + items: + $ref: '#/components/schemas/SecurityMonitoringContentPackStateData' + type: array + meta: + $ref: '#/components/schemas/SecurityMonitoringContentPackStateMeta' + required: + - data + - meta + type: object + SecurityMonitoringContentPackStatus: + description: The current status of a content pack + enum: + - install + - activate + - initializing + - active + - warning + - broken + example: active + type: string + x-enum-varnames: + - INSTALL + - ACTIVATE + - INITIALIZING + - ACTIVE + - WARNING + - BROKEN + SecurityMonitoringContentPackTimestampBucket: + description: Timestamp bucket indicating when logs were last collected + enum: + - not_seen + - within_24_hours + - within_24_to_72_hours + - over_72h_to_30d + - over_30d + example: within_24_hours + type: string + x-enum-varnames: + - NOT_SEEN + - WITHIN_24_HOURS + - WITHIN_24_TO_72_HOURS + - OVER_72H_TO_30D + - OVER_30D SecurityMonitoringCriticalAsset: description: The critical asset's properties. properties: @@ -53740,6 +53887,18 @@ components: - $ref: '#/components/schemas/SecurityMonitoringStandardRulePayload' - $ref: '#/components/schemas/SecurityMonitoringSignalRulePayload' - $ref: '#/components/schemas/CloudConfigurationRulePayload' + SecurityMonitoringSKU: + description: The SIEM pricing model (SKU) for the organization + enum: + - per_gb_analyzed + - per_event_in_siem_index_2023 + - add_on_2024 + example: add_on_2024 + type: string + x-enum-varnames: + - PER_GB_ANALYZED + - PER_EVENT_IN_SIEM_INDEX_2023 + - ADD_ON_2024 SecurityMonitoringSchedulingOptions: description: Options for scheduled rules. When this field is present, the rule runs based on the schedule. When absent, it runs real-time on ingested logs. @@ -94103,6 +94262,123 @@ paths: summary: Get a suppression's version history tags: - Security Monitoring + /api/v2/security_monitoring/content_packs/states: + get: + description: 'Get the activation and configuration states for all security monitoring + content packs. + + This endpoint returns status information about each content pack including + activation state, + + integration status, and log collection status.' + operationId: GetContentPacksStates + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SecurityMonitoringContentPackStatesResponse' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get content pack states + tags: + - Security Monitoring + 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_monitoring/content_packs/{content_pack_id}/activate: + put: + description: 'Activate a security monitoring content pack. This operation configures + the necessary + + log filters or security filters depending on the pricing model and updates + the content + + pack activation state.' + operationId: ActivateContentPack + parameters: + - description: The ID of the content pack to activate. + in: path + name: content_pack_id + required: true + schema: + example: aws-cloudtrail + type: string + responses: + '202': + description: Accepted + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Activate content pack + tags: + - Security Monitoring + 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_monitoring/content_packs/{content_pack_id}/deactivate: + put: + description: 'Deactivate a security monitoring content pack. This operation + removes the content pack''s + + configuration from log filters or security filters and updates the content + pack activation state.' + operationId: DeactivateContentPack + parameters: + - description: The ID of the content pack to deactivate. + in: path + name: content_pack_id + required: true + schema: + example: aws-cloudtrail + type: string + responses: + '202': + description: Accepted + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Deactivate content pack + tags: + - Security Monitoring + 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_monitoring/rules: get: description: List rules. diff --git a/examples/v2/security-monitoring/ActivateContentPack.rb b/examples/v2/security-monitoring/ActivateContentPack.rb new file mode 100644 index 000000000000..8196884e4df7 --- /dev/null +++ b/examples/v2/security-monitoring/ActivateContentPack.rb @@ -0,0 +1,8 @@ +# Activate content pack returns "Accepted" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.activate_content_pack".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +p api_instance.activate_content_pack("aws-cloudtrail") diff --git a/examples/v2/security-monitoring/DeactivateContentPack.rb b/examples/v2/security-monitoring/DeactivateContentPack.rb new file mode 100644 index 000000000000..e8d9dd953100 --- /dev/null +++ b/examples/v2/security-monitoring/DeactivateContentPack.rb @@ -0,0 +1,8 @@ +# Deactivate content pack returns "Accepted" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.deactivate_content_pack".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +p api_instance.deactivate_content_pack("aws-cloudtrail") diff --git a/examples/v2/security-monitoring/GetContentPacksStates.rb b/examples/v2/security-monitoring/GetContentPacksStates.rb new file mode 100644 index 000000000000..d1c78d12fc58 --- /dev/null +++ b/examples/v2/security-monitoring/GetContentPacksStates.rb @@ -0,0 +1,8 @@ +# Get content pack states returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_content_packs_states".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +p api_instance.get_content_packs_states() diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 2d6914508631..f9f955f31923 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1610,6 +1610,12 @@ "page_size" => "Integer", "page_number" => "Integer", }, + "v2.ActivateContentPack" => { + "content_pack_id" => "String", + }, + "v2.DeactivateContentPack" => { + "content_pack_id" => "String", + }, "v2.ListSecurityMonitoringRules" => { "page_size" => "Integer", "page_number" => "Integer", diff --git a/features/v2/security_monitoring.feature b/features/v2/security_monitoring.feature index ccc027734e22..df5e32bcc4d3 100644 --- a/features/v2/security_monitoring.feature +++ b/features/v2/security_monitoring.feature @@ -9,6 +9,22 @@ Feature: Security Monitoring And a valid "appKeyAuth" key in the system And an instance of "SecurityMonitoring" API + @generated @skip @team:DataDog/k9-cloud-security-platform + Scenario: Activate content pack returns "Accepted" response + Given operation "ActivateContentPack" enabled + And new "ActivateContentPack" request + And request contains "content_pack_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 202 Accepted + + @generated @skip @team:DataDog/k9-cloud-security-platform + Scenario: Activate content pack returns "Not Found" response + Given operation "ActivateContentPack" enabled + And new "ActivateContentPack" request + And request contains "content_pack_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @team:DataDog/k9-investigation Scenario: Attach security finding to a Jira issue returns "OK" response Given new "AttachJiraIssue" request @@ -681,6 +697,22 @@ Feature: Security Monitoring When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/k9-cloud-security-platform + Scenario: Deactivate content pack returns "Accepted" response + Given operation "DeactivateContentPack" enabled + And new "DeactivateContentPack" request + And request contains "content_pack_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 202 Accepted + + @generated @skip @team:DataDog/k9-cloud-security-platform + Scenario: Deactivate content pack returns "Not Found" response + Given operation "DeactivateContentPack" enabled + And new "DeactivateContentPack" request + And request contains "content_pack_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @team:DataDog/k9-cloud-security-platform Scenario: Delete a critical asset returns "Not Found" response Given new "DeleteSecurityMonitoringCriticalAsset" request @@ -1225,6 +1257,20 @@ Feature: Security Monitoring Then the response status is 200 OK And the response "data[0].attributes.name" is equal to "suppression2 {{ unique_hash }}" + @generated @skip @team:DataDog/k9-cloud-security-platform + Scenario: Get content pack states returns "Not Found" response + Given operation "GetContentPacksStates" enabled + And new "GetContentPacksStates" request + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/k9-cloud-security-platform + Scenario: Get content pack states returns "OK" response + Given operation "GetContentPacksStates" enabled + And new "GetContentPacksStates" request + When the request is sent + Then the response status is 200 OK + @skip @team:DataDog/k9-cloud-security-platform Scenario: Get critical assets affecting a specific rule returns "Not Found" response Given new "GetCriticalAssetsAffectingRule" request diff --git a/features/v2/undo.json b/features/v2/undo.json index 030260c0f8c2..7e549784ee62 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -4537,6 +4537,24 @@ "type": "safe" } }, + "GetContentPacksStates": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "ActivateContentPack": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "DeactivateContentPack": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, "ListSecurityMonitoringRules": { "tag": "Security Monitoring", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 2e1fec19648e..1c3d360ecc93 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -208,9 +208,12 @@ def initialize "v2.get_open_api": false, "v2.list_apis": false, "v2.update_open_api": false, + "v2.activate_content_pack": false, "v2.cancel_threat_hunting_job": false, "v2.convert_job_result_to_signal": false, + "v2.deactivate_content_pack": false, "v2.delete_threat_hunting_job": false, + "v2.get_content_packs_states": false, "v2.get_finding": false, "v2.get_rule_version_history": false, "v2.get_secrets_rules": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 85b2e31fc288..8bcf2052b621 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -4274,6 +4274,15 @@ def overrides "v2.security_findings_search_request_page" => "SecurityFindingsSearchRequestPage", "v2.security_findings_sort" => "SecurityFindingsSort", "v2.security_findings_status" => "SecurityFindingsStatus", + "v2.security_monitoring_content_pack_activation" => "SecurityMonitoringContentPackActivation", + "v2.security_monitoring_content_pack_integration_status" => "SecurityMonitoringContentPackIntegrationStatus", + "v2.security_monitoring_content_pack_state_attributes" => "SecurityMonitoringContentPackStateAttributes", + "v2.security_monitoring_content_pack_state_data" => "SecurityMonitoringContentPackStateData", + "v2.security_monitoring_content_pack_state_meta" => "SecurityMonitoringContentPackStateMeta", + "v2.security_monitoring_content_pack_states_response" => "SecurityMonitoringContentPackStatesResponse", + "v2.security_monitoring_content_pack_state_type" => "SecurityMonitoringContentPackStateType", + "v2.security_monitoring_content_pack_status" => "SecurityMonitoringContentPackStatus", + "v2.security_monitoring_content_pack_timestamp_bucket" => "SecurityMonitoringContentPackTimestampBucket", "v2.security_monitoring_critical_asset" => "SecurityMonitoringCriticalAsset", "v2.security_monitoring_critical_asset_attributes" => "SecurityMonitoringCriticalAssetAttributes", "v2.security_monitoring_critical_asset_create_attributes" => "SecurityMonitoringCriticalAssetCreateAttributes", @@ -4372,6 +4381,7 @@ def overrides "v2.security_monitoring_signal_triage_update_data" => "SecurityMonitoringSignalTriageUpdateData", "v2.security_monitoring_signal_triage_update_response" => "SecurityMonitoringSignalTriageUpdateResponse", "v2.security_monitoring_signal_type" => "SecurityMonitoringSignalType", + "v2.security_monitoring_sku" => "SecurityMonitoringSKU", "v2.security_monitoring_standard_data_source" => "SecurityMonitoringStandardDataSource", "v2.security_monitoring_standard_rule_create_payload" => "SecurityMonitoringStandardRuleCreatePayload", "v2.security_monitoring_standard_rule_payload" => "SecurityMonitoringStandardRulePayload", diff --git a/lib/datadog_api_client/v2/api/security_monitoring_api.rb b/lib/datadog_api_client/v2/api/security_monitoring_api.rb index 442daffdb1e5..1b324c3877a8 100644 --- a/lib/datadog_api_client/v2/api/security_monitoring_api.rb +++ b/lib/datadog_api_client/v2/api/security_monitoring_api.rb @@ -23,6 +23,79 @@ def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end + # Activate content pack. + # + # @see #activate_content_pack_with_http_info + def activate_content_pack(content_pack_id, opts = {}) + activate_content_pack_with_http_info(content_pack_id, opts) + nil + end + + # Activate content pack. + # + # Activate a security monitoring content pack. This operation configures the necessary + # log filters or security filters depending on the pricing model and updates the content + # pack activation state. + # + # @param content_pack_id [String] The ID of the content pack to activate. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def activate_content_pack_with_http_info(content_pack_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.activate_content_pack".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.activate_content_pack") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.activate_content_pack")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.activate_content_pack ...' + end + # verify the required parameter 'content_pack_id' is set + if @api_client.config.client_side_validation && content_pack_id.nil? + fail ArgumentError, "Missing the required parameter 'content_pack_id' when calling SecurityMonitoringAPI.activate_content_pack" + end + # resource path + local_var_path = '/api/v2/security_monitoring/content_packs/{content_pack_id}/activate'.sub('{content_pack_id}', CGI.escape(content_pack_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :activate_content_pack, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#activate_content_pack\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Attach security findings to a case. # # @see #attach_case_with_http_info @@ -1129,6 +1202,78 @@ def create_vulnerability_notification_rule_with_http_info(body, opts = {}) return data, status_code, headers end + # Deactivate content pack. + # + # @see #deactivate_content_pack_with_http_info + def deactivate_content_pack(content_pack_id, opts = {}) + deactivate_content_pack_with_http_info(content_pack_id, opts) + nil + end + + # Deactivate content pack. + # + # Deactivate a security monitoring content pack. This operation removes the content pack's + # configuration from log filters or security filters and updates the content pack activation state. + # + # @param content_pack_id [String] The ID of the content pack to deactivate. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def deactivate_content_pack_with_http_info(content_pack_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.deactivate_content_pack".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.deactivate_content_pack") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.deactivate_content_pack")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.deactivate_content_pack ...' + end + # verify the required parameter 'content_pack_id' is set + if @api_client.config.client_side_validation && content_pack_id.nil? + fail ArgumentError, "Missing the required parameter 'content_pack_id' when calling SecurityMonitoringAPI.deactivate_content_pack" + end + # resource path + local_var_path = '/api/v2/security_monitoring/content_packs/{content_pack_id}/deactivate'.sub('{content_pack_id}', CGI.escape(content_pack_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :deactivate_content_pack, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#deactivate_content_pack\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete a custom framework. # # @see #delete_custom_framework_with_http_info @@ -1944,6 +2089,74 @@ def edit_security_monitoring_signal_state_with_http_info(signal_id, body, opts = return data, status_code, headers end + # Get content pack states. + # + # @see #get_content_packs_states_with_http_info + def get_content_packs_states(opts = {}) + data, _status_code, _headers = get_content_packs_states_with_http_info(opts) + data + end + + # Get content pack states. + # + # Get the activation and configuration states for all security monitoring content packs. + # This endpoint returns status information about each content pack including activation state, + # integration status, and log collection status. + # + # @param opts [Hash] the optional parameters + # @return [Array<(SecurityMonitoringContentPackStatesResponse, Integer, Hash)>] SecurityMonitoringContentPackStatesResponse data, response status code and response headers + def get_content_packs_states_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_content_packs_states".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_content_packs_states") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_content_packs_states")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_content_packs_states ...' + end + # resource path + local_var_path = '/api/v2/security_monitoring/content_packs/states' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'SecurityMonitoringContentPackStatesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_content_packs_states, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#get_content_packs_states\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get critical assets affecting a specific rule. # # @see #get_critical_assets_affecting_rule_with_http_info diff --git a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_activation.rb b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_activation.rb new file mode 100644 index 000000000000..af1ae6d474af --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_activation.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The activation status of a content pack + class SecurityMonitoringContentPackActivation + include BaseEnumModel + + NEVER_ACTIVATED = "never_activated".freeze + ACTIVATED = "activated".freeze + DEACTIVATED = "deactivated".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_integration_status.rb b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_integration_status.rb new file mode 100644 index 000000000000..0cfeb6e313f1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_integration_status.rb @@ -0,0 +1,30 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The installation status of the related integration + class SecurityMonitoringContentPackIntegrationStatus + include BaseEnumModel + + INSTALLED = "installed".freeze + AVAILABLE = "available".freeze + PARTIALLY_INSTALLED = "partially_installed".freeze + DETECTED = "detected".freeze + ERROR = "error".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_state_attributes.rb b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_state_attributes.rb new file mode 100644 index 000000000000..1afdc306fee2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_state_attributes.rb @@ -0,0 +1,238 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a content pack state + class SecurityMonitoringContentPackStateAttributes + include BaseGenericModel + + # Whether the cloud SIEM index configuration is incorrect (only applies to certain pricing models) + attr_reader :cloud_siem_index_incorrect + + # The activation status of a content pack + attr_reader :cp_activation + + # Whether filters (Security Filters or Index Query depending on the pricing model) are configured for logs + attr_reader :filters_configured_for_logs + + # The installation status of the related integration + attr_accessor :integration_installed_status + + # Timestamp bucket indicating when logs were last collected + attr_reader :logs_last_collected + + # Whether logs have been seen from any index + attr_reader :logs_seen_from_any_index + + # The current status of a content pack + attr_reader :state + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'cloud_siem_index_incorrect' => :'cloud_siem_index_incorrect', + :'cp_activation' => :'cp_activation', + :'filters_configured_for_logs' => :'filters_configured_for_logs', + :'integration_installed_status' => :'integration_installed_status', + :'logs_last_collected' => :'logs_last_collected', + :'logs_seen_from_any_index' => :'logs_seen_from_any_index', + :'state' => :'state' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'cloud_siem_index_incorrect' => :'Boolean', + :'cp_activation' => :'SecurityMonitoringContentPackActivation', + :'filters_configured_for_logs' => :'Boolean', + :'integration_installed_status' => :'SecurityMonitoringContentPackIntegrationStatus', + :'logs_last_collected' => :'SecurityMonitoringContentPackTimestampBucket', + :'logs_seen_from_any_index' => :'Boolean', + :'state' => :'SecurityMonitoringContentPackStatus' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringContentPackStateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'cloud_siem_index_incorrect') + self.cloud_siem_index_incorrect = attributes[:'cloud_siem_index_incorrect'] + end + + if attributes.key?(:'cp_activation') + self.cp_activation = attributes[:'cp_activation'] + end + + if attributes.key?(:'filters_configured_for_logs') + self.filters_configured_for_logs = attributes[:'filters_configured_for_logs'] + end + + if attributes.key?(:'integration_installed_status') + self.integration_installed_status = attributes[:'integration_installed_status'] + end + + if attributes.key?(:'logs_last_collected') + self.logs_last_collected = attributes[:'logs_last_collected'] + end + + if attributes.key?(:'logs_seen_from_any_index') + self.logs_seen_from_any_index = attributes[:'logs_seen_from_any_index'] + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @cloud_siem_index_incorrect.nil? + return false if @cp_activation.nil? + return false if @filters_configured_for_logs.nil? + return false if @logs_last_collected.nil? + return false if @logs_seen_from_any_index.nil? + return false if @state.nil? + true + end + + # Custom attribute writer method with validation + # @param cloud_siem_index_incorrect [Object] Object to be assigned + # @!visibility private + def cloud_siem_index_incorrect=(cloud_siem_index_incorrect) + if cloud_siem_index_incorrect.nil? + fail ArgumentError, 'invalid value for "cloud_siem_index_incorrect", cloud_siem_index_incorrect cannot be nil.' + end + @cloud_siem_index_incorrect = cloud_siem_index_incorrect + end + + # Custom attribute writer method with validation + # @param cp_activation [Object] Object to be assigned + # @!visibility private + def cp_activation=(cp_activation) + if cp_activation.nil? + fail ArgumentError, 'invalid value for "cp_activation", cp_activation cannot be nil.' + end + @cp_activation = cp_activation + end + + # Custom attribute writer method with validation + # @param filters_configured_for_logs [Object] Object to be assigned + # @!visibility private + def filters_configured_for_logs=(filters_configured_for_logs) + if filters_configured_for_logs.nil? + fail ArgumentError, 'invalid value for "filters_configured_for_logs", filters_configured_for_logs cannot be nil.' + end + @filters_configured_for_logs = filters_configured_for_logs + end + + # Custom attribute writer method with validation + # @param logs_last_collected [Object] Object to be assigned + # @!visibility private + def logs_last_collected=(logs_last_collected) + if logs_last_collected.nil? + fail ArgumentError, 'invalid value for "logs_last_collected", logs_last_collected cannot be nil.' + end + @logs_last_collected = logs_last_collected + end + + # Custom attribute writer method with validation + # @param logs_seen_from_any_index [Object] Object to be assigned + # @!visibility private + def logs_seen_from_any_index=(logs_seen_from_any_index) + if logs_seen_from_any_index.nil? + fail ArgumentError, 'invalid value for "logs_seen_from_any_index", logs_seen_from_any_index cannot be nil.' + end + @logs_seen_from_any_index = logs_seen_from_any_index + end + + # Custom attribute writer method with validation + # @param state [Object] Object to be assigned + # @!visibility private + def state=(state) + if state.nil? + fail ArgumentError, 'invalid value for "state", state cannot be nil.' + end + @state = state + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + cloud_siem_index_incorrect == o.cloud_siem_index_incorrect && + cp_activation == o.cp_activation && + filters_configured_for_logs == o.filters_configured_for_logs && + integration_installed_status == o.integration_installed_status && + logs_last_collected == o.logs_last_collected && + logs_seen_from_any_index == o.logs_seen_from_any_index && + state == o.state && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [cloud_siem_index_incorrect, cp_activation, filters_configured_for_logs, integration_installed_status, logs_last_collected, logs_seen_from_any_index, state, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_state_data.rb b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_state_data.rb new file mode 100644 index 000000000000..36bb41a9dae6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_state_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Content pack state data. + class SecurityMonitoringContentPackStateData + include BaseGenericModel + + # Attributes of a content pack state + attr_reader :attributes + + # The content pack identifier. + attr_reader :id + + # Type for content pack state object + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SecurityMonitoringContentPackStateAttributes', + :'id' => :'String', + :'type' => :'SecurityMonitoringContentPackStateType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringContentPackStateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_state_meta.rb b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_state_meta.rb new file mode 100644 index 000000000000..700063bd5600 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_state_meta.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Metadata for content pack states + class SecurityMonitoringContentPackStateMeta + include BaseGenericModel + + # Whether the cloud SIEM index configuration is incorrect at the organization level + attr_reader :cloud_siem_index_incorrect + + # The SIEM pricing model (SKU) for the organization + attr_reader :sku + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'cloud_siem_index_incorrect' => :'cloud_siem_index_incorrect', + :'sku' => :'sku' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'cloud_siem_index_incorrect' => :'Boolean', + :'sku' => :'SecurityMonitoringSKU' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringContentPackStateMeta` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'cloud_siem_index_incorrect') + self.cloud_siem_index_incorrect = attributes[:'cloud_siem_index_incorrect'] + end + + if attributes.key?(:'sku') + self.sku = attributes[:'sku'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @cloud_siem_index_incorrect.nil? + return false if @sku.nil? + true + end + + # Custom attribute writer method with validation + # @param cloud_siem_index_incorrect [Object] Object to be assigned + # @!visibility private + def cloud_siem_index_incorrect=(cloud_siem_index_incorrect) + if cloud_siem_index_incorrect.nil? + fail ArgumentError, 'invalid value for "cloud_siem_index_incorrect", cloud_siem_index_incorrect cannot be nil.' + end + @cloud_siem_index_incorrect = cloud_siem_index_incorrect + end + + # Custom attribute writer method with validation + # @param sku [Object] Object to be assigned + # @!visibility private + def sku=(sku) + if sku.nil? + fail ArgumentError, 'invalid value for "sku", sku cannot be nil.' + end + @sku = sku + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + cloud_siem_index_incorrect == o.cloud_siem_index_incorrect && + sku == o.sku && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [cloud_siem_index_incorrect, sku, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_state_type.rb b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_state_type.rb new file mode 100644 index 000000000000..533fd92317ef --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_state_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type for content pack state object + class SecurityMonitoringContentPackStateType + include BaseEnumModel + + CONTENT_PACK_STATE = "content_pack_state".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_states_response.rb b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_states_response.rb new file mode 100644 index 000000000000..574b50fb77eb --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_states_response.rb @@ -0,0 +1,146 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing content pack states. + class SecurityMonitoringContentPackStatesResponse + include BaseGenericModel + + # Array of content pack states. + attr_reader :data + + # Metadata for content pack states + attr_reader :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'meta' => :'SecurityMonitoringContentPackStateMeta' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringContentPackStatesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + return false if @meta.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Custom attribute writer method with validation + # @param meta [Object] Object to be assigned + # @!visibility private + def meta=(meta) + if meta.nil? + fail ArgumentError, 'invalid value for "meta", meta cannot be nil.' + end + @meta = meta + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_status.rb b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_status.rb new file mode 100644 index 000000000000..1d66651f962c --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_status.rb @@ -0,0 +1,31 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The current status of a content pack + class SecurityMonitoringContentPackStatus + include BaseEnumModel + + INSTALL = "install".freeze + ACTIVATE = "activate".freeze + INITIALIZING = "initializing".freeze + ACTIVE = "active".freeze + WARNING = "warning".freeze + BROKEN = "broken".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_timestamp_bucket.rb b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_timestamp_bucket.rb new file mode 100644 index 000000000000..5244a149875e --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_timestamp_bucket.rb @@ -0,0 +1,30 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Timestamp bucket indicating when logs were last collected + class SecurityMonitoringContentPackTimestampBucket + include BaseEnumModel + + NOT_SEEN = "not_seen".freeze + WITHIN_24_HOURS = "within_24_hours".freeze + WITHIN_24_TO_72_HOURS = "within_24_to_72_hours".freeze + OVER_72H_TO_30D = "over_72h_to_30d".freeze + OVER_30D = "over_30d".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_sku.rb b/lib/datadog_api_client/v2/models/security_monitoring_sku.rb new file mode 100644 index 000000000000..ba428dcd9b66 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_sku.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The SIEM pricing model (SKU) for the organization + class SecurityMonitoringSKU + include BaseEnumModel + + PER_GB_ANALYZED = "per_gb_analyzed".freeze + PER_EVENT_IN_SIEM_INDEX_2023 = "per_event_in_siem_index_2023".freeze + ADD_ON_2024 = "add_on_2024".freeze + end +end