More Info:

Ensure that the Cloud Function users do not have administrative priveleges

Risk Level

Critical

Address

Security

Compliance Standards

PCIDSS, HIPAA

Triage and Remediation

Remediation

To remediate the misconfiguration in GCP where a Cloud Function has admin access, you can follow the below steps:

  1. Open the Google Cloud Console and navigate to the Cloud Functions page.

  2. Select the Cloud Function that has admin access.

  3. Click on the “Edit” button on the top of the page.

  4. Scroll down to the “Roles” section and click on the “Add Member” button.

  5. In the “New Member” field, enter the email address of the service account that you want to use to run the Cloud Function.

  6. In the “Role” field, select the “Cloud Functions Invoker” role from the drop-down menu.

  7. Click on the “Save” button to save the changes.

  8. Verify that the service account has the “Cloud Functions Invoker” role by navigating to the “IAM & Admin” page and selecting the “IAM” tab.

  9. Find the service account that you added and verify that it has the “Cloud Functions Invoker” role assigned to it.

By following these steps, you can remediate the misconfiguration in GCP where a Cloud Function has admin access.

Additional Reading: