Skip to content

Commit

Permalink
Update policies to scope agent access.
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanmorgan committed Jan 23, 2025
1 parent b00c1a8 commit 1ba81be
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions agent/structs/acltemplatedpolicy/policies/ce/nomad-client.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
agent_prefix "" {
agent "{{.Name}}" {
policy = "read"
}
node "{{.Name}}" {
Expand All @@ -9,4 +9,4 @@ service_prefix "" {
}
key_prefix "" {
policy = "read"
}
}
5 changes: 2 additions & 3 deletions agent/structs/acltemplatedpolicy/policies/ce/nomad-server.hcl
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@

acl = "write"
mesh = "write"

agent_prefix "" {
agent "{{.Name}}" {
policy = "read"
}
node "{{.Name}}" {
policy = "write"
}
service_prefix "" {
policy = "write"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"TemplateName": "builtin/nomad-client",
"Schema": "",
"Template": "agent_prefix \"\" {\n policy = \"read\"\n}\nnode \"{{.Name}}\" {\n policy = \"write\"\n}\nservice_prefix \"\" {\n policy = \"write\"\n}\nkey_prefix \"\" {\n policy = \"read\"\n}",
"Template": "agent \"{{.Name}}\" {\n policy = \"read\"\n}\nnode \"{{.Name}}\" {\n policy = \"write\"\n}\nservice_prefix \"\" {\n policy = \"write\"\n}\nkey_prefix \"\" {\n policy = \"read\"\n}\n",
"Description": "Gives the token or role permissions required for integration with a nomad client."
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Input variables:
Example usage:
consul acl token create -templated-policy builtin/nomad-client -var name:node-1
Raw Template:
agent_prefix "" {
agent "{{.Name}}" {
policy = "read"
}
node "{{.Name}}" {
Expand All @@ -17,3 +17,4 @@ service_prefix "" {
key_prefix "" {
policy = "read"
}

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"TemplateName": "builtin/nomad-server",
"Schema": "",
"Template": "\nacl = \"write\"\nmesh = \"write\"\n\nagent_prefix \"\" {\n policy = \"read\"\n}\nnode \"{{.Name}}\" {\n policy = \"write\"\n}\nservice_prefix \"\" {\n policy = \"write\"\n}",
"Template": "acl = \"write\"\nmesh = \"write\"\n\nagent \"{{.Name}}\" {\n policy = \"read\"\n}\nnode \"{{.Name}}\" {\n policy = \"write\"\n}\nservice_prefix \"\" {\n policy = \"write\"\n}\n",
"Description": "Gives the token or role permissions required for integration with a nomad server."
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ Input variables:
Example usage:
consul acl token create -templated-policy builtin/nomad-server -var name:node-1
Raw Template:

acl = "write"
mesh = "write"

agent_prefix "" {
agent "{{.Name}}" {
policy = "read"
}
node "{{.Name}}" {
Expand All @@ -18,3 +17,4 @@ node "{{.Name}}" {
service_prefix "" {
policy = "write"
}

0 comments on commit 1ba81be

Please sign in to comment.