Skip to content

Public api support for google security operations destination #2484

New issue

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

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

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-07-08 19:08:07.248096",
"spec_repo_commit": "7b042e12"
"regenerated": "2025-07-09 08:34:43.812482",
"spec_repo_commit": "7331abb4"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-07-08 19:08:07.264039",
"spec_repo_commit": "7b042e12"
"regenerated": "2025-07-09 08:34:43.829923",
"spec_repo_commit": "7331abb4"
}
}
}
150 changes: 150 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10668,6 +10668,7 @@ components:
- $ref: '#/components/schemas/CustomDestinationForwardDestinationSplunk'
- $ref: '#/components/schemas/CustomDestinationForwardDestinationElasticsearch'
- $ref: '#/components/schemas/CustomDestinationForwardDestinationMicrosoftSentinel'
- $ref: '#/components/schemas/CustomDestinationForwardDestinationGoogleSecurityOperations'
CustomDestinationForwardDestinationElasticsearch:
description: The Elasticsearch destination.
properties:
Expand Down Expand Up @@ -10725,6 +10726,42 @@ components:
type: string
x-enum-varnames:
- ELASTICSEARCH
CustomDestinationForwardDestinationGoogleSecurityOperations:
description: The Google Security Operations destination.
properties:
auth:
$ref: '#/components/schemas/CustomDestinationGoogleSecurityOperationsDestinationAuth'
customer_id:
description: The customer ID of the Google Security Operations account.
example: 123-456-7890
type: string
namespace:
description: The namespace of the Google Security Operations account.
example: google-security-operations-namespace
type: string
regional_endpoint:
description: The `CustomDestinationForwardDestinationGoogleSecurityOperations`
`regional_endpoint`.
example: https://malachiteingestion-pa.googleapis.com
type: string
type:
$ref: '#/components/schemas/CustomDestinationForwardDestinationGoogleSecurityOperationsType'
required:
- type
- customer_id
- regional_endpoint
- namespace
- auth
type: object
CustomDestinationForwardDestinationGoogleSecurityOperationsType:
default: google_security_operations
description: Type of the Google Security Operations destination.
enum:
- google_security_operations
example: google_security_operations
type: string
x-enum-varnames:
- GOOGLE_SECURITY_OPERATIONS
CustomDestinationForwardDestinationHttp:
description: The HTTP destination.
properties:
Expand Down Expand Up @@ -10826,6 +10863,55 @@ components:
type: string
x-enum-varnames:
- SPLUNK_HEC
CustomDestinationGoogleSecurityOperationsDestinationAuth:
description: Google Security Operations destination authentication.
properties:
client_email:
description: The Google Security Operations client email.
example: [email protected]
type: string
client_id:
description: The Google Security Operations client ID. This field is not
returned by the API.
example: def123456
type: string
writeOnly: true
private_key:
description: The Google Security Operations private key. This field is not
returned by the API.
example: '-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBK...\n-----END
PRIVATE KEY-----\n'
type: string
writeOnly: true
private_key_id:
description: The Google Security Operations private key ID. This field is
not returned by the API.
example: abc12345678
type: string
writeOnly: true
project_id:
description: Google Security Operations project ID.
example: gcp-project
type: string
type:
$ref: '#/components/schemas/CustomDestinationGoogleSecurityOperationsDestinationAuthType'
required:
- type
- project_id
- private_key_id
- client_email
- client_id
- private_key
type: object
CustomDestinationGoogleSecurityOperationsDestinationAuthType:
default: gcp_private_key
description: Type of the Google Security Operations destination authentication.
enum:
- gcp_private_key
example: gcp_private_key
type: string
x-enum-varnames:
- GCP_PRIVATE_KEY
CustomDestinationHttpDestinationAuth:
description: Authentication method of the HTTP requests.
oneOf:
Expand Down Expand Up @@ -10971,6 +11057,7 @@ components:
- $ref: '#/components/schemas/CustomDestinationResponseForwardDestinationSplunk'
- $ref: '#/components/schemas/CustomDestinationResponseForwardDestinationElasticsearch'
- $ref: '#/components/schemas/CustomDestinationResponseForwardDestinationMicrosoftSentinel'
- $ref: '#/components/schemas/CustomDestinationResponseForwardDestinationGoogleSecurityOperations'
CustomDestinationResponseForwardDestinationElasticsearch:
description: The Elasticsearch destination.
properties:
Expand Down Expand Up @@ -11028,6 +11115,42 @@ components:
type: string
x-enum-varnames:
- ELASTICSEARCH
CustomDestinationResponseForwardDestinationGoogleSecurityOperations:
description: The Google Security Operations destination.
properties:
auth:
$ref: '#/components/schemas/CustomDestinationResponseGoogleSecurityOperationsDestinationAuth'
customer_id:
description: The customer ID of the Google Security Operations account.
example: 123-456-7890
type: string
namespace:
description: The namespace of the Google Security Operations account.
example: google-security-operations-namespace
type: string
regional_endpoint:
description: The `CustomDestinationResponseForwardDestinationGoogleSecurityOperations`
`regional_endpoint`.
example: https://malachiteingestion-pa.googleapis.com
type: string
type:
$ref: '#/components/schemas/CustomDestinationResponseForwardDestinationGoogleSecurityOperationsType'
required:
- type
- customer_id
- regional_endpoint
- namespace
- auth
type: object
CustomDestinationResponseForwardDestinationGoogleSecurityOperationsType:
default: google_security_operations
description: Type of the Google Security Operations destination.
enum:
- google_security_operations
example: google_security_operations
type: string
x-enum-varnames:
- GOOGLE_SECURITY_OPERATIONS
CustomDestinationResponseForwardDestinationHttp:
description: The HTTP destination.
properties:
Expand Down Expand Up @@ -11122,6 +11245,33 @@ components:
type: string
x-enum-varnames:
- SPLUNK_HEC
CustomDestinationResponseGoogleSecurityOperationsDestinationAuth:
description: Google Security Operations destination authentication.
properties:
client_email:
description: The Google Security Operations client email.
example: [email protected]
type: string
project_id:
description: Google Security Operations project ID.
example: gcp-project
type: string
type:
$ref: '#/components/schemas/CustomDestinationResponseGoogleSecurityOperationsDestinationAuthType'
required:
- type
- project_id
- client_email
type: object
CustomDestinationResponseGoogleSecurityOperationsDestinationAuthType:
default: gcp_private_key
description: Type of the Google Security Operations destination authentication.
enum:
- gcp_private_key
example: gcp_private_key
type: string
x-enum-varnames:
- GCP_PRIVATE_KEY
CustomDestinationResponseHttpDestinationAuth:
description: Authentication method of the HTTP requests.
oneOf:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"2025-07-09T08:26:14.805Z"
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{
"log": {
"_recordingName": "Logs Custom Destinations/Create a Google Security Operations custom destination returns \"OK\" response",
"creator": {
"comment": "persister:fs",
"name": "Polly.JS",
"version": "6.0.5"
},
"entries": [
{
"_id": "1db6a6ab99d9d8ab9eb0880014ac1ce1",
"_order": 0,
"cache": {},
"request": {
"bodySize": 710,
"cookies": [],
"headers": [
{
"_fromType": "array",
"name": "accept",
"value": "application/json"
},
{
"_fromType": "array",
"name": "content-type",
"value": "application/json"
}
],
"headersSize": 592,
"httpVersion": "HTTP/1.1",
"method": "POST",
"postData": {
"mimeType": "application/json",
"params": [],
"text": "{\"data\":{\"attributes\":{\"enabled\":false,\"forward_tags\":false,\"forward_tags_restriction_list\":[\"datacenter\",\"host\"],\"forward_tags_restriction_list_type\":\"ALLOW_LIST\",\"forwarder_destination\":{\"auth\":{\"client_email\":\"[email protected]\",\"client_id\":\"def123456\",\"private_key\":\"-----BEGIN PRIVATE KEY-----\\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBK...\\n-----END PRIVATE KEY-----\\n\",\"private_key_id\":\"abc12345678\",\"project_id\":\"gcp-project\",\"type\":\"gcp_private_key\"},\"customer_id\":\"123-456-7890\",\"namespace\":\"google-security-operations-namespace\",\"regional_endpoint\":\"https://malachiteingestion-pa.googleapis.com\",\"type\":\"google_security_operations\"},\"name\":\"Nginx logs\",\"query\":\"source:nginx\"},\"type\":\"custom_destination\"}}"
},
"queryString": [],
"url": "https://api.datadoghq.com/api/v2/logs/config/custom-destinations"
},
"response": {
"bodySize": 588,
"content": {
"mimeType": "application/json",
"size": 588,
"text": "{\"data\":{\"id\":\"363586eb-0e4c-45c6-ba95-5afaddead03f\",\"attributes\":{\"name\":\"Nginx logs\",\"query\":\"source:nginx\",\"enabled\":false,\"forwarder_destination\":{\"customer_id\":\"123-456-7890\",\"regional_endpoint\":\"https://malachiteingestion-pa.googleapis.com\",\"namespace\":\"google-security-operations-namespace\",\"auth\":{\"project_id\":\"gcp-project\",\"client_email\":\"[email protected]\",\"type\":\"gcp_private_key\"},\"type\":\"google_security_operations\"},\"forward_tags_restriction_list_type\":\"ALLOW_LIST\",\"forward_tags_restriction_list\":[\"datacenter\",\"host\"],\"forward_tags\":false},\"type\":\"custom_destination\"}}\n"
},
"cookies": [],
"headers": [
{
"name": "content-type",
"value": "application/json"
}
],
"headersSize": 713,
"httpVersion": "HTTP/1.1",
"redirectURL": "",
"status": 200,
"statusText": "OK"
},
"startedDateTime": "2025-07-09T08:26:15.220Z",
"time": 383
},
{
"_id": "b357449565ea2dc8baf41959bbb48471",
"_order": 0,
"cache": {},
"request": {
"bodySize": 0,
"cookies": [],
"headers": [
{
"_fromType": "array",
"name": "accept",
"value": "*/*"
}
],
"headersSize": 565,
"httpVersion": "HTTP/1.1",
"method": "DELETE",
"queryString": [],
"url": "https://api.datadoghq.com/api/v2/logs/config/custom-destinations/363586eb-0e4c-45c6-ba95-5afaddead03f"
},
"response": {
"bodySize": 0,
"content": {
"mimeType": "text/html; charset=utf-8",
"size": 0
},
"cookies": [],
"headers": [
{
"name": "content-type",
"value": "text/html; charset=utf-8"
}
],
"headersSize": 700,
"httpVersion": "HTTP/1.1",
"redirectURL": "",
"status": 204,
"statusText": "No Content"
},
"startedDateTime": "2025-07-09T08:26:15.613Z",
"time": 376
}
],
"pages": [],
"version": "1.2"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* Create a Google Security Operations custom destination returns "OK" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.LogsCustomDestinationsApi(configuration);

const params: v2.LogsCustomDestinationsApiCreateLogsCustomDestinationRequest = {
body: {
data: {
attributes: {
enabled: false,
forwardTags: false,
forwardTagsRestrictionList: ["datacenter", "host"],
forwardTagsRestrictionListType: "ALLOW_LIST",
forwarderDestination: {
type: "google_security_operations",
customerId: "123-456-7890",
regionalEndpoint: "https://malachiteingestion-pa.googleapis.com",
namespace: "google-security-operations-namespace",
auth: {
type: "gcp_private_key",
projectId: "gcp-project",
privateKeyId: "abc12345678",
clientEmail: "[email protected]",
clientId: "def123456",
privateKey:
"-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBK...\n-----END PRIVATE KEY-----\n",
},
},
name: "Nginx logs",
query: "source:nginx",
},
type: "custom_destination",
},
},
};

apiInstance
.createLogsCustomDestination(params)
.then((data: v2.CustomDestinationResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Loading