For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/ko/api/latest/security-monitoring/import-security-vulnerabilities.md. A documentation index is available at /llms.txt.
Language
Datadog site

보안 취약성 가져오기

경고Note: This endpoint is in preview and is subject to change. If you have any feedback, contact Datadog support.
POSThttps://api.datadoghq.com/api/v2/security/vulnerabilitieshttps://api.us3.datadoghq.com/api/v2/security/vulnerabilitieshttps://api.us5.datadoghq.com/api/v2/security/vulnerabilitieshttps://api.datadoghq.eu/api/v2/security/vulnerabilitieshttps://api.ap1.datadoghq.com/api/v2/security/vulnerabilitieshttps://api.ap2.datadoghq.com/api/v2/security/vulnerabilitieshttps://api.uk1.datadoghq.com/api/v2/security/vulnerabilitieshttps://api.ddog-gov.com/api/v2/security/vulnerabilitieshttps://api.us2.ddog-gov.com/api/v2/security/vulnerabilities

개요

CycloneDX 1.5 형식의 외부 스캐너에서 보안 취약성을 가져옵니다.

페이로드는 CycloneDX 1.5 JSON 스키마 및 다음 사항에 대해 유효성이 검사됩니다. 추가 제약 조건:

  • metadata, metadata.component 및 metadata.component.name은 필수 항목입니다.
  • metadata.tools.components에는 name 필드가 있는 요소가 정확히 하나 포함되어야 합니다.
  • components는 비어 있을 수 없습니다. 각 구성 요소에는 bom-ref, type, name 및 version이 필요합니다.
  • type이 library인 경우 purl이 필요하며 유효한 PURL이어야 합니다.
  • type이 operating-system인 경우 name은 지원되는 OS 값 중 하나여야 합니다 alma, alpine, amazon, azurelinux, bottlerocket, cbl-mariner, chainguard, centos, debian, fedora, opensuse, opensuse-leap, opensuse-tumbleweed, oracle, photon, redhat, rocky, slem, sles, ubuntu, wolfi, windows, macos.
  • vulnerabilities는 비어 있을 수 없습니다. 각 취약성에는 id, 정확히 하나의 ratings 항목, 그리고 최소 하나의 affects 항목이 필요합니다.
  • 각 affects[].ref는 components의 bom-ref 값과 일치해야 합니다.

This endpoint requires the security_monitoring_findings_write permission.

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

요청

Body Data (required)

항목
유형
설명
bomFormat [required]
string

취약성 데이터를 포함하는 CycloneDX 1.5 BOM(자재 명세서) 문서입니다.

components [required]
[object]

The list of scanned software components. Cannot be empty.

metadata [required]
object

Metadata about the BOM, including the scanned asset and the scanner tool.

specVersion [required]
string

The CycloneDX specification version. Must be 1.5.

version
int64

The version number of the BOM document.

vulnerabilities [required]
[object]

The list of detected vulnerabilities. Cannot be empty.

응답

Vulnerabilities accepted successfully.

코드 예시

보안 취약성 가져오기
# 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/security/vulnerabilities" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bomFormat": "CycloneDX",
  "components": [
    {
      "bom-ref": "a3390fca-c315-41ae-ae05-af5e7859cdee",
      "name": "lodash",
      "purl": "pkg:npm/lodash@4.17.21",
      "type": "library",
      "version": "4.17.21"
    }
  ],
  "metadata": {
    "component": {
      "name": "i-12345",
      "type": "operating-system"
    },
    "tools": {
      "components": [
        {
          "name": "my-scanner",
          "type": "application"
        }
      ]
    }
  },
  "specVersion": "1.5",
  "version": 1,
  "vulnerabilities": [
    {
      "affects": [
        {
          "ref": "a3390fca-c315-41ae-ae05-af5e7859cdee"
        }
      ],
      "description": "Sample vulnerability detected in the application.",
      "id": "CVE-2021-1234",
      "ratings": [
        {
          "score": 9,
          "severity": "high",
          "vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N"
        }
      ]
    }
  ]
}
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/security/vulnerabilities" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bomFormat": "CycloneDX",
  "components": [
    {
      "bom-ref": "a3390fca-c315-41ae-ae05-af5e7859cdee",
      "name": "lodash",
      "purl": "pkg:npm/lodash@4.17.21",
      "type": "library",
      "version": "4.17.21"
    }
  ],
  "metadata": {
    "component": {
      "name": "i-12345",
      "type": "operating-system"
    },
    "tools": {
      "components": [
        {
          "name": "my-scanner",
          "type": "application"
        }
      ]
    }
  },
  "specVersion": "1.5",
  "version": 1,
  "vulnerabilities": [
    {
      "affects": [
        {
          "ref": "a3390fca-c315-41ae-ae05-af5e7859cdee"
        }
      ],
      "description": "Sample vulnerability detected in the application.",
      "id": "CVE-2021-1234",
      "ratings": [
        {
          "score": 9,
          "severity": "high",
          "vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N"
        }
      ]
    }
  ]
}
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/security/vulnerabilities" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bomFormat": "CycloneDX",
  "components": [
    {
      "bom-ref": "a3390fca-c315-41ae-ae05-af5e7859cdee",
      "name": "lodash",
      "purl": "pkg:npm/lodash@4.17.21",
      "type": "library",
      "version": "4.17.21"
    }
  ],
  "metadata": {
    "component": {
      "name": "i-12345",
      "type": "operating-system"
    },
    "tools": {
      "components": [
        {
          "name": "my-scanner",
          "type": "application"
        }
      ]
    }
  },
  "specVersion": "1.5",
  "version": 1,
  "vulnerabilities": [
    {
      "affects": [
        {
          "ref": "a3390fca-c315-41ae-ae05-af5e7859cdee"
        }
      ],
      "description": "Sample vulnerability detected in the application.",
      "id": "CVE-2021-1234",
      "ratings": [
        {
          "score": 9,
          "severity": "high",
          "vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N"
        }
      ]
    }
  ]
}
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/security/vulnerabilities" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bomFormat": "CycloneDX",
  "components": [
    {
      "bom-ref": "a3390fca-c315-41ae-ae05-af5e7859cdee",
      "name": "lodash",
      "purl": "pkg:npm/lodash@4.17.21",
      "type": "library",
      "version": "4.17.21"
    }
  ],
  "metadata": {
    "component": {
      "name": "i-12345",
      "type": "operating-system"
    },
    "tools": {
      "components": [
        {
          "name": "my-scanner",
          "type": "application"
        }
      ]
    }
  },
  "specVersion": "1.5",
  "version": 1,
  "vulnerabilities": [
    {
      "affects": [
        {
          "ref": "a3390fca-c315-41ae-ae05-af5e7859cdee"
        }
      ],
      "description": "Sample vulnerability detected in the application.",
      "id": "CVE-2021-1234",
      "ratings": [
        {
          "score": 9,
          "severity": "high",
          "vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N"
        }
      ]
    }
  ]
}
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/security/vulnerabilities" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bomFormat": "CycloneDX",
  "components": [
    {
      "bom-ref": "a3390fca-c315-41ae-ae05-af5e7859cdee",
      "name": "lodash",
      "purl": "pkg:npm/lodash@4.17.21",
      "type": "library",
      "version": "4.17.21"
    }
  ],
  "metadata": {
    "component": {
      "name": "i-12345",
      "type": "operating-system"
    },
    "tools": {
      "components": [
        {
          "name": "my-scanner",
          "type": "application"
        }
      ]
    }
  },
  "specVersion": "1.5",
  "version": 1,
  "vulnerabilities": [
    {
      "affects": [
        {
          "ref": "a3390fca-c315-41ae-ae05-af5e7859cdee"
        }
      ],
      "description": "Sample vulnerability detected in the application.",
      "id": "CVE-2021-1234",
      "ratings": [
        {
          "score": 9,
          "severity": "high",
          "vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N"
        }
      ]
    }
  ]
}
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/security/vulnerabilities" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bomFormat": "CycloneDX",
  "components": [
    {
      "bom-ref": "a3390fca-c315-41ae-ae05-af5e7859cdee",
      "name": "lodash",
      "purl": "pkg:npm/lodash@4.17.21",
      "type": "library",
      "version": "4.17.21"
    }
  ],
  "metadata": {
    "component": {
      "name": "i-12345",
      "type": "operating-system"
    },
    "tools": {
      "components": [
        {
          "name": "my-scanner",
          "type": "application"
        }
      ]
    }
  },
  "specVersion": "1.5",
  "version": 1,
  "vulnerabilities": [
    {
      "affects": [
        {
          "ref": "a3390fca-c315-41ae-ae05-af5e7859cdee"
        }
      ],
      "description": "Sample vulnerability detected in the application.",
      "id": "CVE-2021-1234",
      "ratings": [
        {
          "score": 9,
          "severity": "high",
          "vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N"
        }
      ]
    }
  ]
}
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/security/vulnerabilities" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bomFormat": "CycloneDX",
  "components": [
    {
      "bom-ref": "a3390fca-c315-41ae-ae05-af5e7859cdee",
      "name": "lodash",
      "purl": "pkg:npm/lodash@4.17.21",
      "type": "library",
      "version": "4.17.21"
    }
  ],
  "metadata": {
    "component": {
      "name": "i-12345",
      "type": "operating-system"
    },
    "tools": {
      "components": [
        {
          "name": "my-scanner",
          "type": "application"
        }
      ]
    }
  },
  "specVersion": "1.5",
  "version": 1,
  "vulnerabilities": [
    {
      "affects": [
        {
          "ref": "a3390fca-c315-41ae-ae05-af5e7859cdee"
        }
      ],
      "description": "Sample vulnerability detected in the application.",
      "id": "CVE-2021-1234",
      "ratings": [
        {
          "score": 9,
          "severity": "high",
          "vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N"
        }
      ]
    }
  ]
}
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/security/vulnerabilities" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bomFormat": "CycloneDX",
  "components": [
    {
      "bom-ref": "a3390fca-c315-41ae-ae05-af5e7859cdee",
      "name": "lodash",
      "purl": "pkg:npm/lodash@4.17.21",
      "type": "library",
      "version": "4.17.21"
    }
  ],
  "metadata": {
    "component": {
      "name": "i-12345",
      "type": "operating-system"
    },
    "tools": {
      "components": [
        {
          "name": "my-scanner",
          "type": "application"
        }
      ]
    }
  },
  "specVersion": "1.5",
  "version": 1,
  "vulnerabilities": [
    {
      "affects": [
        {
          "ref": "a3390fca-c315-41ae-ae05-af5e7859cdee"
        }
      ],
      "description": "Sample vulnerability detected in the application.",
      "id": "CVE-2021-1234",
      "ratings": [
        {
          "score": 9,
          "severity": "high",
          "vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N"
        }
      ]
    }
  ]
}
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/security/vulnerabilities" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "bomFormat": "CycloneDX",
  "components": [
    {
      "bom-ref": "a3390fca-c315-41ae-ae05-af5e7859cdee",
      "name": "lodash",
      "purl": "pkg:npm/lodash@4.17.21",
      "type": "library",
      "version": "4.17.21"
    }
  ],
  "metadata": {
    "component": {
      "name": "i-12345",
      "type": "operating-system"
    },
    "tools": {
      "components": [
        {
          "name": "my-scanner",
          "type": "application"
        }
      ]
    }
  },
  "specVersion": "1.5",
  "version": 1,
  "vulnerabilities": [
    {
      "affects": [
        {
          "ref": "a3390fca-c315-41ae-ae05-af5e7859cdee"
        }
      ],
      "description": "Sample vulnerability detected in the application.",
      "id": "CVE-2021-1234",
      "ratings": [
        {
          "score": 9,
          "severity": "high",
          "vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N"
        }
      ]
    }
  ]
}
EOF