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

Suggest using X-Consul-Token for ACL tokens #160

Merged
merged 1 commit into from
Dec 19, 2018

Conversation

sixfeetover
Copy link
Contributor

This PR is just a suggested README change, but it fixes two issues concerning ACL tokens. The Consul documentation says:

When authentication is enabled, a Consul token should be provided to API requests using the X-Consul-Token header. This reduces the probability of the token accidentally getting logged or exposed. [...] Previously this was provided via a ?token= query parameter. This functionality exists on many endpoints for backwards compatibility, but its use is highly discouraged, since it can show up in access logs as part of the URL.

The config.acl_token setting in Diplomat sets the token query string parameter rather than the header. Additionally, it does not set it for all API endpoints (e.g., Sessions), so some functionality simply does work when using config.acl_token. Setting the header instead fixes both issues.

Concerning ACL tokens, the Consul documentation (https://www.consul.io/api/index.html#authentication) says:

> Previously this was provided via a ?token= query parameter. This functionality exists on many endpoints for backwards compatibility, but its use is highly discouraged, since it can show up in access logs as part of the URL.

The `config.acl_token` setting in Diplomat sets the `token` query string parameter rather than the header. Additionally, it does not set it for all API endpoints (e.g., Services). Setting the header instead fixes both issues.
@pierresouchay pierresouchay merged commit 9acebcb into WeAreFarmGeek:master Dec 19, 2018
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.

2 participants