Skip to content

spike: sd-admin VM via RPM#1572

Merged
micahflee merged 2 commits intomainfrom
admin-rpm-simple
Mar 6, 2026
Merged

spike: sd-admin VM via RPM#1572
micahflee merged 2 commits intomainfrom
admin-rpm-simple

Conversation

@conorsch
Copy link
Contributor

This PR adopts the "admin-config" RPM spec file by @zenmonkeykstop in #1554. It also pulls in the simplified RPM build logic from #1565; therefore, #1565 should be reviewed and merged first.

Based on @zenmonkeykstop's work, I added an sd-admin VM based on Debian 13 Trixie. There's no grsec kernel or keyring package yet, but the securedrop-admin tooling is installed:

securedrop-admin help text
[conor@dom0 securedrop-workstation]$ qvm-run -p sd-admin "securedrop-admin --help"
usage: securedrop-admin [-h] [-v] [-d] [--force]
                        {sdconfig,install,localconfig,tailsconfig,qubesconfig,generate_v3_keys,backup,restore,check_for_updates,logs,reset_admin_access,verify} ...

SecureDrop Admin Toolkit.

For use by administrators to install, maintain, and manage their SD
instances.

positional arguments:
  {sdconfig,install,localconfig,tailsconfig,qubesconfig,generate_v3_keys,backup,restore,check_for_updates,logs,reset_admin_access,verify}
    sdconfig            Configure SD site settings
    install             Install/Update SecureDrop
    localconfig (tailsconfig, qubesconfig)
                        Configure either Tails or Qubes environment post SD install
    generate_v3_keys    
                        This method will either read v3 Tor onion service keys if found or generate
                        a new public/private keypair.
    backup              Perform backup of the SecureDrop Application Server.
                        Creates a tarball of submissions and server config, and fetches
                        back to the Admin Workstation. Future `restore` actions can be performed
                        with the backup tarball.
    restore             Perform restore of the SecureDrop Application Server.
                        Requires a tarball of submissions and server config, created via
                        the `backup` action.
    check_for_updates   Check for SecureDrop updates
    logs                Get logs for forensics and debugging purposes
    reset_admin_access  Resets SSH access to the SecureDrop servers, locking it to
                        this Admin Workstation.
    verify              Run configuration tests against SecureDrop servers

options:
  -h, --help            show this help message and exit
  -v                    Increase verbosity on output (default: False)
  -d                    Developer mode. Not to be used in production. (default: False)
  --force               force command execution without update check (default: False)
[conor@dom0 securedrop-workstation]$ 

The RPM setup reuses Salt state files between the two RPMs, but installs them to unique dest paths, ensuring both RPMs can be installed independently of one another, without triggering dnf conflicts. We can lean into this and port more of the pre-existing Salt config if we desire.

Towards #1507.

Test plan

  1. Ensure that make clone && make dev passes without error
  2. Run make sd-admin to configure the sd-admin VM; check that securedrop-admin CLI is installed within it.
  3. Build the RPMs locally and run rpm -qlp <path> on them; inspect their file contents and ensure no conflicts or overlaps between them, because any duplication of dest paths will cause problems.

Checklist

This change accounts for:

  • any necessary RPM packaging updates (e.g., added/removed files, see MANIFEST.in and rpm-build/SPECS/securedrop-workstation-dom0-config.spec)
  • any required documentation

@conorsch conorsch requested a review from a team as a code owner February 17, 2026 15:41
@conorsch conorsch moved this to Ready For Review in SecureDrop Feb 17, 2026
@micahflee micahflee self-assigned this Feb 17, 2026
@jskinne3 jskinne3 requested a review from micahflee February 17, 2026 17:30
@micahflee micahflee moved this from Ready For Review to Under Review in SecureDrop Feb 18, 2026
micahflee
micahflee previously approved these changes Feb 19, 2026
Copy link
Contributor

@micahflee micahflee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. I haven't looked into why the GitHub checks aren't running/passing, and main needs to be merged into this branch still.

As far as the test plan:

  1. make clone && make dev works without error
  2. make sd-admin configures the sd-admin VM, and securedrop-client is installed and worked
  3. after building the RPMs locally, I confirm that they don't have any conflicting files

After creating sd-admin, I also went ahead and used it to install a SecureDrop server, and it works! One thing we might want to put some thought into is what tags to put on sd-admin, because the lack of copy/paste and file transfer made it very difficult at first to copy my ssh key into sd-admin. There might be various legit reasons the admin needs to use copy/paste and to transfer files.

@legoktm
Copy link
Member

legoktm commented Feb 19, 2026

For the CI checks, the PR just needs to be rebased on top of main to pick up the new names.

@conorsch
Copy link
Contributor Author

One thing we might want to put some thought into is what tags to put on sd-admin, because the lack of copy/paste and file transfer made it very difficult at first to copy my ssh key into sd-admin. There might be various legit reasons the admin needs to use copy/paste and to transfer files.

Great call. I took a look at the diff, and I don't see an easy answer here: nowhere do we authorize the use of sd-dev which is explicitly a development VM, nor should we start here; we also can't know what source VM the Admin will use for such copying—but we can certainly recommend it. Absent an obvious immediate solution, I've opened #1578 for further discussion, and left the changeset in this PR as-is: the clipboard access issue remains.

For the CI checks, the PR just needs to be rebased on top of main to pick up the new names.

Done: all CI checks are now passing.

@zenmonkeykstop
Copy link
Contributor

https://workstation.securedrop.org/en/stable/admin/reference/managing_clipboard.html shows how optional copy/paste config (vault to sd-app) is handled, that logic can probably be adapted for this case.

Copy link
Member

@legoktm legoktm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm slightly concerned about having this be enabled by default just because in the past we've worked hard to avoid having things that get built but intentionally discarded; we're at the point that it should be a blind thing that you just copy all the packages that get built to apt/yum repo (especially once we have CI do it) and I'd like to preserve that.

RPM makes it easier to have conditional builds, could we try adding %bcond_with admin so that builds need to have --with=admin to include that RPM? And then a separate make build-rpm-admin target.

@conorsch
Copy link
Contributor Author

Heard. I didn't get to this today, but I'll adjust the logic to ensure that the new RPM is off-by-default for both building and installing.

zenmonkeykstop and others added 2 commits February 25, 2026 21:52
Reuses config logic from the SDW RPM, but notably does not duplicate
it in version control by copy/pasting files; rather, we target the same
source files for the in-place "install" directories in the RPM spec
file.

We can sort out the exact boundary to come: for now, while this approach
does ship the several salt state files to multiple dirs (viz.
/srv/salt/{securedrop,admin}_salt/), the unique dest paths ensure that
no conflicts occur.

There's now an "sd-admin" VM that's based on the `debian-13` Trixie
template. The FPF apt repo, prod-only, is installed, as is the
"securedrop-admin" package. Other packages such as grsec will need
porting to trixie, which we can do in good time.

Included a "make sd-admin" target to handle applying said salt states.

Uses a %bcond macro in the RPM spec file to ensure that building the
admin RPM is off-by-default, but can be enabled via a single flag.
Throughout the dev env and build logic, use of the new
`securedrop-admin-dom0-config` RPM is off-by-default.
@conorsch
Copy link
Contributor Author

Alright, I rewrote the RPM build logic to use %bcond. It's a significant enough change to the PR to require a full re-review.

There's still a bit of non-DRY duplication in the shell scripts that build the RPM, but I feel that's warranted here during the WIP phase, to ensure that the pre-existing logic for building the securedrop-workstation-dom0-config remains completely separate from the new logic for securedrop-admin-dom0-config. If folks disagree, we could easily toggle the --with admin flag to be conditional on an env var. Given the state of the spike, I suggest we punt on reconciling the duplication until we're ready to build and host the package somewhere like yum-test.

Ready for re-review, @micahflee!

@legoktm
Copy link
Member

legoktm commented Feb 26, 2026

Alright, I rewrote the RPM build logic to use %bcond. It's a significant enough change to the PR to require a full re-review.

Thank you!

There's still a bit of non-DRY duplication in the shell scripts that build the RPM, but I feel that's warranted here during the WIP phase, to ensure that the pre-existing logic for building the securedrop-workstation-dom0-config remains completely separate from the new logic for securedrop-admin-dom0-config. If folks disagree, we could easily toggle the --with admin flag to be conditional on an env var. Given the state of the spike, I suggest we punt on reconciling the duplication until we're ready to build and host the package somewhere like yum-test.

Sounds good but also I think the bar to enable --with=admin for the CI nightlies that end up on yum-test should be pretty low, so even if this isn't resolved by that point, whenever having nightlies will be useful, we should just do it.

@legoktm legoktm dismissed their stale review February 26, 2026 16:57

addressed

Copy link
Contributor

@micahflee micahflee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested again and everything works great. I built both RPMs and compared them, and they still don't have any overlapping files.

@micahflee micahflee added this pull request to the merge queue Mar 6, 2026
Merged via the queue into main with commit 53b0fe3 Mar 6, 2026
15 checks passed
@github-project-automation github-project-automation bot moved this from Under Review to Done in SecureDrop Mar 6, 2026
@nathandyer nathandyer removed this from SecureDrop Mar 16, 2026
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.

5 participants