Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup central key management #484

Merged
merged 6 commits into from
Aug 28, 2024
Merged

Backup central key management #484

merged 6 commits into from
Aug 28, 2024

Conversation

ewdurbin
Copy link
Member

@ewdurbin ewdurbin commented Aug 28, 2024

Description

Alternative to #476.

This moves SSH key management to be the responsibility of a pillar extension, which are ultimately stored on the salt master host, can be regenerated/rotated by just deleting the files on disk. Also consolidates all backup configuration into a single file, which is nice!

Major disadvantage of this relative to #476 is that it does not ensure private keys are generated and resident to the backup client host.

@ewdurbin
Copy link
Member Author

ewdurbin commented Aug 28, 2024

Demonstration of key management:

On backup host:

root@backup-server:~# salt-call pillar.get backup_keys
local:
    ----------
    downloads:
        ----------
        private:
            None
        public:
            ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJdCRhg1G7zrOA8yDo9EdO/hbCCimcBbktvobyZpoiTV downloads@backup
    python-docs:
        ----------
        private:
            None
        public:
            ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPwei2CunIkeyqZNOZ9mKuX0pdqKA5JjGVj76ZDBO0Wd python-docs@backup

On downloads host:

root@downloads:~# salt-call pillar.get backup_keys
local:
    ----------
    downloads:
        ----------
        private:
            -----BEGIN OPENSSH PRIVATE KEY-----
            b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
            ...snipped even though this is just a dev environment...
            bCCimcBbktvobyZpoiTVAAAAEGRvd25sb2Fkc0BiYWNrdXABAgMEBQ==
            -----END OPENSSH PRIVATE KEY-----
        public:
            ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJdCRhg1G7zrOA8yDo9EdO/hbCCimcBbktvobyZpoiTV downloads@backup

On docs host:

root@docs:~# salt-call pillar.get backup_keys
local:
    ----------
    python-docs:
        ----------
        private:
            -----BEGIN OPENSSH PRIVATE KEY-----
            b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
            ...snipped even though this is just a dev environment...
            pdqKA5JjGVj76ZDBO0WdAAAAEnB5dGhvbi1kb2NzQGJhY2t1cAECAw==
            -----END OPENSSH PRIVATE KEY-----
        public:
            ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPwei2CunIkeyqZNOZ9mKuX0pdqKA5JjGVj76ZDBO0Wd python-docs@backup

On a host with no backup configuration (salt-master):

root@salt-master:~# salt-call pillar.get backup_keys
local:
    ----------

@ewdurbin ewdurbin force-pushed the backup_central_key_management branch from 429bae3 to d984477 Compare August 28, 2024 18:32
salt/_extensions/pillar/backup_ssh.py Outdated Show resolved Hide resolved
@ewdurbin ewdurbin merged commit ce94e24 into main Aug 28, 2024
2 checks passed
@ewdurbin ewdurbin deleted the backup_central_key_management branch August 28, 2024 19:23
Copy link
Contributor

Don't forget to pull the latest changes on salt.nyc1.psf.io!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants