Onboarding Google Container Registry
CloudGuard lets you onboard two types of registries on the Google Cloud Platform:
-
Google Container Registry A collection of repositories used to store and access container images. (GCR)
-
Google Artifact Registry (GAR)
This topic describes how to onboard your GCR to CloudGuard.
Prerequisites
Before onboarding your Container A lightweight and portable executable image that contains software and all of its dependencies. Containers decouple applications from underlying host infrastructure to make deployment easier in different cloud or OS environments, and for easier scaling. Registry to CloudGuard, select an authentication method:
-
GCP Service Account Key - GCP Google® Cloud Platform - a suite of cloud computing services that runs on the same infrastructure that Google uses internally for its end-user products, such as Google Search, Gmail, Google Drive, and YouTube. Service Account key file with the relevant permissions required for the relevant GCR.
-
GCP GKE Internal Authentication - If you have a Google Kubernetes Kubernetes, often abbreviated as “K8s”, orchestrates containerized applications to run on a cluster of hosts. Engine (GKE) cluster, CloudGuard can use the Compute Engine or GKE metadata server to authenticate with GCR.
To use this option, make sure that the service account of the GKE node pool has permissions to access the container registry.
This requirement is met by default when you work in the same project and use the default service account. You must set the required permissions for the service account if:
-
The GKE cluster is in a different project
-
The cluster uses a different service account
-
|
Notes:
|
Onboarding
To onboard a Container Registry to CloudGuard:
-
In the CloudGuard portal, navigate to Asset > Environments.
-
From the top menu, select Add > Container Registry and follow the setup steps.
-
In the Container Registry Onboarding wizard, enter the registry details:
-
Environment Name - Enter a new name for the registry or use the default name. This name allows you to identify the registry later in CloudGuard
-
Environment Description - Optionally, enter a description.
-
Select an Organizational Unit.
-
Select the type of environment to host your scanner - Kubernetes or AWS ECS scanner.
-
Select a Kubernetes cluster or an AWS environment on which you can run the registry scanner:
-
For Kubernetes, select from the list of clusters with enabled Image Assurance. For a new cluster, click Onboard a new Kubernetes Cluster and see Onboarding Kubernetes Clusters. In this case, you quit the registry onboarding and, after onboarding a new cluster, you need to start the registry onboarding from the beginning.
-
For AWS, select from the list of all AWS environments onboarded to CloudGuard.
-
-
Choose Registry type - Select Google Cloud Container Registry (GCR).
-
Registry URI - Select one of the approved endpoint names of your GCR, based on your region.
-
Authentication Method - Select one of the methods:
-
GCP Service Account Key
-
Create a service account with the needed permissions (minimal required role: roles/browser) and generate a json key for it. To do this, open a Google Cloud Shell terminal and run the commands below. This creates a service account
gcp-svc-acc
with the needed permissions to access GCR and generates the filegcp-svc-acc-keyfile.json
to use for an image pull secret.gcloud iam service-accounts create gcp-svc-acc
gcloud iam service-accounts keys create gcp-svc-acc-keyfile.json --iam-account gcp-svc-acc@<your_project_name>.iam.gserviceaccount.com
gcloud projects add-iam-policy-binding <your_project_name> --member="serviceAccount:gcp-svc-acc@<your_project_name>.iam.gserviceaccount.com" --role="roles/browser"
gsutil iam ch serviceAccount:gcp-svc-acc@<your_project_name>.iam.gserviceaccount.com:objectViewer gs://artifacts.<your_project_name>.appspot.com/
-
Pull Secret Name - Create the image pull secret on your hosting cluster where the Check Point Image Assurance agents are deployed (can be done later).
Make sure that the
<secret-name>
is a valid Kubernetes name. For more details, see the Kubernetes Documentation.To create the secret, run:
Copykubectl create secret docker-registry <secret-name> \
--namespace <cloudguard-namespace> \
--docker-server=<google-registry-uri> \
--docker-username=_json_key \
--docker-password="$(cat gcp-svc-acc-keyfile.json)" -
Enter the pull secret name in the CloudGuard onboarding wizard.
-
-
GCP GKE Internal Authentication
To use this method, make sure the hosting cluster satisfies all the prerequisites in Prerequisites. When you select this option, no more configuration is required.
-
-
-
Click Next to continue with Cluster Configurations.
In this step, you configure the CloudGuard Service Account credentials if in Step 1 you selected to onboard with a new cluster or with the existing cluster that requires an agent update.
For onboarding with the hosting cluster that has updated agents, this step is skipped.
-
Configure a Service Account by one of these methods:
-
Select an existing Service Account with its corresponding API Key.
-
Enter a Service Account manually.
-
Click Add Service Account to create a new account.
-
-
Click Next to continue to the next step.
This step appears when you select to associate the registry with a new cluster or with an existing cluster that requires an agent update. CloudGuard instructs you how to install Image Assurance agents or to update them to the latest version on the cluster.
For onboarding with the hosting cluster that has updated agents, this step is skipped.
CloudGuard shows the details of your new registry and its related cluster.
-
Follow the on-screen instructions to copy the Helm A Kubernetes deployment tool for automating creation, packaging, configuration, and deployment of applications and services to Kubernetes clusters. commands and run them on your cluster with Helm 3.
-
Click Next.
CloudGuard shows the full details of your new registry and its related cluster. If your registry onboarding includes onboarding or updating the cluster, this page shows the cluster onboarding summary. The cluster deployment takes several minutes, and you can see its progress in the Cluster and Registry Status.
For more information on the cluster onboarding summary, see STEP 4 - Onboarding Summary.
-
Wait for the deployment completion based on the Cluster and Agent Status or click Finish to skip the process.
Follow the on-screen instructions to use the provided CloudFormation Template and launch the CFT for the ECS scanner.
-
Select to use a new ECS cluster or an existing one.
-
Use the URL to review the CloudFormation Template.
-
Open the AWS Secrets Manager and click Secrets.
-
Click Store a new secret to create an image pull secret with:
-
Secret type: Other type of secret
- Key: <GCR_URI>
-
Value: _json_key: <json-secret>
-
-
Open the image pull secret and copy Secret ARN from Secret details. You need this ARN Amazon Resource Names (ARNs) uniquely identify AWS resources. They are required to specify a resource unambiguously across all of AWS, such as in IAM policies, Amazon Relational Database Service (Amazon RDS) tags, and API calls. in step 6g.
-
In the CloudGuard wizard, click the link in step 4 to start the CloudFormation Stack Creation Process in your AWS account:
-
On the Stacks page, click Create stack.
-
In Step 1 Create stack, for Prepare template, select Choose an existing template.
-
For Template source, select Amazon S3 URL.
-
In the Amazon S3 URL field, paste the URL you copied in step 2 and click Next.
-
In Step 2 Specify stack details, enter a name for the stack.
-
In Parameters > CloudGuard, paste these details copied from step 5 of the CloudGuard wizard:
-
Environment ID
-
CloudGuard API Key ID
-
CloudGuard API Key Secret
-
-
In AWS, enter these details:
-
Subnet - Select a subnet.
-
Optional - Registry Secret ARN - Enter the ARN of the secret created in step 3.
-
Optional - Custom CA Certificates ARN - see Certificate for AWS ECS Scanner.
-
-
-
After the creation of the stack, click Finish.
CloudGuard opens the onboarded registry. For onboarding validation, in the Scanners tab, see the status of the registry and the cluster that scans it.
The related Kubernetes cluster page shows information on the registries that the cluster scans, in the list on Blades > Image Assurance > Image Scan Engine agent.