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

acl: bootstrap master token from config file #7935

Closed
wants to merge 1 commit into from

Conversation

skarrok
Copy link

@skarrok skarrok commented May 12, 2020

Fixes #7777
Add support for acl master_token like in Consul

@hashicorp-cla
Copy link

hashicorp-cla commented May 12, 2020

CLA assistant check
All committers have signed the CLA.

@skarrok skarrok force-pushed the acl-master-token branch 4 times, most recently from 35ef359 to 9216d1e Compare May 12, 2020 17:07
@skarrok skarrok marked this pull request as ready for review May 12, 2020 19:41
Copy link
Member

@schmichael schmichael left a comment

Choose a reason for hiding this comment

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

Thanks for the excellent PR @skarrok! From a code perspective it looks right on.

However, while we know our existing management token bootstrapping method makes automating cluster setup difficult, we're unsure about hardcoding a management token like Consul allows. A one-time (or limited-time) use token might ease bootstrapping while greatly diminish the attack surface of a master token ended in a config file.

I'm going to mark this as 🤔 for now. I don't want to close it outright as we may decide the risk is worth it since the bootstrapping is such a pain.

}
if token == nil {
token = &structs.ACLToken{
AccessorID: uuid.Generate(),
Copy link
Member

Choose a reason for hiding this comment

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

Would it be useful to allow the AccessorID to be specified in the HCL as well? Consul doesn't for their master_token, but they do allow it for subsequent tokens created via their API in order to ease automation.

@skarrok
Copy link
Author

skarrok commented Jun 30, 2020

Thank you for your review!

Yes, current process is not ideal. We even choose to not use acl in nomad in favor of fully automated idempotent bootstrapping.

I'm sure strong arguments for and against have been made already when this feature landed in consul, so I'm gonna wait for decision.

@apollo13
Copy link
Contributor

@schmichael Hi, I have been thinking about your comment and about what would be an easier approach for automation without hard-coding the token in the config file. I only suggested that in #7777 because consul already does it and I like consistency.

What do you think about altering the /acl/bootstrap endpoint (or maybe even introduce a new one) to allow the enduser to submit a token pair to it (AccessorID & SecretID) which will be used as the initial management token? This way you can safely store the token pair in a system suitable for your automation (for example an ansible vault) but you would not leak it onto the machines.

Base automatically changed from master to main March 8, 2021 19:25
@tgross
Copy link
Member

tgross commented May 12, 2022

@schmichael what do you think of closing this PR in lieu of the work that @lhaig is doing in #12520? I think that's closer to the suggestion you and @apollo13 had here.

@schmichael
Copy link
Member

Sounds good to me Tim and @apollo13 gave a 👍 ! Closing this in favor of #12520.

@schmichael schmichael closed this May 18, 2022
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for initial_management token like in Consul
5 participants