Repository navigation
MyOwnPKI v0.3.6
Salt formula: deploy/salt/myownpki/ installs the agent from a hash-checked package, enrolls it with an
enrollment pass, adds its deployments and keeps them in step, from one state.apply myownpki. The
server and the agent are unchanged. The maintainer tested it live on five enrolled Debian amd64 hosts: one
state.apply myownpki upgraded the agent from 0.3.2 to 0.3.5, and a second apply changed nothing. The
enrollment of a new host with a pass, rpm hosts and other Salt versions are not tested live.
Added
- Salt formula for the agent (
deploy/salt/myownpki/:init.sls,agent.sls,map.jinja,
defaults.yaml,pillar.exampleand a README). The pillar ismyownpki:agent:version,server,
acme_directory,root_sourceandroot_sha256,package.sha256per architecture (amd64,
arm64), optionalpackage.sourceandpackage.format,webroot,low_ports,enrollment_pass,
config_source,deploymentsandabsent. On a minion it stages the package (deborrpm, from the
Salt file server or anhttps://URL) in/var/cache/myownpki-agent, checks its SHA-256 against
the value from your admin UI and installs only from that local file, stages the root (whichsetup
checks againstroot_sha256), writes the enrollment pass to/root/myownpki-join-token(mode 0600,
never shown in any output or put on a command line) only while the host has no agent certificate, runs
setupuntil it has one, and then applies the deployments withdeployment addanddeployment removeor renders a completeagent.yamland runssandbox sync. A secondstate.applychanges
nothing. A new package on an enrolled host runssetupagain, which is the update path. The formula
never enables or starts the service (setupdoes when the host is admitted; the restart is
systemctl try-restart), so a host that waits for an approval stays down until the next apply finds it
approved. It fails closed: a missing required key, no hash for the minion's architecture, an unknown
key, option or format, a pass that is not a string,config_sourcetogether withdeploymentsand
similar mistakes render one failing state,myownpki-agent-refused, and install nothing. Salt ignores
source_hashforsalt://sources, so the formula's explicit check, not Salt, protects the install.
It is copied from the tag or fetched with gitfs; it is not part of the release archives. - CI job
salt formula: renders every test pillar ofdeploy/salt/test/cases(Debian amd64 with a
pass, RedHat arm64 withconfig_source, a minimal pillar, anhttps://source and nine refusals) with
state.show_highstate, checks which states exist and which must not, that the pass appears in no output,
and runsstate.apply test=Truefor the cases a Debian runner can apply. It uses a pinned Salt 3008.5
(onedir, SHA-256 checked);bash scripts/ci/salt-test.sh --self-testruns the checks that need no Salt.
It is not a required check.
Changed
- Container image tag
latest: every stable release now also movesghcr.io/der-felix/myownpki:latest
(a pre-release gets only its version tag). Production setups should keep pinning the version:latest
moves with every stable release, and an update of a CA should be a decision. The example
docker-compose.ymlstays pinned. low_portson enrolled hosts: a host that already has the systemd drop-in20-low-ports.confneeds
low_ports: truein its pillar. Four of the five hosts of the live test did.- Documentation: the Salt page is rewritten around the formula (install, minimal and full pillar, the
first and the second apply, a host waiting for approval, removing the pass, updating, changing or
removing a deployment, the refusals, what is and is not tested); the operations guide has a new
chapter 12.10; the pages on adding hosts, upgrading and troubleshooting name the formula. api/openapi.yamlinfo.versionis 0.3.6.
Known limitations
- Tested live only on enrolled Debian amd64 hosts (the upgrade of the agent, and a second apply that changes
nothing). Not tested live: the enrollment of a new host with an enrollment pass (setup --token-file,
the removal of the pass file, a host that waits for approval),rpmhosts,arm64,config_sourceand
the gitfs install. CI renders and applies the formula withtest=Trueunder Salt 3008.5 only. Try it on
one minion first. - A changed option of an existing deployment in the pillar is not applied: the formula adds a deployment
only whendeployment listdoes not show the name. Remove it throughabsentfirst, or use
config_source. - The agent's state directory must stay
/var/lib/myownpki-agent; the formula looks foragent.crtthere.
Upgrade notes
- No migration, no configuration change and no change to the server or the agent. Update the server first,
as always; going back needs no restore. - Nothing uses the formula until you copy it to a Salt master. With it, updating the agents is a change of
versionandpackage.sha256in the pillar and astate.apply.