개요
취약점 스캔에서 보안 비밀을 감지하면 Artifact Analysis는 보안 비밀에 대한 세부정보가 포함된 보안 비밀 유형 어커런스를 만듭니다. Artifact Analysis는 다음 보안 비밀을 감지할 수 있습니다.
보안 비밀
- Anthropic 관리자 키
- Anthropic API 키
- Azure 액세스 토큰
- Azure ID 토큰
- Docker Hub 개인 액세스 토큰
- GitHub 앱 갱신 토큰
- GitHub 앱 서버 간 토큰
- GitHub 앱 사용자-서버 토큰
- GitHub 기본 개인 액세스 토큰
- GitHub 세분화된 개인 액세스 토큰
- GitHub OAuth 토큰
- Google Cloud OAuth2 (클라이언트 ID 및 보안 비밀) 쌍
- Google Cloud OAuth2 액세스 토큰
- Google Cloud 서비스 계정 키
- Google Cloud API 키
- Huggingface API 키
- OpenAI API 키
- Perplexity API 키
- Stripe 제한 키
- Stripe 보안 비밀 키
- Stripe 웹훅 보안 비밀
어커런스 보고서의 다양한 유형의 보안 비밀에 대한 자세한 내용은
SecretKind
Artifact Analysis API 참고 리소스에서 확인하세요.
Artifact Analysis는 텍스트 파일로 저장된 보안 비밀만 감지할 수 있습니다. 지원되는 파일 확장자는 다음과 같습니다.
.cer.cfg.crt.der.env.html.key.ipynb.json.log.md.pem.py.pypirc.textproto.toml.txt.xml.yaml
시작하기 전에
- 계정에 로그인합니다. Google Cloud 를 처음 사용하는 경우 Google Cloud 계정을 만들어 실제 시나리오에서 제품이 어떻게 작동하는지 평가하세요. 신규 고객에게는 워크로드를 실행, 테스트, 배포하는 데 사용할 수 있는 $300의 무료 크레딧이 제공됩니다.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
If you're using an existing project for this guide, verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Artifact Registry and Container Scanning APIs.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.-
Google Cloud CLI를 설치합니다.
-
외부 ID 공급업체(IdP)를 사용하는 경우 먼저 제휴 ID로 gcloud CLI에 로그인해야 합니다.
-
gcloud CLI를 초기화하려면, 다음 명령어를 실행합니다.
gcloud init -
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
If you're using an existing project for this guide, verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Artifact Registry and Container Scanning APIs.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.-
Google Cloud CLI를 설치합니다.
-
외부 ID 공급업체(IdP)를 사용하는 경우 먼저 제휴 ID로 gcloud CLI에 로그인해야 합니다.
-
gcloud CLI를 초기화하려면, 다음 명령어를 실행합니다.
gcloud init
이 API를 사용 설정하면 Artifact Registry에서 언어 패키지 스캔도 사용 설정됩니다. 지원되는 패키지 유형을 참고하세요.
필요한 역할
취약점 스캔 중에 보안 비밀을 위해 이미지를 스캔하는 데 필요한 권한을 얻으려면 관리자에게 프로젝트에 대한 다음 IAM 역할을 부여해 달라고 요청하세요.
- Artifact Registry 작성자 (
roles/artifactregistry.writer) - 컨테이너 분석 어커런스 뷰어 (
roles/containeranalysis.occurrences.viewer)
역할 부여에 대한 자세한 내용은 프로젝트, 폴더, 조직에 대한 액세스 관리를 참고하세요.
커스텀 역할이나 다른 사전 정의된 역할을 통해 필요한 권한을 얻을 수도 있습니다.
보안 비밀 보기
취약점 스캔 후 보안 비밀을 보려면 다음 단계를 따르세요.
취약점 스캔이 완료될 때까지 기다립니다.
다음 명령어를 실행하여 스캔된 이미지의 보안 비밀 어커런스를 나열합니다.
$ curl -G -H "Content-Type: application/json" -H "Authorization: Bearer $(gcloud auth print-access-token)" --data-urlencode "filter=(kind=\"SECRET\" AND resourceUrl=\"RESOURCE_URL\")" https://containeranalysis.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/occurrences각 항목의 의미는 다음과 같습니다.
- PROJECT_ID는 Google Cloud 콘솔 프로젝트 ID입니다.
- LOCATION은 저장소의 리전 또는 멀티 리전 위치입니다.
- RESOURCE_URL은 스캔된 이미지의 URL이며
https://LOCATION-docker.pkg.dev/PROJECT_ID/REPOSITORY/IMAGE_ID형식입니다.
다음 샘플 응답은 가능한 결과를 보여줍니다. 이 경우Google Cloud API 키가
my_api_key.yaml라는 이름으로 이미지의documents디렉터리에서 식별되었습니다.secret속성은 발견된 보안 비밀에 대한 정보를 보여줍니다.{ "occurrences": [ { "name": "projects/my-project/locations/us-east1/occurrences/45619d23-66b1-4f5b-9b12-9060d7f97ff3", "resourceUri": "https://us-east1-docker.pkg.dev/my-project/my-images/test-image-0106@sha256:73cf5b9a788dc391c40e9cf1599144d03875b5d2dc935988ebfef8260bd2678e", "noteName": "projects/my-project/locations/us-east1/notes/secret_kind_gcp_api_key", "kind": "SECRET", "createTime": "2026-01-06T21:16:14.905851Z", "updateTime": "2026-01-06T21:16:14.905851Z", "secret": { "kind": "SECRET_KIND_GCP_API_KEY", "locations": [ { "fileLocation": { "filePath": "documents/my_api_key.yaml", "layerDetails": { "index": 2, "diffId": "7b76df10d6d90391830392eac96b0ef2d2d43822c6ff4754aa6daea0fe14a8c5", "command": "COPY . . # buildkit", "chainId": "sha256:75df0c59982f47cc38e730e1a122b67fceaaf7797d91e1fa17ffffc5cfe7ff59" } } } ] } } ] }
제한사항
- 보안 비밀 스캔이 공개 미리보기 상태인 동안 보안 비밀 유형 어커런스는 Container Analysis API에서만 볼 수 있습니다.
- Artifact Analysis 보안 비밀 스캔은 이미지당 보안 비밀당 최대 하나의 어커런스를 보고합니다. 어커런스당 최대 1,000개의 파일 위치가 반환됩니다.
- 식별된 보안 비밀에서 오탐이 발생할 수 있습니다. 이미지에 대해 조치를 취하기 전에 항상 식별된 각 보안 비밀을 확인하세요.