From 694d05555eea0c6d15ca55983a3bbdba9912112d Mon Sep 17 00:00:00 2001 From: Ronald Ekambi Date: Mon, 16 Oct 2023 15:50:54 -0400 Subject: [PATCH] [NET-5327] Templated policies api/cli docs --- website/content/api-docs/acl/auth-methods.mdx | 8 +- .../content/api-docs/acl/binding-rules.mdx | 99 ++++++++- website/content/api-docs/acl/index.mdx | 8 +- website/content/api-docs/acl/policies.mdx | 2 +- website/content/api-docs/acl/roles.mdx | 81 +++++++- .../api-docs/acl/templated-policies.mdx | 189 ++++++++++++++++++ website/content/api-docs/acl/tokens.mdx | 33 ++- website/content/api-docs/agent/check.mdx | 2 +- website/content/api-docs/agent/connect.mdx | 2 +- website/content/api-docs/agent/service.mdx | 2 +- website/content/api-docs/catalog.mdx | 2 +- website/content/api-docs/config.mdx | 2 +- .../content/api-docs/connect/intentions.mdx | 2 +- website/content/api-docs/discovery-chain.mdx | 2 +- website/content/api-docs/health.mdx | 2 +- website/content/api-docs/kv.mdx | 2 +- website/content/api-docs/session.mdx | 2 +- .../commands/acl/templated-policy/index.mdx | 72 +++++++ .../commands/acl/templated-policy/list.mdx | 43 ++++ .../commands/acl/templated-policy/preview.mdx | 130 ++++++++++++ .../commands/acl/templated-policy/read.mdx | 46 +++++ website/content/docs/security/acl/index.mdx | 14 +- .../docs/upgrading/upgrade-specific.mdx | 3 + website/data/api-docs-nav-data.json | 4 + website/data/commands-nav-data.json | 21 ++ 25 files changed, 736 insertions(+), 37 deletions(-) create mode 100644 website/content/api-docs/acl/templated-policies.mdx create mode 100644 website/content/commands/acl/templated-policy/index.mdx create mode 100644 website/content/commands/acl/templated-policy/list.mdx create mode 100644 website/content/commands/acl/templated-policy/preview.mdx create mode 100644 website/content/commands/acl/templated-policy/read.mdx diff --git a/website/content/api-docs/acl/auth-methods.mdx b/website/content/api-docs/acl/auth-methods.mdx index 7b65bf6903..805a9ee93c 100644 --- a/website/content/api-docs/acl/auth-methods.mdx +++ b/website/content/api-docs/acl/auth-methods.mdx @@ -13,8 +13,10 @@ The `/acl/auth-method` endpoints [create](#create-an-auth-method), [list](#list-auth-methods) and [delete](#delete-an-auth-method) ACL auth methods in Consul. -For more information on how to setup ACLs, please check -the [ACL tutorial](/consul/tutorials/security/access-control-setup-production). +For more information on how to setup ACLs, refer to the following resources: + +- [Access control list (ACL) overview](/consul/docs/security/acl) +- [ACL tutorial](/consul/tutorials/security/access-control-setup-production) ## Create an Auth Method @@ -439,7 +441,7 @@ listing and must be retrieved by the [auth method reading endpoint](#read-an-aut ] ``` -## Methods to Specify Namespace +## Methods to specify namespace Auth method create, read, update, and delete endpoints support several methods for specifying the namespace of the auth method resource. diff --git a/website/content/api-docs/acl/binding-rules.mdx b/website/content/api-docs/acl/binding-rules.mdx index 10be5f9d20..9894ce21c7 100644 --- a/website/content/api-docs/acl/binding-rules.mdx +++ b/website/content/api-docs/acl/binding-rules.mdx @@ -13,8 +13,10 @@ The `/acl/binding-rule` endpoints [create](#create-a-binding-rule), [list](#list-binding-rules) and [delete](#delete-a-binding-rule) ACL binding rules in Consul. -For more information on how to setup ACLs, please check -the [ACL tutorial](/consul/tutorials/security/access-control-setup-production). +For more information on how to setup ACLs, refer to the following resources: + +- [Access control list (ACL) overview](/consul/docs/security/acl) +- [ACL tutorial](/consul/tutorials/security/access-control-setup-production) ## Create a Binding Rule @@ -57,9 +59,9 @@ The corresponding CLI command is [`consul acl binding-rule create`](/consul/comm ``` - `BindType` `(string: )` - Specifies the way the binding rule - affects a token created at login. + affects a token created at login. You can specify one of the following: - - `BindType=service` - The computed bind name value is used as an + - `service` - The computed bind name value is used as an `ACLServiceIdentity.ServiceName` field in the token that is created. @@ -78,7 +80,7 @@ The corresponding CLI command is [`consul acl binding-rule create`](/consul/comm - - `BindType=node` - The computed bind name value is used as an + - `node` - The computed bind name value is used as an `ACLNodeIdentity.NodeName` field in the token that is created. @@ -98,7 +100,7 @@ The corresponding CLI command is [`consul acl binding-rule create`](/consul/comm - - `BindType=role` - The computed bind name value is used as a `RoleLink.Name` + - `role` - The computed bind name value is used as a `RoleLink.Name` field in the token that is created. This binding rule will only apply if a role with the given name exists at login-time. If it does not then this rule is ignored. @@ -118,6 +120,29 @@ The corresponding CLI command is [`consul acl binding-rule create`](/consul/comm ``` + + - `templated-policy` - The bind name value is used as an + `ACLTemplatedPolicy.TemplateName` field in the token that is created. The computed + `BindVars` values are used in the `ACLTemplatedPolicy.TemplateVariables` field. + + + + ```json + { + "AccessorID": "", + "SecretID": "", + "TemplatedPolicies": [ + { + "TemplateName": "