Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,058 changes: 1,058 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions examples/v2/csm-ownership/CreateOwnershipFeedback.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Submit feedback on an ownership inference returns "Created" response

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

body = DatadogAPIClient::V2::OwnershipFeedbackRequest.new({
data: DatadogAPIClient::V2::OwnershipFeedbackRequestData.new({
attributes: DatadogAPIClient::V2::OwnershipFeedbackRequestAttributes.new({
action: DatadogAPIClient::V2::OwnershipFeedbackAction::CONFIRM,
actor_handle: "user@example.com",
actor_type: "user",
corrected_owner_handle: "team-b",
corrected_owner_type: "team",
inference_checksum: "abc123",
reason: "Confirmed by team lead.",
}),
type: DatadogAPIClient::V2::OwnershipFeedbackType::OWNERSHIP_FEEDBACK,
}),
})
p api_instance.create_ownership_feedback("res-1", OwnershipOwnerType::TEAM, body)
8 changes: 8 additions & 0 deletions examples/v2/csm-ownership/GetOwnershipEvidence.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Get the evidence for an ownership inference returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.get_ownership_evidence".to_sym] = true
end
api_instance = DatadogAPIClient::V2::CSMOwnershipAPI.new
p api_instance.get_ownership_evidence("test-resource", OwnershipOwnerType::TEAM)
8 changes: 8 additions & 0 deletions examples/v2/csm-ownership/GetOwnershipInference.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Get an ownership inference by owner type returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.get_ownership_inference".to_sym] = true
end
api_instance = DatadogAPIClient::V2::CSMOwnershipAPI.new
p api_instance.get_ownership_inference("test-resource", OwnershipOwnerType::TEAM)
8 changes: 8 additions & 0 deletions examples/v2/csm-ownership/ListOwnershipHistory.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# List ownership inference history for a resource returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.list_ownership_history".to_sym] = true
end
api_instance = DatadogAPIClient::V2::CSMOwnershipAPI.new
p api_instance.list_ownership_history("res-1")
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# List ownership history by owner type returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.list_ownership_history_by_owner_type".to_sym] = true
end
api_instance = DatadogAPIClient::V2::CSMOwnershipAPI.new
p api_instance.list_ownership_history_by_owner_type("res-1", OwnershipOwnerType::TEAM)
8 changes: 8 additions & 0 deletions examples/v2/csm-ownership/ListOwnershipInferences.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# List ownership inferences for a resource returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.list_ownership_inferences".to_sym] = true
end
api_instance = DatadogAPIClient::V2::CSMOwnershipAPI.new
p api_instance.list_ownership_inferences("test-resource")
29 changes: 29 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2855,6 +2855,35 @@
"query" => "String",
"order_direction" => "OrderDirection",
},
"v2.ListOwnershipInferences" => {
"resource_id" => "String",
},
"v2.ListOwnershipHistory" => {
"resource_id" => "String",
"cursor" => "String",
"limit" => "Integer",
},
"v2.GetOwnershipInference" => {
"resource_id" => "String",
"owner_type" => "OwnershipOwnerType",
"if_none_match" => "String",
},
"v2.GetOwnershipEvidence" => {
"resource_id" => "String",
"owner_type" => "OwnershipOwnerType",
"if_none_match" => "String",
},
"v2.CreateOwnershipFeedback" => {
"resource_id" => "String",
"owner_type" => "OwnershipOwnerType",
"body" => "OwnershipFeedbackRequest",
},
"v2.ListOwnershipHistoryByOwnerType" => {
"resource_id" => "String",
"owner_type" => "OwnershipOwnerType",
"cursor" => "String",
"limit" => "Integer",
},
"v2.ListCSMAgentlessHosts" => {
"page" => "Integer",
"size" => "Integer",
Expand Down
165 changes: 165 additions & 0 deletions features/v2/csm_ownership.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
@endpoint(csm-ownership) @endpoint(csm-ownership-v2)
Feature: CSM Ownership
Datadog Cloud Security Management (CSM) Ownership infers the most likely
owner for a cloud resource by combining ownership signals from across the
platform, and lets you review the inference, inspect its evidence, and
submit feedback to persist, override, or correct the inferred owner. For
more information, see [Cloud Security Management](https://docs.datadoghq.c
om/security/cloud_security_management).

Background:
Given a valid "apiKeyAuth" key in the system
And a valid "appKeyAuth" key in the system
And an instance of "CSMOwnership" API

@generated @skip @team:DataDog/k9-misconfigs
Scenario: Get an ownership inference by owner type returns "Bad Request" response
Given operation "GetOwnershipInference" enabled
And new "GetOwnershipInference" request
And request contains "resource_id" parameter from "REPLACE.ME"
And request contains "owner_type" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/k9-misconfigs
Scenario: Get an ownership inference by owner type returns "Not Found" response
Given operation "GetOwnershipInference" enabled
And new "GetOwnershipInference" request
And request contains "resource_id" parameter from "REPLACE.ME"
And request contains "owner_type" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/k9-misconfigs
Scenario: Get an ownership inference by owner type returns "OK" response
Given operation "GetOwnershipInference" enabled
And new "GetOwnershipInference" request
And request contains "resource_id" parameter from "REPLACE.ME"
And request contains "owner_type" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/k9-misconfigs
Scenario: Get the evidence for an ownership inference returns "Bad Request" response
Given operation "GetOwnershipEvidence" enabled
And new "GetOwnershipEvidence" request
And request contains "resource_id" parameter from "REPLACE.ME"
And request contains "owner_type" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/k9-misconfigs
Scenario: Get the evidence for an ownership inference returns "Not Found" response
Given operation "GetOwnershipEvidence" enabled
And new "GetOwnershipEvidence" request
And request contains "resource_id" parameter from "REPLACE.ME"
And request contains "owner_type" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/k9-misconfigs
Scenario: Get the evidence for an ownership inference returns "OK" response
Given operation "GetOwnershipEvidence" enabled
And new "GetOwnershipEvidence" request
And request contains "resource_id" parameter from "REPLACE.ME"
And request contains "owner_type" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/k9-misconfigs
Scenario: List ownership history by owner type returns "Bad Request" response
Given operation "ListOwnershipHistoryByOwnerType" enabled
And new "ListOwnershipHistoryByOwnerType" request
And request contains "resource_id" parameter from "REPLACE.ME"
And request contains "owner_type" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/k9-misconfigs
Scenario: List ownership history by owner type returns "OK" response
Given operation "ListOwnershipHistoryByOwnerType" enabled
And new "ListOwnershipHistoryByOwnerType" request
And request contains "resource_id" parameter from "REPLACE.ME"
And request contains "owner_type" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/k9-misconfigs
Scenario: List ownership inference history for a resource returns "Bad Request" response
Given operation "ListOwnershipHistory" enabled
And new "ListOwnershipHistory" request
And request contains "resource_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/k9-misconfigs
Scenario: List ownership inference history for a resource returns "OK" response
Given operation "ListOwnershipHistory" enabled
And new "ListOwnershipHistory" request
And request contains "resource_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/k9-misconfigs
Scenario: List ownership inferences for a resource returns "Bad Request" response
Given operation "ListOwnershipInferences" enabled
And new "ListOwnershipInferences" request
And request contains "resource_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/k9-misconfigs
Scenario: List ownership inferences for a resource returns "Not Found" response
Given operation "ListOwnershipInferences" enabled
And new "ListOwnershipInferences" request
And request contains "resource_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/k9-misconfigs
Scenario: List ownership inferences for a resource returns "OK" response
Given operation "ListOwnershipInferences" enabled
And new "ListOwnershipInferences" request
And request contains "resource_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/k9-misconfigs
Scenario: Submit feedback on an ownership inference returns "Bad Request" response
Given operation "CreateOwnershipFeedback" enabled
And new "CreateOwnershipFeedback" request
And request contains "resource_id" parameter from "REPLACE.ME"
And request contains "owner_type" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"action": "confirm", "actor_handle": "user@example.com", "actor_type": "user", "corrected_owner_handle": "team-b", "corrected_owner_type": "team", "inference_checksum": "abc123", "reason": "Confirmed by team lead."}, "type": "ownership_feedback"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/k9-misconfigs
Scenario: Submit feedback on an ownership inference returns "Conflict" response
Given operation "CreateOwnershipFeedback" enabled
And new "CreateOwnershipFeedback" request
And request contains "resource_id" parameter from "REPLACE.ME"
And request contains "owner_type" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"action": "confirm", "actor_handle": "user@example.com", "actor_type": "user", "corrected_owner_handle": "team-b", "corrected_owner_type": "team", "inference_checksum": "abc123", "reason": "Confirmed by team lead."}, "type": "ownership_feedback"}}
When the request is sent
Then the response status is 409 Conflict

@generated @skip @team:DataDog/k9-misconfigs
Scenario: Submit feedback on an ownership inference returns "Created" response
Given operation "CreateOwnershipFeedback" enabled
And new "CreateOwnershipFeedback" request
And request contains "resource_id" parameter from "REPLACE.ME"
And request contains "owner_type" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"action": "confirm", "actor_handle": "user@example.com", "actor_type": "user", "corrected_owner_handle": "team-b", "corrected_owner_type": "team", "inference_checksum": "abc123", "reason": "Confirmed by team lead."}, "type": "ownership_feedback"}}
When the request is sent
Then the response status is 201 Created

@generated @skip @team:DataDog/k9-misconfigs
Scenario: Submit feedback on an ownership inference returns "Not Found" response
Given operation "CreateOwnershipFeedback" enabled
And new "CreateOwnershipFeedback" request
And request contains "resource_id" parameter from "REPLACE.ME"
And request contains "owner_type" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"action": "confirm", "actor_handle": "user@example.com", "actor_type": "user", "corrected_owner_handle": "team-b", "corrected_owner_type": "team", "inference_checksum": "abc123", "reason": "Confirmed by team lead."}, "type": "ownership_feedback"}}
When the request is sent
Then the response status is 404 Not Found
36 changes: 36 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -2031,6 +2031,42 @@
"type": "safe"
}
},
"ListOwnershipInferences": {
"tag": "CSM Ownership",
"undo": {
"type": "safe"
}
},
"ListOwnershipHistory": {
"tag": "CSM Ownership",
"undo": {
"type": "safe"
}
},
"GetOwnershipInference": {
"tag": "CSM Ownership",
"undo": {
"type": "safe"
}
},
"GetOwnershipEvidence": {
"tag": "CSM Ownership",
"undo": {
"type": "safe"
}
},
"CreateOwnershipFeedback": {
"tag": "CSM Ownership",
"undo": {
"type": "idempotent"
}
},
"ListOwnershipHistoryByOwnerType": {
"tag": "CSM Ownership",
"undo": {
"type": "safe"
}
},
"ListCSMAgentlessHosts": {
"tag": "CSM Settings",
"undo": {
Expand Down
6 changes: 6 additions & 0 deletions lib/datadog_api_client/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,12 @@ def initialize
"v2.list_cost_tag_metadata_months": false,
"v2.list_cost_tag_metadata_orchestrators": false,
"v2.search_cost_recommendations": false,
"v2.create_ownership_feedback": false,
"v2.get_ownership_evidence": false,
"v2.get_ownership_inference": false,
"v2.list_ownership_history": false,
"v2.list_ownership_history_by_owner_type": false,
"v2.list_ownership_inferences": false,
"v2.get_csm_agentless_host_facet_info": false,
"v2.get_csm_unified_host_facet_info": false,
"v2.list_csm_agentless_host_facets": false,
Expand Down
31 changes: 31 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5198,6 +5198,36 @@ def overrides
"v2.output_schema_parameters" => "OutputSchemaParameters",
"v2.output_schema_parameters_type" => "OutputSchemaParametersType",
"v2.overwrite_allocations_request" => "OverwriteAllocationsRequest",
"v2.ownership_evidence_attributes" => "OwnershipEvidenceAttributes",
"v2.ownership_evidence_data" => "OwnershipEvidenceData",
"v2.ownership_evidence_response" => "OwnershipEvidenceResponse",
"v2.ownership_evidence_type" => "OwnershipEvidenceType",
"v2.ownership_feedback_action" => "OwnershipFeedbackAction",
"v2.ownership_feedback_request" => "OwnershipFeedbackRequest",
"v2.ownership_feedback_request_attributes" => "OwnershipFeedbackRequestAttributes",
"v2.ownership_feedback_request_data" => "OwnershipFeedbackRequestData",
"v2.ownership_feedback_response" => "OwnershipFeedbackResponse",
"v2.ownership_feedback_result_attributes" => "OwnershipFeedbackResultAttributes",
"v2.ownership_feedback_result_data" => "OwnershipFeedbackResultData",
"v2.ownership_feedback_result_type" => "OwnershipFeedbackResultType",
"v2.ownership_feedback_type" => "OwnershipFeedbackType",
"v2.ownership_history_attributes" => "OwnershipHistoryAttributes",
"v2.ownership_history_data" => "OwnershipHistoryData",
"v2.ownership_history_item" => "OwnershipHistoryItem",
"v2.ownership_history_pagination" => "OwnershipHistoryPagination",
"v2.ownership_history_response" => "OwnershipHistoryResponse",
"v2.ownership_history_type" => "OwnershipHistoryType",
"v2.ownership_inference_attributes" => "OwnershipInferenceAttributes",
"v2.ownership_inference_data" => "OwnershipInferenceData",
"v2.ownership_inference_item" => "OwnershipInferenceItem",
"v2.ownership_inference_list_attributes" => "OwnershipInferenceListAttributes",
"v2.ownership_inference_list_data" => "OwnershipInferenceListData",
"v2.ownership_inference_list_response" => "OwnershipInferenceListResponse",
"v2.ownership_inference_response" => "OwnershipInferenceResponse",
"v2.ownership_inference_status" => "OwnershipInferenceStatus",
"v2.ownership_inferences_type" => "OwnershipInferencesType",
"v2.ownership_inference_type" => "OwnershipInferenceType",
"v2.ownership_owner_type" => "OwnershipOwnerType",
"v2.page_annotations_attributes" => "PageAnnotationsAttributes",
"v2.page_annotations_data" => "PageAnnotationsData",
"v2.page_annotations_response" => "PageAnnotationsResponse",
Expand Down Expand Up @@ -7511,6 +7541,7 @@ def overrides
"v2.containers_api" => "ContainersAPI",
"v2.csm_agents_api" => "CSMAgentsAPI",
"v2.csm_coverage_analysis_api" => "CSMCoverageAnalysisAPI",
"v2.csm_ownership_api" => "CSMOwnershipAPI",
"v2.csm_settings_api" => "CSMSettingsAPI",
"v2.csm_threats_api" => "CSMThreatsAPI",
"v2.customer_org_api" => "CustomerOrgAPI",
Expand Down
Loading
Loading