Skip to content

concord-cli: support for remote secrets, configurable secrets providers #1143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

ibodrov
Copy link
Collaborator

@ibodrov ibodrov commented May 16, 2025

Config example:

# ~/.concord/cli.yaml
contexts:
  default: # those are the defaults, we don't need to put them in the local config file
    secrets:
      vault:
        dir: "${configDir}/vaults"
        id: "default"
      local:
        enabled: true
        writable: true
        dir: "${configDir}/secrets"
      remote:
        enabled: false
        writable: false
        confirmAccess: true
  prod: # alternative "context", activated with "concord-cli run --context prod ..."
    secrets:
      local:
        enabled: false        
      remote:
        enabled: true
        baseUrl: "http://concord.prod.acme.com"
        apiKey: "foobar"

In future, the feature can be extended to support multiple providers of the same type.

@ibodrov ibodrov requested a review from a team May 16, 2025 18:16
@ibodrov ibodrov added the docs label May 16, 2025
@ibodrov ibodrov force-pushed the ib/cli-secrets branch 2 times, most recently from 2d370c7 to 7b00145 Compare May 16, 2025 21:03
Comment on lines 50 to 54
var remote = cliConfig.secrets().remote();
if (remote.enabled()) {
var provider = new RemoteSecretsProvider(workDir, remote.baseUrl(), remote.apiKey());
providers.add(new SecretsProviderRef("remote", provider, remote.writable()));
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a littttle bit concerned this opens a door to a big potential oopsie. One should be very considerate of their handling of secrets from "real" environments to start with, but this could easily end up with a "I got out of a pickle with the CLI pointed at prod real quick on Monday and forgot to turn off remote secrets...Tuesday got interesting 😬"

That could be addressed with an extra setting for the remote config(s), or any config since the same situation is possible--just fewer hoops to jump through (e.g. creating specific secrets locally for secrets.local vs secrets.remote unlocking any available secret in the system). Something like secrets.remote.warnOnAccess: true that gives a prompt/warning that it's about to access a remote secret.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a valid point. I will see if we can add a prompt there.
Or maybe providers should be configured for specific "contexts" and the CLI can require something like `--context prod" to use a non-default context?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benbroadaway how about now -- see the example in the PR description.
Users will need to explicitly say concord run --context myNonDefaultContext.

Copy link
Collaborator Author

@ibodrov ibodrov May 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the confirmation prompt as well

image

@ibodrov ibodrov requested a review from a team May 24, 2025 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants