Cloud posture check · AWS, Azure, Google Cloud

A function stores a secret in its environment variables

Reads every serverless function in each connected cloud account and reports one when a function stores a secret in its environment variables.

Why it matters

Environment variables are shown in the console and returned by the read API to anyone allowed to view the function, so the secret is not confined to the code that needs it.

How to fix it

Move the value to a secret manager and reference it from the function.

What TrustIvan reads

  • Amazon Web Services: the collector reads what this check needs, so it passes or fails.
  • Microsoft Azure: the collector does not read this yet, so the check reports not assessed, never a pass.
  • Google Cloud: the collector reads what this check needs, so it passes or fails.

Cloud accounts are read with read-only access. These results describe configuration; they are not an attestation that a benchmark is met. The access to grant: Amazon Web Services, Microsoft Azure, Google Cloud.

Benchmark controls

  • CIS Google Cloud Platform Foundation Benchmark 3.0.0, control 1.17: Function secrets are not kept in environment variables
  • CIS Microsoft Azure Foundations Benchmark 2.1.0, control 9.10: Key Vault stores app secrets

Control numbers are the published ones; the titles are TrustIvan's own short descriptions. The benchmarks belong to their publishers, who do not endorse TrustIvan.

Terms: CSPM (cloud security posture management), CIS Benchmarks, Least privilege

All cloud posture checks · The whole catalogue · How this works in TrustIvan · Documentation

See TrustIvan on your own estate.

Book thirty minutes with an engineer and bring an image, a repository or a cloud account, or start free on the hosted service.