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

Share masterkey between EESSI repos and make config package for the entire domain #59

Closed
bedroge opened this issue Dec 8, 2020 · 6 comments
Assignees
Labels
configuration Improvements or additions to the configuration security Security-related issues

Comments

@bedroge
Copy link
Collaborator

bedroge commented Dec 8, 2020

During the monthly CVMFS coordination meeting it was mentioned that you can make a client package (without using a cvmfs-config repo) that still allows you to easily add more repos, as long as they are under the same domain and share the masterkey.
The documentation (see https://cvmfs.readthedocs.io/en/stable/cpt-repo.html#master-keys) also says something about this:

Each cvmfs repository uses two sets of keys, one for the individual repository and another called
the “masterkey” which signs the repository key. The pub key that corresponds to the masterkey
is what needs to be distributed to clients to verify the authenticity of the repository.
It is usually most convenient to share the masterkey between all repositories in a domain
so new repositories can be added without updating the client configurations.

We should change this for our repos, as they now have their own masterkeys.

@bedroge
Copy link
Collaborator Author

bedroge commented Dec 9, 2020

Related to this, it's recommended to use a yubikey:

That's right, you can actually remove the private master key from the individual publishers
the .cvmfswhitelist file can be signed indepedently on a dedicated signing node and then copied back to the repositories
I'd recommend to use the cvmfs yubikey integration for the signing node

@rptaylor
Copy link

rptaylor commented Jan 5, 2021

From our documentation:

Generally speaking, all repositories that are hosted on the same stratum 0 server, used for a similar purpose (e.g. user-facing production repos), and use the same domain name should use the same .pub file and corresponding .masterkey file. However, the .crt and .key files should be unique. See this documentation: http://cvmfs.readthedocs.io/en/stable/cpt-repo.html#master-keys

To create a new repository which shares the key of an existing repository:
Use the cvmfs_server mkfs command from the Ansible role to create new.computecanada.ca 

sudo cp /etc/cvmfs/keys/existing.computecanada.ca.masterkey /etc/cvmfs/keys/new.computecanada.ca.masterkey
sudo cp /etc/cvmfs/keys/existing.computecanada.ca.pub /etc/cvmfs/keys/new.computecanada.ca.pub
sudo cvmfs_server resign new.computecanada.ca

@rptaylor
Copy link

rptaylor commented Jan 5, 2021

"new repositories can be added without updating the client configurations"
That was probably written before the advent of config repos. The same thing can now be achieved using config repos, but sharing keys still makes sense for some situations.

Nowadays you only need to distribute a single pub key in a config package, for the config repo. Then the config repo can distribute the pub keys for all other repos. Part of the reason for a config repo is to be able to blacklist and rotate signing keys without causing an interruption in repo access, so the config repo and other repos should use different keys.

@bedroge
Copy link
Collaborator Author

bedroge commented Jan 6, 2021

Thanks for the clarification, @rptaylor. We do already have a config package, but only one actual repo (pilot) at the moment; I opened the issue to make sure that we re-use the key for new/future repos, especially for cases where sites cannot use the config package (because they already use another one). I also wanted to use that same masterkey for the config repo, but apparently that's not a good idea, good to know.

So, sites can then either use the config package/repo, or manually configure the actual repos by installing the pub key for those repos (+ config files). I guess we could even make another config package for the latter case?

@rptaylor
Copy link

rptaylor commented Jan 6, 2021

Yes, it would be useful to have a way to provide config in the form of just plain files (not via config repo).
We had some discussion touching on this, and the difficulty of interoperability with config repos, at the last CVMFS coordination meeting.

@bedroge bedroge added configuration Improvements or additions to the configuration security Security-related issues labels Jan 8, 2021
@bedroge bedroge changed the title Share masterkey between EESSI repos Share masterkey between EESSI repos and make config package for the entire domain Feb 4, 2021
peterstol pushed a commit to peterstol/filesystem-layer that referenced this issue Feb 18, 2021
@bedroge bedroge moved this to Todo filesystem layer in EESSI pilot 2021.12 Nov 15, 2021
@bedroge bedroge self-assigned this Nov 15, 2021
@bedroge
Copy link
Collaborator Author

bedroge commented Apr 5, 2024

This is now being done for the production repos, so I'm closing this.

@bedroge bedroge closed this as completed Apr 5, 2024
@github-project-automation github-project-automation bot moved this from Todo filesystem layer to Done in EESSI pilot 2021.12 Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configuration Improvements or additions to the configuration security Security-related issues
Projects
Status: Done
Development

No branches or pull requests

2 participants