Skip to content
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

aws auth method: the "ec2" type: Aws AutoAuth nonce is not shared between instances or is persisted across restarts #58

Open
Mic92 opened this issue Jun 1, 2022 · 4 comments

Comments

@Mic92
Copy link

Mic92 commented Jun 1, 2022

  config = {
    detsys.vaultAgent.defaultAgentConfig = {
      auto_auth = {
        method = {
          type = "aws";
          config.role = "some-role";
          config.type = "ec2";
          # Currently one needs to hard-code this value because nonce values are not saved across restarts
          # config.nonce = "42";
        };
      };
    };
  };

Vault returns to vault agent a nonce value for aws instances after they have been authenticated.
If this value is not stored and replayed than vault denies access on the next restart: https://www.vaultproject.io/docs/auth/aws#client-nonce

@grahamc grahamc changed the title Aws AutoAuth nonce is not shared between instances or is persisted across restarts aws auth method: the "ec2" type: Aws AutoAuth nonce is not shared between instances or is persisted across restarts Jun 1, 2022
@grahamc
Copy link
Member

grahamc commented Jun 1, 2022

Good catch. This module doesn't / won't support the ec2 agent auth method. I'd recommend using the "iam" method instead, which is documented as recommended by hashicorp.

@Mic92
Copy link
Author

Mic92 commented Jun 1, 2022

I guess I need to write my own vault integration than to also solve all the other issues.

@grahamc
Copy link
Member

grahamc commented Jun 1, 2022

I would strongly encourage switching to the iam auth method. And, it would be interesting to use LoadCredentials but since this is a thin wrapper around vault agent, it is probably not going to integrate nicely with LoadCredentials without upstream supporting it.

@Mic92
Copy link
Author

Mic92 commented Jun 1, 2022

I don't want to update my vault roles every time I move services between regions, which is required with iam. In my own vault integration I could maybe at least compute the role names dynamically to make this less painful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants