Deploy App-Embedded Defender in Google Cloud Run (GCR)
Table of Contents
Self.Hosted 31.xx
Expand all | Collapse all
-
- Getting started
- System Requirements
- Cluster Context
-
- Prisma Cloud Container Images
- Kubernetes
- Deploy the Prisma Cloud Console on Amazon ECS
- Console on Fargate
- Onebox
- Alibaba Cloud Container Service for Kubernetes (ACK)
- Azure Container Service (ACS) with Kubernetes
- Azure Kubernetes Service (AKS)
- Amazon Elastic Kubernetes Service (EKS)
- IBM Kubernetes Service (IKS)
- OpenShift v4
-
- Defender Types
- Manage your Defenders
- Redeploy Defenders
- Uninstall Defenders
-
- Deploy Orchestrator Defenders on Amazon ECS
- Automatically Install Container Defender in a Cluster
- Deploy Prisma Cloud Defender from the GCP Marketplace
- Deploy Defenders as DaemonSets
- VMware Tanzu Application Service (TAS) Defender
- Deploy Defender on Google Kubernetes Engine (GKE)
- Google Kubernetes Engine (GKE) Autopilot
- Deploy Defender on OpenShift v4
-
- Agentless Scanning Modes
-
- Onboard AWS Accounts for Agentless Scanning
- Onboard Azure Accounts for Agentless Scanning
- Configure Agentless Scanning for Azure
- Onboard GCP Accounts for Agentless Scanning
- Configure Agentless Scanning for GCP
- Onboard Oracle Cloud Infrastructure (OCI) Accounts for Agentless Scanning
- Configure Agentless Scanning for Oracle Cloud Infrastructure (OCI)
- Agentless Scanning Results
-
- Rule ordering and pattern matching
- Backup and Restore
- Custom feeds
- Configuring Prisma Cloud proxy settings
- Prisma Cloud Compute certificates
- Configure scanning
- User certificate validity period
- Enable HTTP access to Console
- Set different paths for Defender and Console (with DaemonSets)
- Authenticate to Console with Certificates
- Configure custom certs from a predefined directory
- Customize terminal output
- Collections
- Tags
- Logon settings
- Reconfigure Prisma Cloud
- Subject Alternative Names
- WildFire Settings
- Log Scrubbing
- Clustered-DB
- Permissions by feature
-
- Logging into Prisma Cloud
- Integrating with an IdP
- Integrate with Active Directory
- Integrate with OpenLDAP
- Integrate Prisma Cloud with Open ID Connect
- Integrate with Okta via SAML 2.0 federation
- Integrate Google G Suite via SAML 2.0 federation
- Integrate with Azure Active Directory via SAML 2.0 federation
- Integrate with PingFederate via SAML 2.0 federation
- Integrate with Windows Server 2016 & 2012r2 Active Directory Federation Services (ADFS) via SAML 2.0 federation
- Integrate Prisma Cloud with GitHub
- Integrate Prisma Cloud with OpenShift
- Non-default UPN suffixes
- Compute user roles
- Assign roles
-
- Prisma Cloud Vulnerability Feed
- Scanning Procedure
- Vulnerability Management Policies
- Vulnerability Scan Reports
- Scan Images for Custom Vulnerabilities
- Base images
- Vulnerability Explorer
- CVSS scoring
- CVE Viewer
-
- Configure Registry Scans
- Scan Images in Alibaba Cloud Container Registry
- Scan Images in Amazon Elastic Container Registry (ECR)
- Scan images in Azure Container Registry (ACR)
- Scan Images in Docker Registry v2 (including Docker Hub)
- Scan Images in GitLab Container Registry
- Scan images in Google Artifact Registry
- Scan Images in Google Container Registry (GCR)
- Scan Images in Harbor Registry
- Scan Images in IBM Cloud Container Registry
- Scan Images in JFrog Artifactory Docker Registry
- Scan Images in Sonatype Nexus Registry
- Scan images in OpenShift integrated Docker registry
- Scan Images in CoreOS Quay Registry
- Trigger Registry Scans with Webhooks
- Configure VM image scanning
- Configure code repository scanning
- Malware scanning
- Windows container image scanning
- Serverless Functions Scanning
- VMware Tanzu Blobstore Scanning
- Scan App-Embedded workloads
- Troubleshoot Vulnerability Detection
-
- Compliance Explorer
- Enforce compliance checks
- CIS Benchmarks
- Prisma Cloud Labs compliance checks
- Serverless functions compliance checks
- Windows compliance checks
- DISA STIG compliance checks
- Custom compliance checks
- Trusted images
- Host scanning
- VM image scanning
- App-Embedded scanning
- Detect secrets
- OSS license management
-
- Alert Mechanism
- AWS Security Hub
- Cortex XDR alerts
- Cortex XSOAR alerts
- Email alerts
- Google Cloud Pub/Sub
- Google Cloud Security Command Center
- IBM Cloud Security Advisor
- JIRA Alerts
- PagerDuty alerts
- ServiceNow alerts for Security Incident Response
- ServiceNow alerts for Vulnerability Response
- Slack Alerts
- Splunk Alerts
- Webhook alerts
- API
Deploy App-Embedded Defender in Google Cloud Run (GCR)
Deploy an App-Embedded Defender in GCR to provide runtime protection to App-Embedded applications installed in GCR.
The App-Embedded Defender enforces runtime policy on the application entrypoint and any child processes created by this entrypoint.
To learn when to use App-Embedded Defenders, see Defender types.
To learn more about App-Embedded Defender’s capabilities, see:
System Requirements
- GCR supports Linux (X86) containers
- Any Docker image with Prisma Cloud App-Embedded Defender binary
- Google Cloud Registry (recommended)
Prerequisites
- You can connect to GCR and DockerHub
Configure GCP to authenticate Prisma Cloud
- Sign in to your Google Cloud account.
- Log in to Google Cloud Registry.
- In the Google Cloud Console, on the project selector page, select or create a Google Cloud project.
- Set "private" visibility for your GCP container registry host underGCP project > Home > Container Registry > Settings.
- Configure GCloud authentication using any of the following options:
- Authenticate using GCP user credentials:$ gcloud auth login ### Type the User GCP credentials $ cat ~/.docker/config.json ### Check that GCP has gcloud users configuredAuthenticate using GCP Service Account:$ gcloud auth activate-service-account ACCOUNT --key-file=KEY-FILE ### KEY-FILE is the Service Account key file under *GCP > Service Accounts > Actions > Manage keys*
Configure Docker for GCP in your localhost$ gcloud auth configure-docker $ cat ~/.docker/config.json. ### check that GCP has gcloud users configuredConfigure App-Embedded Defender in Prisma Console UIPrisma Console provides you with an App-Embedded Defender bundle that contains the Dockerfile with App-Embedded configurations and the Defender installation binary file.You can select one of theDeployment types: Dockerfile or Manual.- Dockerfile: Creates a new Dockerfile based on your Dockerfile and embeds the App-Embedded parameters.
- Manual: Select the manual method to customize the required Dockerfile parameters in the Console UI and directly download the App-Embedded Defender binary file.
Embed App-Embedded Defender with DockerfileUpload your Dockerfile and Prisma Cloud creates a new Dockerfile with App-Embedded Defender parameters and the Defender binary file.- Log in to Prisma Cloud Console.
- Go toManage > Defenders > Deployed Defenders > Manual deploy.
- In Deployment method, selectSingle Defender.
- Select the Defender type asContainer Defender - App-Embedded.
- Select the DNS name configured inManage > Defenders > Names (SAN)or public IP address that Defender will use to connect to Prisma Console.
- Enable file system runtime protectionto allow the sensors to monitor file system events regardless of how your runtime policy is configured, and could impact the underlying workload’s performance.
- Select Deployment type asDockerfile.
- InApp ID, enter a unique identifier for the App-Embedded Defender. All vulnerability, compliance, and runtime findings for the container will be aggregated under this App ID. In Console, the App ID is presented as the image name. Be sure to specify an App ID that lets you easily trace findings back to the image.
- InData folder, enter the path that the Defender will use to write files and store information.
- Dockerfile: Upload the Dockerfile for your container image. Set up the task’s entrypoint in the Dockerfile. The embed process modifies the container’s entrypoint to run the App-Embedded Defender first, which in turn starts the original entrypoint process. The Defender starts defending the app from the entrypoint and the thread/child process created by this entrypoint.
- Downloadthe App-embedded bundle that contains the Dockerfile with Defender deployment configurations appended to your Dockerfile and the App-Embedded Defender binary file.
- Rebuild the image and embed the Defender in GCR.
Embed App-Embedded Defender ManuallyEmbed App-Embedded Defender into a container image manually. Modify your Dockerfile with the given configurations, download the App-Embedded Defender binaries into the image’s build context, then rebuild the image.Prerequisites- At runtime, the container where you’re embedding App-Embedded Defender can reach Console over the network. For Enterprise Edition, Defender talks to Console on port 443. For Compute Edition, Defender talks to Console on port 8084.
- The host where you are rebuilding your container image with App-Embedded Defender can reach Console over the network on port 8083.
- You have the Dockerfile for your image.
- Log in to Prisma Cloud Console.
- Go toManage > Defenders > Deployed Defenders > Manual deploy.
- In Deployment method, selectSingle Defender.
- Select the Defender type asContainer Defender - App-Embedded.
- Select the DNS name (configured inManage > Defenders > Names (SAN)or public IP address that Defender will use to connect to Prisma Console.
- Enable file system runtime protectionto allow the sensors to monitor file system events regardless of how your runtime policy is configured, and could impact the underlying workload’s performance.
- SelectDeployment typeasManualFollow the instructions for embedding App-Embedded Defender into your image.
- Download the App-Embedded bundle using the command or download the file directly.
- Configure your Dockerfile and set the following environment variables:DEFENDER_TYPE="appEmbedded" ENV DEFENDER_APP_ID="Unique identifier for the App-Embedded Defender in Prisma Cloud Console" FILESYSTEM_MONITORING="true/false" WS_ADDRESS="Websocket address the Defender is communicating to" DATA_FOLDER="The path that Defender uses to store its metadata" INSTALL_BUNDLE="The access key for the Prisma Console, copy this from the Console" FIPS_ENABLED="true/false" ENTRYPOINT="Modify the entrypoint for the app to start the app under the control of App-Embedded Defender"Add the App-Embedded Defender to Dockerfile.ADD twistlock_defender_app_embedded.tar.gz <DATA_FOLDER>Modify the entrypoint so that your app starts under the control of App-Embedded Defender.Rebuild your image and embed the Defender in Cloud instance.
Embed App-Embedded Defender in GCRPrisma Cloud uses the updated Dockerfile to deploy the Defender in your containers running in GCR. Use the updated Dockerfile to build the image for App-Embedded Defender, push it to Google Container Registry, and then run the Google Container instance.Prerequisite:- Create a new GCR repository, if not already exists.
- Log in to Dockerdocker loginCopy the App-Embedded zipped bundle and unzip it to get the Dockerfile and App-Embedded Defender binary.Build the Dockerfile:docker build -t <GCP_Container_Registry>:<docker_images_name> <local_path_host_dockerfile>If your Dockerfile is in the current directory, use.for <local_path_host-Dockerfile>Push the docker image to GCR:docker push HOSTNAME/PROJECT-ID/IMAGE:TAG
- Verify the docker image exists in yourGCP project > Container Registry > Imagesunder your relevant repository.
Deploy Docker image in Google Cloud Run using Google Console:- Select yourContainer Registry > Images, and selectActions > Deploy to Cloud Run.
- Enter aService nameor select the default value.
- Set theCPU allocation and pricingtoCPU is always allocated.
- Select theIngresstraffic to allowAllrequests, including requests directly from the internet to therun.
In theContainer, Networking, Securitysection, enter theContainer portas 8080.SelectCREATE.Go toCloud Runand verify the Docker Container service running in GCP.This App-Embedded Defender running in GCR is now recognized in Prisma Console underManage > Defenders > Deployed Defenders.Embed App-Embedded Defender with twistcliUse the twistcli command line tool to embed an App-Embedded Defender in your Cloud Container Registries.Prerequisites:- Running tasks can connect to Prisma Cloud Console over the network.
- Prisma Cloud Defender connects to Console to retrieve runtime policies and send audits.
- Defender uses port 8084 to connect to the Prisma Cloud Console by default. You can configure the port number when you install the Prisma Cloud Console.
- The container where you’re embedding App-Embedded Defender can reach Console’s port 8084 over the network.
- You have Dockerfile for you image.
- Cloud CLI, such as Azure CLI, or Google Cloud CLI.
- Log in to Prisma Cloud Console.
- Run twistcli to embed Defender in your Cloud Registry (such as Azure, or Google Run).A file named app_embedded_embed<app_id>.zip_ is created, that has the Dockerfile for App-Embedded Defender and App-Embedded Defender binary file.$ ./twistcli app-embedded embed \ --user <USER> \ --password <PASSWORD> \ --address "<CONSOLE_URL>" \ --app-id <APP-ID name> \ --data-folder /tmp \ <Docker-file-path-location>
- <user> — Name of a Prisma Cloud user with a minimum role of Defender Manager.
- <password> — For Prisma Cloud Enterprise Edition, you can also specify the secret key that you configured underPrisma > Settings > Access Control > Access Keys.
- <token> — API Token for authenticating with Prisma Cloud Console. (For Enterprise Edition only)
- <CONSOLE> — DNS name or IP address for Console.
- <APP-ID> — Unique identifier.When setting <APP-ID>, specify a value that lets you easily trace findings back to the image. All vulnerability, compliance, and runtime findings for the container will be aggregated under this App ID.In Console, the App ID is presented as the image name.
- <DATA-FOLDER> — Readable and writable directory in the container’s filesystem.
- To enable file system protection, add the --filesystem-monitoring flag to the twistcli command.
Unpack app_embedded_embed_help.zip.Create and push the docker image to GCR- Authenticate using GCP credentials:$ gcloud auth loginOr, Authenticate using GCP Service Account key (KEY-FILE): (Get the KEY-FILE fromGCP > Service Accounts > Actions > Manage keys)$ gcloud auth activate-service-account ACCOUNT --key-file=KEY-FILEConfigure Docker for GCP in your localhost$ glcoud auth configure-dockerBuild the Dockerfile$ docker build -t <GCP_Container_Registry>:<docker_images_name> <local_path_host_dockerfile> $ docker images ### Verify the image builtPush the image to GCR$ docker push HOSTNAME/PROJECT-ID/IMAGE:TAGCheck the image exists in GCR repo underGCP project > Container Registry > ImagesDeploy Docker image in Google Cloud Run using gcloud$ gcloud run deploy [SERVICE] \ --image <IMAGE_URL> \ --service-account <SERVICE_ACCOUNT> \ --no-cpu-throttling \ --platform managed \ --ingress <all> \ --port <port-exposed-in-dockerfile> \ --region <REGION> \ --project <PROJECT_NAME>If there is no port exposed in Dockerfile, GCP Cloud Run will use 8080 port as the default.Delete a Container Instance$ az container delete -g <MyContainerGroup> --name <Container-name> -yTrigger Events for App-EmbeddedRefer to Runtime defense for App-Embedded.To trigger the App Server logs, get the GCP URL from GCP Docker Container service.$ curl -k -X POST -H "Authorization: Bearer $(gcloud auth print-identity-token)" <app_emb_gcp_URL>/runsee -d $(echo 'ldd --help'|base64)Monitor App-Embedded EventsYou can view the App-Embedded runtime events by app ID underMonitor > Events > App-Embedded audits, and view the App-Embedded incidents underMonitor > Runtime > Incident Explorer.You can also deploy WAAS for Containers Protected By App-Embedded Defender, create a WAAS rule policy, add an app, enable protections, run WAAS sanity tests, and monitor the events underMonitor > Events > WAAS for App-Embedded.
Recommended For You