-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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 is partially bypassed: Clients without anonymous token can join the cluster and read members in the cluster #21929
Comments
|
@ruatag, hello! Another note: in both cases (with or without gossip encryption) the command |
Can't reproduce your problem with 1.20.1 and also tried 1.19.1 Probably a policy/role is associated with anonymous token |
Thank you for the feedback! Just to be sure: you did not enable gossip encryption or anything extra, correct? The policies that I have
and here are the rules for the anonymous policy $ consul acl policy read -id 00000000-0000-0000-0000-000000000002
ID: 00000000-0000-0000-0000-000000000002
Name: builtin/global-read-only
Description: A built-in policy that grants read-only access to all Consul features
Datacenters:
Rules:
acl = "read"
agent_prefix "" {
policy = "read"
}
event_prefix "" {
policy = "read"
}
identity_prefix "" {
policy = "read"
intentions = "read"
}
key_prefix "" {
policy = "read"
}
keyring = "read"
node_prefix "" {
policy = "read"
}
operator = "read"
mesh = "read"
peering = "read"
query_prefix "" {
policy = "read"
}
service_prefix "" {
policy = "read"
intentions = "read"
}
session_prefix "" {
policy = "read"
} |
Gossip encryption key gives different error |
This is the output of the command $ consul acl token read -id=00000000-0000-0000-0000-000000000002
Use the -accessor-id parameter to specify token by Accessor ID
AccessorID: 00000000-0000-0000-0000-000000000002
SecretID: anonymous
Description: Anonymous Token
Local: false
Create Time: 2024-11-06 11:34:55.264928289 +0300 MSK
No policies associated with the token? |
@ruatag, good morning, sir! |
Overview of the Issue
Hello, sirs!
I have been trying to configure a Consul Cluster with ACL deny policy, but I noticed some weird behaviour: anonymous clients with anonymous token (which is set by default) were able to
join
and viewmembers
of the cluster.P.S. I have also read this similar archived issue and tried the workaround: I enabled the gossip encryption and indeed I was not able to join without setting
encrypt: XXXXX
in the client's config (see error below)After having set
encrypt: XXXXX
on the client side, I was able to join and check cluster memberswith anonymous tokenagain.NOTE: the following reproduction steps did not include gossip encrpyption
Reproduction Steps
consul acl bootstrap
and set the bootstrap token as agent tokenconsul join
join
andmembers
on the client side will succeed)NOTE: in the client log there are constant errors about
token lacks permission
, which is reasonable since client uses anonymous tokenI tried to register a service from the client agent (with anonymous token) and I got the error
token lacks permission service:write
(which is what I expected). Seeservice.json
So, as far as I see, there are only two commands
consul join
andconsul members
that work on the client agent with anonymous token - other commands would require the agent token for the client. It is strange since I cannot list members with anonymous token on the server side, for example.Consul info for both Client and Server
Client info
Client agent HCL config
Server info
Server agent HCL config
Operating system and Environment details
Consul version: 1.19.2
Ubuntu 22.04 LTS both for the client and server
Log Fragments
Client side logs after joining the server
Client side logs after trying to register a service from the client
The text was updated successfully, but these errors were encountered: