dm-drogeriemarkt / foreman_vault

Foreman integration with Vault
GNU General Public License v3.0
18 stars 10 forks source link

Race condition in rake task when host gets deleted #46

Closed laugmanuel closed 3 years ago

laugmanuel commented 3 years ago

There is a race condition in the rake task whenever a host gets deleted during the run.

This happens if the host is part of the host list (https://github.com/dm-drogeriemarkt/foreman_vault/blob/master/lib/tasks/foreman_vault_tasks.rake#L11) but gets deleted from Foreman before the deploy of the auth method happens (https://github.com/dm-drogeriemarkt/foreman_vault/blob/master/lib/tasks/foreman_vault_tasks.rake#L14)

This results in allowed_common_names being empty which might break other hosts in Vault (because this essentially matches all hosts using that cert auth backend)