Environment Variables in Container and Cloud Platforms
What you'll learn: How container orchestrators and cloud platforms handle environment variables differently than traditional servers—and why this creates unique security visibility challenges.
The Container and Cloud Context
In traditional servers, environment variables are relatively isolated. But in container orchestrators (like Kubernetes) and cloud platforms (like AWS ECS, Azure Container Instances), environment variables are handled through declarative configuration files and orchestration APIs. This fundamentally changes their security profile.
How Platforms Expose Environment Variables
Container Manifests: In Kubernetes, environment variables are defined in YAML manifests that specify pod configurations. These files are often stored in version control, shared across teams, and visible to anyone with cluster read access. Even if the actual environment variable is set dynamically, the structure revealing what secrets exist is exposed.
Cloud Platform APIs: AWS ECS task definitions, Azure container configurations, and similar services store environment variable definitions in cloud APIs. Anyone with read permissions on these resources can list all environment variables—including their values—through API calls or console interfaces.
Orchestrator Dashboards: Many platforms provide web UIs showing running containers and their configurations, making environment variables visible to operators and potentially attackers who gain dashboard access.
The Visibility Problem
Think of traditional environment variables like notes written on your desk—only people in your office see them. Container platform environment variables are more like notes projected on a shared screen that everyone in the building can view remotely.
The key risks:
- Broader access scope: Multiple users and services can inspect configurations
- API discoverability: Programmatic enumeration makes secrets easier to find
- Log aggregation: Container platforms often log environment variables during startup
- Image layer exposure: Environment variables set during image builds persist in layers
Key Takeaway: Container and cloud platforms treat environment variables as orchestration metadata, making them far more visible and discoverable than on traditional servers—requiring extra caution when storing secrets this way.