Page MenuHomeDevCentral

Deploy or rotate Vault secrets
ClosedPublic

Authored by dereckson on Mon, Mar 23, 00:32.
Tags
None
Referenced Files
F25461460: D4026.id10568.diff
Tue, Apr 14, 13:25
F25456662: D4026.id10535.diff
Tue, Apr 14, 09:16
F25456649: D4026.id10568.diff
Tue, Apr 14, 09:15
Unknown Object (File)
Sun, Apr 12, 21:27
Unknown Object (File)
Sun, Apr 12, 06:40
Unknown Object (File)
Sun, Apr 12, 00:50
Unknown Object (File)
Sat, Apr 11, 07:19
Unknown Object (File)
Thu, Apr 9, 22:39
Subscribers
None

Details

Summary

Terraform/OpenTofu is handling both the policies and the credentials to allow
other applications to connect themselves to Vault.

Once the AppRole have been created or updated in Vault by Terraform/OpenTofu,
the relevant configuration files with AppRole credentials must be provisioned.

This make deploy-secrets target allows to automate each steps and do a full
secrets rotation.

Reference: https://agora.nasqueron.org/Operations_grimoire/Deploy_with_Terraform

Diff Detail

Repository
rOPS Nasqueron Operations
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dereckson created this revision.
dereckson retitled this revision from Once the AppRole have been created or updated in Vault by Terraform/OpenTofu, the relevant configuration files with AppRole credentials must be provisioned. to Deploy or rotate Vault secrets.Mon, Mar 23, 08:44
dereckson edited the summary of this revision. (Show Details)

Note: we're deploying a third secret for CARP routers scripts. If we've already that code merged, we'll need to append a line to deploy that state too.

Note: we're deploying a third secret for CARP routers scripts. If we've already that code merged, we'll need to append a line to deploy that state too.

How to target router-002 and router-003 through grains
-G, --grain
The target expression matches values returned by the Salt grains system on the minions. The target expression is in the format of '<grain value>:<glob expression>'; example: 'os:Arch*'

This was changed in version 0.9.8 to accept glob expressions instead of regular expression. To use regular expression matching with grains, use the --grain-pcre option.

--grain-pcre
The target expression matches values returned by the Salt grains system on the minions. The target expression is in the format of '<grain value>:< regular expression>'; example: 'os:Arch.*'
This revision is now accepted and ready to land.Wed, Mar 25, 13:26

Enable rotation of Vault AppRole credentials on CARP routers

Makefile
65

I wonder if we don't need wildcards as it's a list, if a router has several roles, for example router + bastion is a combo we considered several times.

[yousra@complector /opt/salt/nasqueron-operations]$ salt web-001 grains.get roles
web-001:
    - webserver-alkane
    - webserver-alkane
    - webserver-alkane-prod
    - saas-mediawiki
    - saas-wordpress

[yousra@complector /opt/salt/nasqueron-operations]$ salt -G 'roles:saas-wordpress' test.ping
web-001:
    True

I tested the targeting with a minion having multiple roles (list), and roles:<value> correctly matches entries inside the list. So roles:router should work even if the minion has additional roles.

This revision was automatically updated to reflect the committed changes.