Skip to content

Support environment variables for sensitive configuration (tokens) #147

Open

Description

@kitplummer

Problem

Authentication tokens are passed via CLI flags:

goa spy https://github.com/org/repo -u user -t ghp_xxxxxxxxxxxx

This exposes tokens in:

  • Process listings (ps aux)
  • Shell history
  • CI/CD logs (if not masked)

SECURITY.md acknowledges this but no mitigation is implemented.

Proposed

Support environment variables as an alternative to CLI flags:

CLI Flag Environment Variable
-t / --token GOA_TOKEN
-u / --username GOA_USERNAME
--lei-token GOA_LEI_TOKEN

Clap supports this natively:

#[arg(short, long, env = "GOA_TOKEN")]
token: Option<String>,

Priority: CLI flag > env var (explicit flag overrides env var).

Related

  • Issue .goarc #88 (.goarc config file) -- config file could also hold credentials, but env vars are the standard approach for containers and CI
  • SECURITY.md should be updated to recommend env vars over CLI flags
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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions