π‘οΈ Google Cloud Function Environment Variables store confidential dataπ’βͺ
- Contextual name: π‘οΈ Cloud Function Environment Variables store confidential dataπ’βͺ
- ID:
/ce/ca/google/cloud-run/function-environment-variables-store-confidential-data - Tags:
- βͺ Impossible policy
- π’ Policy with categories
- π’ Policy with type
- Policy Type:
COMPLIANCE_POLICY - Policy Categories:
SECURITY
Similar Policiesβ
- Cloud Conformity: Use Secrets Manager for Managing Secrets in Google Cloud Functions
Descriptionβ
Descriptionβ
Google Cloud Functions allow you to host serverless code that is executed when an event is triggered, without requiring management of a host operating system. These functions can also store environment variables to be used by the code that may contain authentication or other information that needs to remain confidential.
Rationaleβ
It is recommended to use Secret Manager, because environment variables are stored unencrypted and accessible to all users who have access to the code.
Impactβ
There should be no impact on the Cloud Function. There are minor costs after 10,000 requests per month to the Secret Manager API, and higher usage of other functions may incur additional costs. Modifying the Cloud Function to use Secret Manager may prevent it from running to completion.
Auditβ
Determine if Confidential Information is Stored in your Functions in Cleartextβ
From Google Cloud Consoleβ
- Within the project you wish to audit, select the Navigation hamburger menu in the top left. Scroll down to under the heading
Serverless, then selectCloud Functions... see more
Remediationβ
Remediationβ
Enable Secret Manager API for your Projectβ
From Google Cloud Consoleβ
- Within the project you wish to enable, select the Navigation hamburger menu in the top left. Hover over
APIs & Servicesto under the headingServerless, then selectEnabled APIs & Servicesin the menu that opens up.- Click the button
+ Enable APIs and Services- In the
Searchbar, search forSecret Manager APIand select it.- Click the blue box that says
Enable.From Google Cloud CLIβ
Within the project you wish to enable the API in, run the following command.
gcloud services enable Secret Manager APIReviewing Environment Variables That Should Be Migrated to Secret Managerβ
From Google Cloud Consoleβ
- Log in to the Google Cloud Web Portal
- Go to
Cloud Functions- Click on a function name from the list
- Click on
Editand review theRuntime environmentfor variables that should be secrets. Leave this list open for the next step.From Google Cloud CLIβ
... see more
policy.yamlβ
Linked Framework Sectionsβ
| Section | Sub Sections | Internal Rules | Policies | Flags | Compliance |
|---|---|---|---|---|---|
| πΌ CIS GCP v1.3.0 β πΌ 1.18 Ensure Secrets are Not Stored in Cloud Functions Environment Variables by Using Secret Manager - Level 1 (Manual) | 1 | no data | |||
| πΌ CIS GCP v2.0.0 β πΌ 1.18 Ensure Secrets are Not Stored in Cloud Functions Environment Variables by Using Secret Manager - Level 1 (Manual) | 1 | no data | |||
| πΌ CIS GCP v3.0.0 β πΌ 1.17 Ensure Secrets are Not Stored in Cloud Functions Environment Variables by Using Secret Manager - Level 1 (Manual) | 1 | no data | |||
| πΌ Cloudaware Framework β πΌ Secure Access | 53 | no data |