acl
Command: consul acl
The acl command is used to interact with Consul’s ACLs via the command line. It exposes top-level commands for bootstrapping the ACL system, managing tokens and policies, translating legacy rules, and setting the tokens for use by an agent.
ACLs are also accessible via the HTTP API.
Bootstrap Consul’s ACLs:
$ consul acl bootstrapAccessorID: 4d123dff-f460-73c3-02c4-8dd64d136e01SecretID: 86cddfb9-2760-d947-358d-a2811156bf31Description: Bootstrap Token (Global Management)Local: falseCreate Time: 2018-10-22 11:27:04.479026 -0400 EDTPolicies:00000000-0000-0000-0000-000000000001 - global-management
Create a policy:
$ consul acl policy create -name "acl-replication" -description "Token capable of replicating ACL policies" -rules 'acl = "read"'ID: 35b8ecb0-707c-ee18-2002-81b238b54b38Name: acl-replicationDescription: Token capable of replicating ACL policiesDatacenters:Rules:acl = "read"
Create a token:
$ consul acl token create -description "Agent Policy Replication - my-agent" -policy-name "acl-replication"AccessorID: c24c11aa-4e08-e25c-1a67-705a2e8d75a4SecretID: e7024f9c-f016-02dd-6217-daedbffb86acDescription: Agent Policy Replication - my-agentLocal: falseCreate Time: 2018-10-22 11:34:49.960482 -0400 EDTPolicies:35b8ecb0-707c-ee18-2002-81b238b54b38 - acl-replication
For more examples, ask for subcommand help or view the subcommand documentation by clicking on one of the links in the sidebar.
»Usage
Usage: consul acl <subcommand>
For the exact documentation for your Consul version, run consul acl -h to view the complete list of subcommands.
Usage: consul acl <subcommand> [options] [args]This command has subcommands for interacting with Consul's ACLs.Here are some simple examples, and more detailed examples are availablein the subcommands or the documentation.Bootstrap ACLs:$ consul acl bootstrapList all ACL Tokens:$ consul acl token listCreate a new ACL Policy:$ consul acl policy create "new-policy" \-description "This is an example policy" \-datacenter "dc1" \-datacenter "dc2" \-rules @rules.hclSet the default agent token:$ consul acl set-agent-token default 0bc6bc46-f25e-4262-b2d9-ffbe1d96be6fFor more examples, ask for subcommand help or view the documentation.Subcommands:bootstrap Bootstrap Consul's ACL systempolicy Manage Consul's ACL Policiesset-agent-token Interact with the Consul's ACLstoken Manage Consul's ACL Tokenstranslate-rules Translate the legacy rule syntax into the current syntax
For more information, examples, and usage about a subcommand, click on the name of the subcommand in the sidebar or one of the links below:
