-
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
Update templated nomad policies #21872
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
agent_prefix "" { | ||
agent "{{.Name}}" { | ||
policy = "read" | ||
} | ||
node_prefix "" { | ||
policy = "read" | ||
node "{{.Name}}" { | ||
policy = "write" | ||
} | ||
service_prefix "" { | ||
policy = "write" | ||
} | ||
key_prefix "" { | ||
policy = "read" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
acl = "write" | ||
mesh = "write" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do Nomad servers need the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. from https://developer.hashicorp.com/nomad/docs/integrations/consul/acl#nomad-agents
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. linking in Nomad#20159. |
||
|
||
acl = "write" | ||
agent_prefix "" { | ||
agent "{{.Name}}" { | ||
policy = "read" | ||
} | ||
node_prefix "" { | ||
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_prefix \"\" {\n policy = \"read\"\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 |
---|---|---|
@@ -1,18 +1,20 @@ | ||
Name: builtin/nomad-client | ||
Description: Gives the token or role permissions required for integration with a nomad client. | ||
Input variables: None | ||
Input variables: | ||
Name: String - Required - The node name. | ||
Example usage: | ||
consul acl token create -templated-policy builtin/nomad-client | ||
consul acl token create -templated-policy builtin/nomad-client -var name:node-1 | ||
Raw Template: | ||
agent_prefix "" { | ||
agent "{{.Name}}" { | ||
policy = "read" | ||
} | ||
node_prefix "" { | ||
policy = "read" | ||
node "{{.Name}}" { | ||
policy = "write" | ||
} | ||
service_prefix "" { | ||
policy = "write" | ||
} | ||
key_prefix "" { | ||
policy = "read" | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
Name: builtin/nomad-client | ||
Description: Gives the token or role permissions required for integration with a nomad client. | ||
Input variables: None | ||
Input variables: | ||
Name: String - Required - The node name. | ||
Example usage: | ||
consul acl token create -templated-policy builtin/nomad-client | ||
consul acl token create -templated-policy builtin/nomad-client -var name:node-1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"TemplateName": "builtin/nomad-server", | ||
"Schema": "", | ||
"Template": "\nacl = \"write\"\nagent_prefix \"\" {\n policy = \"read\"\n}\nnode_prefix \"\" {\n policy = \"read\"\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 |
---|---|---|
@@ -1,17 +1,20 @@ | ||
Name: builtin/nomad-server | ||
Description: Gives the token or role permissions required for integration with a nomad server. | ||
Input variables: None | ||
Input variables: | ||
Name: String - Required - The node name. | ||
Example usage: | ||
consul acl token create -templated-policy builtin/nomad-server | ||
consul acl token create -templated-policy builtin/nomad-server -var name:node-1 | ||
Raw Template: | ||
acl = "write" | ||
mesh = "write" | ||
|
||
acl = "write" | ||
agent_prefix "" { | ||
agent "{{.Name}}" { | ||
policy = "read" | ||
} | ||
node_prefix "" { | ||
policy = "read" | ||
node "{{.Name}}" { | ||
policy = "write" | ||
} | ||
service_prefix "" { | ||
policy = "write" | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
Name: builtin/nomad-server | ||
Description: Gives the token or role permissions required for integration with a nomad server. | ||
Input variables: None | ||
Input variables: | ||
Name: String - Required - The node name. | ||
Example usage: | ||
consul acl token create -templated-policy builtin/nomad-server | ||
consul acl token create -templated-policy builtin/nomad-server -var name:node-1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tristanmorgan Does Nomad register nodes into Consul? I thought it only registered services to existing Consul nodes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is from:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
References from the pr minimal Consul policy for Nomad agents needs node:write
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated policy to limit changes to the named node.