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

Allow configuration of nonce for ec2 authentication #6953

Merged
merged 2 commits into from
Jun 27, 2019

Conversation

amdonov
Copy link
Contributor

@amdonov amdonov commented Jun 21, 2019

I'd like to be able to specify a nonce in the agent configuration file. Without this option, the agent cannot reauthenticate when the service/server restarts. I realize that I could allow reauthentication without the nonce, but that raises security concerns. Any user on the box on then authenticate as the server. Preventing this is my main reason for using ec2 authentication rather than IAM. By limiting access to the agent configuration file, I can limit access to root.

@hashicorp-cla
Copy link

hashicorp-cla commented Jun 21, 2019

CLA assistant check
All committers have signed the CLA.

@joelthompson
Copy link
Contributor

FWIW, you can also use iptables rules to restrict access to the EC2 instance metadata service to just root as well so that only root can access the credentials and authenticate with the IAM auth method.

@jefferai
Copy link
Member

What Joel said -- I think having this functionality is fine, but you're still better off using iptables and IAM, which regularly rotates credentials, than EC2, which almost never rotates credentials and where you have to deal with whitelists and so on.

@@ -155,6 +155,14 @@ func NewAWSAuthMethod(conf *auth.AuthConfig) (auth.AuthMethod, error) {
a.lastCreds = creds

go a.pollForCreds(accessKey, secretKey, sessionToken, credentialPollIntervalSec)
} else {
Copy link
Member

Choose a reason for hiding this comment

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

Even though it's not relevant for IAM I think this should still go up with the other config blocks instead of in an else block here.

@amdonov
Copy link
Contributor Author

amdonov commented Jun 22, 2019 via email

@jefferai
Copy link
Member

@amdonov As I said, not opposed to this feature, but please address the review comment.

@jefferai jefferai added this to the 1.2 milestone Jun 27, 2019
@jefferai
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

4 participants