You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
environment-whitelist is set at the top level in the S3/GCS/Azure examples, where nothing reads it #157
examples/flapi-s3.yaml:62, examples/flapi-gcs.yaml:66 and examples/flapi-azure.yaml:74 set
environment-whitelist:
- AWS_ACCESS_KEY_ID...
at the top level. The parser only reads it under template: (src/config_manager.cpp:177, template_node["environment-whitelist"]). So in these examples the whitelist is silently ignored.
Why it matters — this is the security-relevant one
The whitelist is the mechanism that limits which environment variables a template or config may read. An operator who copies these examples believes they have restricted {{env.X}} to four credentials, and has restricted nothing.
A second problem, found while checking: two implementations disagree about an empty whitelist
src/extended_yaml_parser.cpp:49, IncludeConfig::isEnvironmentVariableAllowed: empty whitelist → return true (allow all), comment "Allow all if no whitelist".
src/include/config_manager.hpp:496, TemplateConfig::isEnvironmentVariableAllowed: empty whitelist → return false (allow none), with the comment "// If no whitelist is specified, allow all variables".
The second one's comment contradicts its own code. Which behaviour is intended, and which one applies where, needs deciding — an empty or misplaced whitelist currently means different things depending on the path.
Suggested fix
Move the three examples' whitelist under template: (and check they still work).
Decide the empty-whitelist semantics once, make both implementations agree, and fix the comment.
Consider warning when a top-level environment-whitelist: is present (see the generalised unknown-top-level-key idea, filed separately).
Found while planning #153, which is the same class of bug (documented, never read).
Activity
Merge pull request #164: enforce the environment whitelist for YAML f…