Skip to content

add support for deregistering services with acl token - #28

Closed
bpgray wants to merge 2 commits into
Ecwid:masterfrom
bpgray:master
Closed

bpgray wants to merge 2 commits into
Ecwid:masterfrom
bpgray:master

Conversation

@bpgray

@bpgray bpgray commented Sep 4, 2015

Copy link
Copy Markdown

Fix against:
#27

@vgv

vgv commented Sep 5, 2015

Copy link
Copy Markdown
Member

Are you sure that consul supports tokens in deregister operation?
I've read docs (https://www.consul.io/docs/agent/http/agent.html#agent_service_register) and see that only "register" endpoints support tokens.

@bpgray

bpgray commented Sep 6, 2015

Copy link
Copy Markdown
Author

good catch @vgv

I did some research and testing, and the short answer is that we don't need acl tokens to deregister a service, as consul doesn't check ACLs when executing the deregister endpoint. So I think it's safe to reject/close this pull request.

Long answer:

  1. Not requiring a token to deregister a service is a minor security hole for consul, and Armon at HashiCorp notes they hope to expand the ACL system in 0.6. https://groups.google.com/forum/#!topic/consul-tool/1qYrZukdyB8
  2. The security hole isn't that big, because you can only deregister a service from the agent that registered the service.
  3. Passing the token to the deregister endpoint won't cause any problems (tested this), it just won't be used by the endpoint.

@bpgray

bpgray commented Sep 8, 2015

Copy link
Copy Markdown
Author

Deregistration works fine without an ACL token in 0.5.2. Will reopen an issue/PR if this changes with the next version of consul.

@bpgray bpgray closed this Sep 8, 2015
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