Skip to content

environment-whitelist is set at the top level in the S3/GCS/Azure examples, where nothing reads it #157

Closed

Description

@jrosskopf

What

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

  1. Move the three examples' whitelist under template: (and check they still work).
  2. Decide the empty-whitelist semantics once, make both implementations agree, and fix the comment.
  3. 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

  1. added a commit that references this issue on Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions