Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
blog.limos.fr
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vincent MAZENOD
blog.limos.fr
Commits
4756b3de
Commit
4756b3de
authored
6 years ago
by
Vincent Mazenod
Browse files
Options
Downloads
Patches
Plain Diff
enhance vault
parent
72650d8e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#3995
passed
6 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
content/slides/cri/md/vault.md
+25
-10
25 additions, 10 deletions
content/slides/cri/md/vault.md
with
25 additions
and
10 deletions
content/slides/cri/md/vault.md
+
25
−
10
View file @
4756b3de
...
...
@@ -130,7 +130,7 @@ vault secrets enable -path=cri kv
vault kv enable-versioning cri/
# kv2
```
*
les secrets sont versionés
*
les secrets sont version
n
és
*
il est possible d'utiliser PATCH et pas seulement PUT
```
shell
...
...
@@ -166,7 +166,7 @@ $ vault login -method=ldap username=vimazeno
```
*
par ldap
*
en réalité génère un toke
n dans ~/.vault-token
contenant
*
stocke le token d'authentificayio
n dans ~/.vault-token
## LDAP
...
...
@@ -223,13 +223,13 @@ $ vault write auth/ldap/groups/cri policies=cri
## Utilisation
*
[
binaire à télécharger
](
https://releases.hashicorp.com/vault/
)
*
cross plateform
*
deux variables d'environnement
*
$VAULT_ADDR=https://vault.isima.fr
*
$VAULT_
TOKEN ou authentification ldap
ou
*
l'
[
<i class="fa fa-book" aria-hidden="true"></i> api
](
https://www.vaultproject.io/api/overview
)
*
via la ligne de commande
*
[
binaire à télécharger
](
https://releases.hashicorp.com/vault/
)
*
cross plateform
*
deux variables d'environnement
*
$VAULT_
ADDR=https://vault.isima.fr
*
$VAULT_TOKEN ou authentification ldap
*
via
l'
[
<i class="fa fa-book" aria-hidden="true"></i> api
](
https://www.vaultproject.io/api/overview
)
## Workflow
...
...
@@ -307,7 +307,7 @@ fi
KV
=
$(
vault
read
cri/my
-format
=
json | python
-c
"import sys, json; print json.load(sys.stdin)['data'].keys()"
)
# converison de la liste python en liste bash
VAULT_KEYS
=(
$(
echo
${
KV
}
|
sed
-r
"s/', u'/' '/g"
|
sed
-r
"s/
\[
u'/'/g"
|
sed
-r
"s/
\]
//g"
)
)
# copie du
t
templat
y
e de configuration en fichier de configuration
# copie du template de configuration en fichier de configuration
cp
config.sample.py config.py
# itération sur les clés vault
for
i
in
"
${
VAULT_KEYS
[@]
}
"
...
...
@@ -320,3 +320,18 @@ do
done
```
<!-- .element style="width: 100%;" -->
## avec ansible
*
lookup natif
[
hashi_vault
](
https://docs.ansible.com/ansible/latest/plugins/lookup/hashi_vault.html
)
*
lecture uniquement
*
pas de support natif pour kv2 à ce jour
*
[
patch maison
](
https://gitlab.isima.fr/cri/stack/blob/master/ansible/plugins/module_utils/vault.py
)
*
module "community"
[
hashivault
](
https://github.com/TerryHowe/ansible-modules-hashivault
)
*
Reading and Writing
*
supporte kv2
*
Initialization, Seal, and Unseal
*
Policy
*
User Management
*
...
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment