Skip to main content
이제 REST API의 버전이 지정되었습니다. 자세한 내용은 "API 버전 관리 정보"를 참조하세요.

아티팩트 메타데이터에 대한 REST API 엔드포인트

이러한 엔드포인트를 사용하여 조직의 아티팩트에 대한 메타데이터를 검색하고 관리합니다. 아티팩트 메타데이터는 빌드 아티팩트, 해당 출처 및 관련 세부 정보에 대한 정보를 제공합니다.

조직에 대한 Dependabot 또는 code scanning 경고를 볼 때 아티팩트 메타데이터를 사용하여 경고를 필터링하고 우선 순위를 지정할 수 있습니다. 프로덕션 컨텍스트를 사용하여 Dependabot 및 코드 검사 경고 우선 순위 지정을 참조하세요.

Create an artifact deployment record

Create or update deployment records for an artifact associated with an organization. This endpoint allows you to record information about a specific artifact, such as its name, digest, environments, cluster, and deployment.

"Create an artifact deployment record"에 대한 세분화된 액세스 토큰

이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:

세분화된 토큰에는 다음 권한 집합 중 하나 이상이 있어야 합니다.:

  • "Contents" repository permissions (write)
  • "Artifact metadata" repository permissions (write)

"Create an artifact deployment record"에 대한 매개 변수

머리글
속성, 형식, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
속성, 형식, 설명
org string Required

The organization name. The name is not case sensitive.

본문 매개 변수
속성, 형식, 설명
name string Required

The name of the artifact.

digest string Required

The hex encoded digest of the artifact.

version string

The artifact version.

status string Required

The status of the artifact. Can be either deployed or decommissioned.

다음 중 하나일 수 있습니다.: deployed, decommissioned

logical_environment string Required

The stage of the deployment.

physical_environment string

The physical region of the deployment.

cluster string

The deployment cluster.

deployment_name string Required

The name of the deployment.

tags object

The tags associated with the deployment.

runtime_risks array of strings

A list of runtime risks associated with the deployment. Supported values are: critical-resource, internet-exposed, lateral-movement, sensitive-data

github_repository string

The name of the GitHub repository associated with the artifact. This should be used when there are no provenance attestations available for the artifact. The repository must belong to the organization specified in the path parameter.

If a provenance attestation is available for the artifact, the API will use the repository information from the attestation instead of this parameter.

"Create an artifact deployment record"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

Artifact deployment record stored successfully.

"Create an artifact deployment record"에 대한 코드 샘플

요청 예제

post/orgs/{org}/artifacts/metadata/deployment-record
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/artifacts/metadata/deployment-record \ -d '{"name":"awesome-image","digest":"sha256:1bb1e949e55dcefc6353e7b36c8897d2a107d8e8dca49d4e3c0ea8493fc0bc72","status":"deployed","logical_environment":"prod","physical_environment":"pacific-east","cluster":"moda-1","deployment_name":"deployment-pod","tags":{"data-access":"sensitive"}}'

Artifact deployment record stored successfully.

Status: 200
{ "total_count": 1, "deployment_records": [ { "id": 123, "digest": "sha256:1bb1e949e55dcefc6353e7b36c8897d2a107d8e8dca49d4e3c0ea8493fc0bc72", "logical_environment": "prod", "physical_environment": "pacific-east", "cluster": "moda-1", "deployment_name": "prod-deployment", "tags": { "data": "sensitive" }, "created": "2011-01-26T19:14:43Z", "updated_at": "2011-01-26T19:14:43Z", "attestation_id": 456 } ] }

Set cluster deployment records

Set deployment records for a given cluster.

"Set cluster deployment records"에 대한 세분화된 액세스 토큰

이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:

세분화된 토큰에는 다음 권한 집합 중 하나 이상이 있어야 합니다.:

  • "Contents" repository permissions (write)
  • "Artifact metadata" repository permissions (write)

"Set cluster deployment records"에 대한 매개 변수

머리글
속성, 형식, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
속성, 형식, 설명
org string Required

The organization name. The name is not case sensitive.

cluster string Required

The cluster name.

본문 매개 변수
속성, 형식, 설명
logical_environment string Required

The stage of the deployment.

physical_environment string

The physical region of the deployment.

deployments array of objects Required

The list of deployments to record.

속성, 형식, 설명
name string Required

The name of the artifact. Note that if multiple deployments have identical 'digest' parameter values, the name parameter must also be identical across all entries.

digest string Required

The hex encoded digest of the artifact. Note that if multiple deployments have identical 'digest' parameter values, the name and version parameters must also be identical across all entries.

version string

The artifact version. Note that if multiple deployments have identical 'digest' parameter values, the version parameter must also be identical across all entries.

status string

The deployment status of the artifact.

다음 중 하나일 수 있습니다.: deployed, decommissioned

deployment_name string Required

The unique identifier for the deployment represented by the new record. To accommodate differing containers and namespaces within a record set, the following format is recommended: {namespaceName}-{deploymentName}-{containerName}

github_repository string

The name of the GitHub repository associated with the artifact. This should be used when there are no provenance attestations available for the artifact. The repository must belong to the organization specified in the path parameter.

If a provenance attestation is available for the artifact, the API will use the repository information from the attestation instead of this parameter.

tags object

Key-value pairs to tag the deployment record.

runtime_risks array of strings

A list of runtime risks associated with the deployment. Supported values are: critical-resource, internet-exposed, lateral-movement, sensitive-data

"Set cluster deployment records"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

Artifact deployment record stored successfully.

"Set cluster deployment records"에 대한 코드 샘플

요청 예제

post/orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/artifacts/metadata/deployment-record/cluster/CLUSTER \ -d '{"logical_environment":"prod","physical_environment":"pacific-east","deployments":[{"name":"awesome-image","digest":"sha256:1bb1e949e55dcefc6353e7b36c8897d2a107d8e8dca49d4e3c0ea8493fc0bc72","version":"2.1.0","status":"deployed","deployment_name":"deployment-pod","tags":{"runtime-risk":"sensitive-data"}}]}'

Artifact deployment record stored successfully.

Status: 200
{ "total_count": 1, "deployment_records": [ { "id": 123, "digest": "sha256:1bb1e949e55dcefc6353e7b36c8897d2a107d8e8dca49d4e3c0ea8493fc0bc72", "logical_environment": "prod", "physical_environment": "pacific-east", "cluster": "moda-1", "deployment_name": "prod-deployment", "tags": { "data": "sensitive" }, "created": "2011-01-26T19:14:43Z", "updated_at": "2011-01-26T19:14:43Z", "attestation_id": 456 } ] }

Create artifact metadata storage record

Create metadata storage records for artifacts associated with an organization. This endpoint will create a new artifact storage record on behalf of any artifact matching the provided digest and associated with a repository owned by the organization.

"Create artifact metadata storage record"에 대한 세분화된 액세스 토큰

이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:

세분화된 토큰에는 다음 권한 집합 중 하나 이상이 있어야 합니다.:

  • "Contents" repository permissions (write)
  • "Artifact metadata" repository permissions (write)

"Create artifact metadata storage record"에 대한 매개 변수

머리글
속성, 형식, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
속성, 형식, 설명
org string Required

The organization name. The name is not case sensitive.

본문 매개 변수
속성, 형식, 설명
name string Required

The name of the artifact.

digest string Required

The digest of the artifact (algorithm:hex-encoded-digest).

version string

The artifact version.

artifact_url string

The URL where the artifact is stored.

path string

The path of the artifact.

registry_url string Required

The base URL of the artifact registry.

repository string

The repository name within the registry.

status string

The status of the artifact (e.g., active, inactive).

기본값: active

다음 중 하나일 수 있습니다.: active, eol, deleted

github_repository string

The name of the GitHub repository associated with the artifact. This should be used when there are no provenance attestations available for the artifact. The repository must belong to the organization specified in the path parameter.

If a provenance attestation is available for the artifact, the API will use the repository information from the attestation instead of this parameter.

"Create artifact metadata storage record"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

Artifact metadata storage record stored successfully.

"Create artifact metadata storage record"에 대한 코드 샘플

요청 예제

post/orgs/{org}/artifacts/metadata/storage-record
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/artifacts/metadata/storage-record \ -d '{"name":"libfoo","version":"1.2.3","digest":"sha256:1bb1e949e55dcefc6353e7b36c8897d2a107d8e8dca49d4e3c0ea8493fc0bc72","artifact_url":"https://reg.example.com/artifactory/bar/libfoo-1.2.3","registry_url":"https://reg.example.com/artifactory/","repository":"bar","status":"active"}'

Artifact metadata storage record stored successfully.

Status: 200
{ "total_count": 1, "storage_records": [ { "name": "libfoo", "digest": "sha256:1bb1e949e55dcefc6353e7b36c8897d2a107d8e8dca49d4e3c0ea8493fc0bc72", "artifact_url": "https://reg.example.com/artifactory/bar/libfoo-1.2.3", "registry_url": "https://reg.example.com/artifactory/", "repository": "bar", "status": "active", "created_at": "2023-10-01T12:00:00Z", "updated_at": "2023-10-01T12:00:00Z" } ] }

List artifact deployment records

List deployment records for an artifact metadata associated with an organization.

"List artifact deployment records"에 대한 세분화된 액세스 토큰

이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:

세분화된 토큰에는 다음 권한 집합 중 하나 이상이 있어야 합니다.:

  • "Contents" repository permissions (read)
  • "Artifact metadata" repository permissions (read)

"List artifact deployment records"에 대한 매개 변수

머리글
속성, 형식, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
속성, 형식, 설명
org string Required

The organization name. The name is not case sensitive.

subject_digest string Required

The SHA256 digest of the artifact, in the form sha256:HEX_DIGEST.

"List artifact deployment records"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

Successful response

"List artifact deployment records"에 대한 코드 샘플

요청 예제

get/orgs/{org}/artifacts/{subject_digest}/metadata/deployment-records
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/artifacts/SUBJECT_DIGEST/metadata/deployment-records

Successful response

Status: 200
{ "total_count": 1, "deployment_records": [ { "id": 123, "digest": "sha256:1bb1e949e55dcefc6353e7b36c8897d2a107d8e8dca49d4e3c0ea8493fc0bc72", "logical_environment": "prod", "physical_environment": "pacific-east", "cluster": "moda-1", "deployment_name": "prod-deployment", "tags": { "data": "sensitive" }, "created": "2011-01-26T19:14:43Z", "updated_at": "2011-01-26T19:14:43Z", "attestation_id": 456 } ] }

List artifact storage records

List a collection of artifact storage records with a given subject digest that are associated with repositories owned by an organization.

The collection of storage records returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the content:read permission is required.

"List artifact storage records"에 대한 세분화된 액세스 토큰

이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:

세분화된 토큰에는 다음 권한 집합 중 하나 이상이 있어야 합니다.:

  • "Contents" repository permissions (read)
  • "Artifact metadata" repository permissions (read)

"List artifact storage records"에 대한 매개 변수

머리글
속성, 형식, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
속성, 형식, 설명
org string Required

The organization name. The name is not case sensitive.

subject_digest string Required

The parameter should be set to the attestation's subject's SHA256 digest, in the form sha256:HEX_DIGEST.

"List artifact storage records"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

"List artifact storage records"에 대한 코드 샘플

요청 예제

get/orgs/{org}/artifacts/{subject_digest}/metadata/storage-records
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/artifacts/SUBJECT_DIGEST/metadata/storage-records

Response

Status: 200
{ "storage_records": [ { "name": "libfoo-1.2.3", "digest": "sha256:1bb1e949e55dcefc6353e7b36c8897d2a107d8e8dca49d4e3c0ea8493fc0bc72", "artifact_url": "https://reg.example.com/artifactory/bar/libfoo-1.2.3", "registry_url": "https://reg.example.com/artifactory/", "repository": "bar", "status": "active", "created_at": "2023-10-01T12:00:00Z", "updated_at": "2023-10-01T12:00:00Z" } ] }