In a CI/CD-driven automation, you run Python code that triggers Cloud Functions. The function receives an event and then calls a downstream API. Which practice best improves security against privilege escalation and unintended invocation?
Answer
Use an identity-aware policy: restrict invoker permissions to a specific service account and validate tokens/issuer on the function side
Explanation
Restricting invoker identity controls who can trigger the function. Validating issuer/audience at the application layer prevents callers from using forged or unintended tokens.
Last reviewed: October 2026
Reviewed by FirstInTest Editorial Team
Related questions
You need to automate remediation of Compute Engine instances by resizing disks and tagging the instance for audit. Which IAM pattern is safest and least privilege for this automation?
View question →
You are designing a Python automation that parses logs exported to BigQuery to detect anomalies and then posts to a chat webhook. Which pipeline choice best balances correctness and cost?
View question →
Which statement best describes how to handle transient failures when using Python clients for Google Cloud services (e.g., Google APIs) so your automation remains reliable?
View question →
For Python-based infrastructure automation, you must update firewall rules and then confirm the resulting effective policy using GCP APIs. Which method best supports eventual consistency and deterministic verification?
View question →
In a workflow that updates Kubernetes resources from Python, you observe that API calls succeed but controllers do not reconcile immediately. What approach most effectively coordinates automation with reconciliation timing?
View question →
A Python job uses OAuth2 to call a third-party REST API and logs the full request/response for debugging. Which change best prevents sensitive data from being stored in logs while preserving observability?
View question →