Merge "Wrong Vault policy path. (Master, dsr8)--(DO NOT MERGE)"
This commit is contained in:
commit
87b8447c3d
@ -99,7 +99,7 @@ You can configure Vault by logging into a Vault server pod and using Vault CLI.
|
||||
.. code-block:: none
|
||||
|
||||
$ vault policy write basic-secret-policy - <<EOF
|
||||
path "secret/basic-secret/*" {
|
||||
path "secret/data/basic-secret/*" {
|
||||
capabilities = ["read"]
|
||||
}
|
||||
EOF
|
||||
@ -201,3 +201,4 @@ You can configure Vault by logging into a Vault server pod and using Vault CLI.
|
||||
For more information, see, |usertasks-doc|::ref:`Vault Overview
|
||||
<kubernetes-user-tutorials-vault-overview>`.
|
||||
|
||||
|
||||
|
@ -79,7 +79,7 @@ The following steps use Vault's REST API and is run from controller-0.
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
$ curl --cacert /home/sysadmin/vault_ca.pem --header "X-Vault-Token:$ROOT_TOKEN" --request POST --data '{"type": "kv","version":"2"}' https://sva-vault.vault.svc.cluster.local:8200/v1/sys/mounts/secret
|
||||
$ curl --cacert /home/sysadmin/vault_ca.pem --header "X-Vault-Token:$ROOT_TOKEN" --request POST --data '{"type": "kv","options":{"version":"2"}}' https://sva-vault.vault.svc.cluster.local:8200/v1/sys/mounts/secret
|
||||
|
||||
For more information, see:
|
||||
|
||||
@ -100,7 +100,7 @@ The following steps use Vault's REST API and is run from controller-0.
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
$ curl --cacert /home/sysadmin/vault_ca.pem --header "X-Vault-Token:$ROOT_TOKEN" -H "Content-Type: application/json" --request PUT -d '{"policy":"path \"secret/basic-secret/*\" {capabilities = [\"read\"]}"}' https://sva-vault.vault.svc.cluster.local:8200/v1/sys/policy/basic-secret-policy
|
||||
$ curl --cacert /home/sysadmin/vault_ca.pem --header "X-Vault-Token:$ROOT_TOKEN" -H "Content-Type: application/json" --request PUT -d '{"policy":"path \"secret/data/basic-secret/*\" {capabilities = [\"read\"]}"}' https://sva-vault.vault.svc.cluster.local:8200/v1/sys/policy/basic-secret-policy
|
||||
|
||||
For more information, see, `https://www.vaultproject.io/docs/concepts/policies <https://www.vaultproject.io/docs/concepts/policies>`__.
|
||||
|
||||
@ -133,13 +133,13 @@ The following steps use Vault's REST API and is run from controller-0.
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
$ curl --cacert /home/sysadmin/vault_ca.pem --header "X-Vault-Token:$ROOT_TOKEN" -H "Content-Type: application/json" -X POST -d '{"username":"pvtest","password":"<password>"}' https://sva-vault.vault.svc.cluster.local:8200/v1/secret/basic-secret/helloworld
|
||||
$ curl --cacert /home/sysadmin/vault_ca.pem --header "X-Vault-Token:$ROOT_TOKEN" -H "Content-Type: application/json" -X POST -d '{"username":"pvtest","password":"<password>"}' https://sva-vault.vault.svc.cluster.local:8200/v1/secret/data/basic-secret/helloworld
|
||||
|
||||
#. Verify the secret.
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
$ curl --cacert /home/sysadmin/vault_ca.pem --header "X-Vault-Token:$ROOT_TOKEN" https://sva-vault.vault.svc.cluster.local:8200/v1/secret/basic-secret/helloworld
|
||||
$ curl --cacert /home/sysadmin/vault_ca.pem --header "X-Vault-Token:$ROOT_TOKEN" https://sva-vault.vault.svc.cluster.local:8200/v1/secret/data/basic-secret/helloworld
|
||||
|
||||
|
||||
#. (Optional) To enable and configure logging, use the steps below:
|
||||
|
@ -46,7 +46,7 @@ pod can access these secrets as files.
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
$ curl --cacert /home/sysadmin/vault_ca.pem --header "X-Vault-Token:$ROOT_TOKEN" -H "Content-Type: application/json" --request PUT -d '{"policy":"path \"secret/basic-secret/*\" {capabilities = [\"read\"]}"}' https://sva-vault.vault.svc.cluster.local:8200/v1/sys/policy/basic-secret-policy
|
||||
$ curl --cacert /home/sysadmin/vault_ca.pem --header "X-Vault-Token:$ROOT_TOKEN" -H "Content-Type: application/json" --request PUT -d '{"policy":"path \"secret/data/basic-secret/*\" {capabilities = [\"read\"]}"}' https://sva-vault.vault.svc.cluster.local:8200/v1/sys/policy/basic-secret-policy
|
||||
|
||||
#. Create the role with policy and namespace.
|
||||
|
||||
@ -58,13 +58,13 @@ pod can access these secrets as files.
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
$ curl --cacert /home/sysadmin/vault_ca.pem --header "X-Vault-Token:$ROOT_TOKEN" -H "Content-Type: application/json" -X POST -d '{"username":"pvtest","password":"Li69nux*"}' https://sva-vault.vault.svc.cluster.local:8200/v1/secret/basic-secret/helloworld
|
||||
$ curl --cacert /home/sysadmin/vault_ca.pem --header "X-Vault-Token:$ROOT_TOKEN" -H "Content-Type: application/json" -X POST -d '{"username":"pvtest","password":"Li69nux*"}' https://sva-vault.vault.svc.cluster.local:8200/v1/secret/data/basic-secret/helloworld
|
||||
|
||||
#. Verify the secret.
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
$ curl --cacert /home/sysadmin/vault_ca.pem --header "X-Vault-Token:$ROOT_TOKEN" https://sva-vault.vault.svc.cluster.local:8200/v1/secret/basic-secret/helloworld
|
||||
$ curl --cacert /home/sysadmin/vault_ca.pem --header "X-Vault-Token:$ROOT_TOKEN" https://sva-vault.vault.svc.cluster.local:8200/v1/secret/data/basic-secret/helloworld
|
||||
|
||||
.. rubric:: |proc|
|
||||
|
||||
@ -103,12 +103,12 @@ pod can access these secrets as files.
|
||||
annotations:
|
||||
vault.hashicorp.com/agent-inject: "true"
|
||||
vault.hashicorp.com/tls-skip-verify: "true"
|
||||
vault.hashicorp.com/agent-inject-secret-helloworld: "secret/basic-secret/helloworld"
|
||||
vault.hashicorp.com/agent-inject-secret-helloworld: "secret/data/basic-secret/helloworld"
|
||||
vault.hashicorp.com/agent-inject-template-helloworld: |
|
||||
{{- with secret "secret/basic-secret/helloworld" -}}
|
||||
{{- with secret "secret/data/basic-secret/helloworld" -}}
|
||||
{
|
||||
"username" : "{{ .Data.username }}",
|
||||
"password" : "{{ .Data.password }}"
|
||||
"username" : "{{ .Data.data.username }}",
|
||||
"password" : "{{ .Data.data.password }}"
|
||||
}
|
||||
{{- end }}
|
||||
vault.hashicorp.com/role: "basic-secret-role"
|
||||
|
Loading…
x
Reference in New Issue
Block a user