Skip to content

Commit

Permalink
Replication token needs acl write on all ns's
Browse files Browse the repository at this point in the history
If namespaces are enabled, the replication token will need to be able to
replicate all tokens and policies from all namespaces. Without this
functionality, users won't be able to use namespaced
tokens/policies/roles in secondary datacenters (since they won't be
replicated).
  • Loading branch information
lkysow committed Oct 27, 2020
1 parent 1b515f4 commit b25cb0c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion subcommand/server-acl-init/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ func (c *Command) aclReplicationRules() (string, error) {
// datacenters during federation since in order to start ACL replication,
// we need a token with both replication and agent permissions.
aclReplicationRulesTpl := `
acl = "write"
operator = "write"
agent_prefix "" {
policy = "read"
Expand All @@ -233,6 +232,7 @@ node_prefix "" {
{{- if .EnableNamespaces }}
namespace_prefix "" {
{{- end }}
acl = "write"
service_prefix "" {
policy = "read"
intentions = "read"
Expand Down
8 changes: 4 additions & 4 deletions subcommand/server-acl-init/rules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -537,14 +537,14 @@ func TestReplicationTokenRules(t *testing.T) {
{
"Namespaces are disabled",
false,
`acl = "write"
operator = "write"
`operator = "write"
agent_prefix "" {
policy = "read"
}
node_prefix "" {
policy = "write"
}
acl = "write"
service_prefix "" {
policy = "read"
intentions = "read"
Expand All @@ -553,15 +553,15 @@ node_prefix "" {
{
"Namespaces are enabled",
true,
`acl = "write"
operator = "write"
`operator = "write"
agent_prefix "" {
policy = "read"
}
node_prefix "" {
policy = "write"
}
namespace_prefix "" {
acl = "write"
service_prefix "" {
policy = "read"
intentions = "read"
Expand Down

0 comments on commit b25cb0c

Please sign in to comment.