For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/api/latest/agentless-scanning/create-gcp-scan-options.md. A documentation index is available at /llms.txt.
Language
Datadog site
CAUTIONThis product is not supported for your selected Datadog site. (US1-FED).
CAUTIONThis product is not supported for your selected Datadog site. (US2-FED).

Create GCP scan options

POSThttps://api.datadoghq.com/api/v2/agentless_scanning/accounts/gcphttps://api.us3.datadoghq.com/api/v2/agentless_scanning/accounts/gcphttps://api.us5.datadoghq.com/api/v2/agentless_scanning/accounts/gcphttps://api.datadoghq.eu/api/v2/agentless_scanning/accounts/gcphttps://api.ap1.datadoghq.com/api/v2/agentless_scanning/accounts/gcphttps://api.ap2.datadoghq.com/api/v2/agentless_scanning/accounts/gcphttps://api.uk1.datadoghq.com/api/v2/agentless_scanning/accounts/gcphttps://api.ddog-gov.com/api/v2/agentless_scanning/accounts/gcphttps://api.us2.ddog-gov.com/api/v2/agentless_scanning/accounts/gcp

Overview

Activate Agentless scan options for a GCP project.

OAuth apps require the org_management authorization scope to access this endpoint.

Request

Body Data (required)

The definition of the new scan options.

Field
Type
Description
data
object

Single GCP scan options entry.

Response

Agentless scan options enabled successfully.

Response object containing GCP scan options for a single project.

Field
Type
Description
data
object

Single GCP scan options entry.

Code Example

Create GCP scan options returns "Agentless scan options enabled successfully." response
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/agentless_scanning/accounts/gcp" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "id": "new-project",
    "type": "gcp_scan_options",
    "attributes": {
      "cloud_function": true,
      "vuln_host_os": true,
      "vuln_containers_os": true
    }
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/agentless_scanning/accounts/gcp" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "id": "new-project",
    "type": "gcp_scan_options",
    "attributes": {
      "cloud_function": true,
      "vuln_host_os": true,
      "vuln_containers_os": true
    }
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/agentless_scanning/accounts/gcp" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "id": "new-project",
    "type": "gcp_scan_options",
    "attributes": {
      "cloud_function": true,
      "vuln_host_os": true,
      "vuln_containers_os": true
    }
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/agentless_scanning/accounts/gcp" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "id": "new-project",
    "type": "gcp_scan_options",
    "attributes": {
      "cloud_function": true,
      "vuln_host_os": true,
      "vuln_containers_os": true
    }
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/agentless_scanning/accounts/gcp" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "id": "new-project",
    "type": "gcp_scan_options",
    "attributes": {
      "cloud_function": true,
      "vuln_host_os": true,
      "vuln_containers_os": true
    }
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/agentless_scanning/accounts/gcp" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "id": "new-project",
    "type": "gcp_scan_options",
    "attributes": {
      "cloud_function": true,
      "vuln_host_os": true,
      "vuln_containers_os": true
    }
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/agentless_scanning/accounts/gcp" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "id": "new-project",
    "type": "gcp_scan_options",
    "attributes": {
      "cloud_function": true,
      "vuln_host_os": true,
      "vuln_containers_os": true
    }
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/agentless_scanning/accounts/gcp" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "id": "new-project",
    "type": "gcp_scan_options",
    "attributes": {
      "cloud_function": true,
      "vuln_host_os": true,
      "vuln_containers_os": true
    }
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/agentless_scanning/accounts/gcp" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "id": "new-project",
    "type": "gcp_scan_options",
    "attributes": {
      "cloud_function": true,
      "vuln_host_os": true,
      "vuln_containers_os": true
    }
  }
}
EOF