Open zenmonkeykstop opened 5 months ago
My personal preference is for the last option - it seems like the simplest approach and is general in case we move away from Salt altogether.
Just to expand a bit on the options here:
make clone
and making sure that dom0 always has an up to date copy of the code. I think this is okay ish, not idealapply
. In the fancy final form, there could be an orchestration
package that basically just runs apply
and that depends on having a keyring and a dom0 config package installed. But that's maybe getting ahead of ourselves.
So I guess a slightly-more-friendly/packaged version of option 3 would be my vote--basically something that is long-term stable and doesn't get overwritten every time we run the updater, would be my criteria.
Initially I proposed conditional builds with macros ( if %buildcondition ...
), where the conditions were on by default and represented prod settings. Now that we are managing those settings with systemd, what I would suggest instead for this "different RPMs" option would be to build workstation-dom0-config-dev, worksation-dom0-config-staging, and workstation-dom0-config-prod, based on the same .spec file and with most sections of the .spec file shared, and with the only differences in these packages being the .repo and signing pubkey file for easy diffing (so explicitly disallowing other forms of customization between RPMs).
That would look something like
# securedrop-workstation-dom0-config.spec
Name: securedrop-workstation-dom0-config
Version: 0.10.0
Release: 1%{?dist}
Summary: SecureDrop Workstation
[snip]
%install
[snip - unchanged from current]
%install dev
install -m files/test-key.asc %{buildroot}/etc/pki/rpm-gpg/RPM-GPG-SECUREDROP-WORKSTATION
install -m files/securedrop-workstation-dev.repo %{buildroot}/etc/yum.repos.d/securedrop-workstation-dom0.repo
%install staging
install -m files/securerop-release-key-2021.asc %{buildroot}/etc/pki/rpm-gpg/RPM-GPG-SECUREDROP-WORKSTATION
install -m files/securedrop-workstation-staging.repo %{buildroot}/etc/yum.repos.d/securedrop-workstation-dom0.repo
[snip]
%files
[unchanged]
%files dev
/etc/pki/rpm-gpg/RPM-GPG-SECUREDROP-WORKSTATION
/etc/yum.repos.d/securedrop-workstation-dom0.repo
%files staging
/etc/pki/rpm-gpg/RPM-GPG-SECUREDROP-WORKSTATION
/etc/yum.repos.d/securedrop-workstation-dom0.repo
[snip]
It's basically a lite version of the keyring package, without it being a separate keyring package. I'm not attached to this and it's not perfect, but it's one idea.
Last idea: I think we could also combine the options, eg:
I think it makes sense to discuss this as part of the SDW install story. Depending on how users get the key initially during bootstrapping affects how we split out the prod/test keys. For example, if we ship an external keyring package in qubes-contrib for prod users, it makes sense to tell dev users to manually install the test key.
I think it makes sense to discuss this as part of the SDW install story. Depending on how users get the key initially during bootstrapping affects how we split out the prod/test keys. For example, if we ship an external keyring package in qubes-contrib for prod users, it makes sense to tell dev users to manually install the test key.
We won't get to the separate keyring package for the initial 4.2 release, I guess this means we can defer this question for now.
After thinking about it (and also related issues such as https://github.com/freedomofpress/securedrop-workstation/issues/1178) I am leaning towards something like this:
Currently the RPM includes the test signing key and repo config - setting up a dev or staging environment involves changing the env setting involves changing one value in
config.json
and runningsdw-admin --apply
. This increases the risk that users may configure a test environment in error for a system intended for production.There are a few options for guardrails we could put in place:
prep-dev
script invoked viamake {dev,staging}
prior to runningsdw-admin --apply
We should discuss and pick one.