OS 패키지 수동 스캔
이 빠른 시작에서는 컨테이너 이미지를 가져오고, On-Demand Scanning API를 사용하여 운영체제 취약점을 수동으로 스캔하고, 식별된 취약점을 가져오는 방법을 보여줍니다. 이 빠른 시작을 따르려면 Cloud Shell과 Ubuntu 이미지 예시를 사용합니다.
시작하기 전에
- 계정에 로그인합니다. Google Cloud 를 처음 사용하는 경우 계정을 만들고 Google 제품의 실제 성능을 평가해 보세요. 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.
-
Verify that billing is enabled for your Google Cloud project.
Enable the On-Demand Scanning API.
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.-
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.
-
Verify that billing is enabled for your Google Cloud project.
Enable the On-Demand Scanning API.
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.
이미지 다운로드 및 스캔
프로젝트에서 Cloud Shell을 엽니다.
이렇게 하면 이 가이드를 따르는 데 필요한 모든 도구가 포함된 터미널이 열립니다.
docker를 사용하여 최신 Ubuntu 이미지를 가져옵니다.
docker pull ubuntu:latest스캔을 실행합니다.
gcloud artifacts docker images scan ubuntu:latest이렇게 하면 스캔 프로세스가 트리거되고 완료되면 스캔 이름이 반환됩니다.
✓ Scanning container image ✓ Locally extracting packages and versions from local container image ✓ Remotely initiating analysis of packages and versions ✓ Waiting for analysis operation to complete [projects/my-project/locations/us/operations/1a6fd941-b997-4e5f-ba4f-6351f30e7dad] Done. done: true metadata: '@type': type.googleapis.com/google.cloud.ondemandscanning.v1.AnalyzePackagesMetadata createTime: '2021-01-26T13:43:53.112123Z' resourceUri: ubuntu:latest name: projects/my-project/locations/us/operations/1a6fd941-b99f-4eaf-ba4f-6e5af30e7dad response: '@type': type.googleapis.com/google.cloud.ondemandscanning.v1.AnalyzePackagesResponse scan: projects/my-project/locations/us/scans/893c91ce-7fe6-4f1a-a69a-d6ca1b465160
스캔 이름, 출력의
scan값을 사용하여 스캔 결과를 가져옵니다.gcloud artifacts docker images list-vulnerabilities \ projects/my-project/locations/us/scans/893c91ce-7fe6-4f1a-a69a-d6ca1b465160
삭제
이 페이지에서 사용한 리소스 비용이 Google Cloud 계정에 청구되지 않도록 하려면 다음 단계를 수행합니다.
이 가이드에 사용할 새 프로젝트를 만든 경우 이제 프로젝트를 삭제할 수 있습니다.