Scan Serverless Google Cloud Run Function
Deploy the Qualys Cloud Operator using Terraform to scan Google Cloud Functions and Cloud Run services. The deployment covers a Service Project and one or more Target Projects.
Deploy the Service Project
Step 1: Download the Terraform Module
Download or clone the Qualys Terraform modules.
The Terraform scripts and Cloud Operator supporting this feature are expected to be available around November 20, 2026.
Step 2: Configure Variables
Navigate to the Service Project deployment directory:
cd terraform/gcp/service-project/examples/complete
Edit terraform.tfvars and provide the required variables.
| Variable | Description |
qualys_client_id |
Your Qualys Client ID. |
qualys_client_secret |
Your Qualys Client Secret. |
qualys_gateway_url |
Qualys Gateway URL for your platform POD. |
Step 3: Deploy the Service Project
Run the following commands:
terraform init
terraform plan
terraform apply
When deployment completes:
- The Service Project is automatically onboarded.
- Existing Cloud Functions are scanned.
- Existing Cloud Run services are scanned.
Authorize Target Projects
Target Projects can be authorized using one of the following methods.
- Project Allow List — Add the project ID to
authorized_target_project_ids. - Organization-Based Authorization — Add the Organization ID to
authorized_organization_ids. Projects are onboarded only when authorization checks succeed.
Authorization is evaluated in the following order:
- Project allow list
- Organization membership
Note: Organizations are trusted only when explicitly listed.
Deploy the Target Project
Repeat the following steps for each Target Project.
-
Navigate to the Target Project deployment directory:
cd terraform/gcp/target-project/examples/complete -
Configure the following variables in
terraform.tfvars:target_project_idservice_project_id
-
Deploy the module:
terraform initterraform planterraform apply
After deployment:
- The Target Project is automatically onboarded.
- Existing Cloud Functions are scanned.
- Existing Cloud Run services are scanned.
Verify Deployment
Verify the Cloud Operator
Run:
gcloud run services list --region=<REGION> --project=<SERVICE_PROJECT_ID>
Verify Pub/Sub Subscription
Run:
gcloud pubsub subscriptions describe qualys-cloud-scanning-cloud-operator-subscription --project=<SERVICE_PROJECT_ID>
Verify Project Onboarding
Run:
gcloud logging read 'resource.type=cloud_run_revision AND resource.labels.service_name=qualys-cloud-operator AND textPayload=~"authorized via"' --project=<SERVICE_PROJECT_ID> --freshness=5m
In Firestore, verify that the qualys-onboarded-projects collection contains onboarded projects. Projects should appear with:
status = active- An
authorized_viafield
Verify Scan Results
Verify that Cloud Functions and Cloud Run services appear in the Qualys user interface with generated scan results.
Note: UI navigation path — TBD.
Update an Existing Deployment
To update an existing deployment, edit terraform.tfvars and run:
terraform apply
Use this process to:
- Update Cloud Operator configuration
- Modify scaling parameters
- Add authorized projects
- Upgrade the Cloud Operator image
Do not modify deployed resources directly using gcloud commands. Doing so may cause Terraform state drift.
Remove the Deployment
Remove Target Projects
Run:
cd terraform/gcp/target-project/examples/complete
terraform destroy
Remove the Service Project
Run:
cd terraform/gcp/service-project/examples/complete
terraform destroy
Additional Cleanup
Remove any manually granted Folder Viewer permissions.
Note: Firestore data is not removed automatically. Delete it manually if required.
Limitations
- One Service Project can scan multiple Target Projects.
- Scans run with a default Cloud Run concurrency of 1.
- The operator does not scan its own Cloud Run service.
- Scan records are automatically removed after 90 days.
- Long-running scans may result in Pub/Sub message redelivery.
- Duplicate scan requests are automatically detected and ignored.
Troubleshooting
Go to Container Security > Configuration > Terraform Deployment to view Service Projects, Target Projects, authorization controls, and IAM permissions.