Skip to content

Security hardening batch: updater attestation opt-out, recovery backup, feed repoint, trust-pin TODO#307

Merged
TeoSlayer merged 4 commits into
mainfrom
security/dr-hardening-batch
Jun 22, 2026
Merged

Security hardening batch: updater attestation opt-out, recovery backup, feed repoint, trust-pin TODO#307
TeoSlayer merged 4 commits into
mainfrom
security/dr-hardening-batch

Conversation

@TeoSlayer

Copy link
Copy Markdown
Collaborator

Batch of confirmed, low-risk security/hardening fixes from a deep-research security audit. All additive and backward-compatible — no breaking protocol changes.

updater: --skip-attestation flag (H5)

The updater module fails closed when gh is absent (SLSA provenance can't be verified). This threads updater.Config.SkipAttestation (present in the pinned updater v0.2.2) through a new --skip-attestation flag plus a PILOT_UPDATER_SKIP_ATTESTATION env fallback, mirroring the existing --state-path pattern. Default false keeps verification on; logs a warning when set. Gives operators on hosts genuinely without gh an explicit opt-out.

pilotctl: back up identity.json before recovery overwrite (L1)

pilotctl recovery recover replaces the live daemon identity in place. Now copies any existing identity to identity.json.bak-<unix-ts> first and refuses the overwrite if the backup can't be written — an irreversible-overwrite guard. Recovery crypto unchanged. Adds unit tests (no-file / copy / unwritable paths).

Repoint runtime changelog + motd feeds (L4)

The pilotctl changelog feed pointed at teoslayer.github.io/pilot-changelog, which now 404s after the TeoSlayerpilot-protocol org rename, and the daemon MOTD feed used the raw TeoSlayer path. Both repointed to the live pilot-protocol locations (verified 200), plus the matching help text and docs. Historical comments, test fixtures, go.sum, and pilot-skills references (that repo was not migrated; redirect still works) left as-is.

trustedagents: document pubkey-pinning gap (H4)

trustedagents.IsTrusted keys on node_id only, with no pubkey binding. The trustedagents package is a separate published module (github.com/pilot-protocol/trustedagents@v0.2.3), not in-repo, and both web4 call sites are outbound handshake-initiation decisions where the peer's authenticated pubkey is not in scope. Added TODOs documenting that pubkey pinning (IsTrustedWithKey + optional PublicKey field on the Agent struct + tests) must land in the upstream module at its inbound auto-accept path. No behaviour change here.

Validation

GOWORK=off go build ./..., go vet, and go test pass for the affected packages (cmd/updater, cmd/pilotctl, internal/motd). gofmt -s clean. pre-commit hooks (gitleaks / vet / fmt) green on every commit.

teovl added 4 commits June 22, 2026 14:31
Threads updater.Config.SkipAttestation (present in pinned updater v0.2.2)
through a --skip-attestation flag plus a PILOT_UPDATER_SKIP_ATTESTATION env
fallback, mirroring the existing --state-path pattern. Default false keeps
provenance verification on; the updater fails closed when gh is absent, so
hosts genuinely without gh now have an explicit CLI opt-out. Logs a warning
when set.
recovery recover replaces the live daemon identity in place via
SaveIdentity. Copy any existing identity to identity.json.bak-<unix-ts>
first, and refuse the overwrite if the backup cannot be written, so a
recovery run can never silently destroy the prior key. Recovery crypto is
unchanged. Adds unit tests for the no-file, copy, and unwritable paths.
IsTrusted keys on node_id only, with no pubkey binding. Both web4 call
sites are outbound handshake-initiation decisions where the peer's
authenticated pubkey is not in scope, so node_id match is all that can be
checked locally. Add TODOs documenting that pubkey pinning
(IsTrustedWithKey) belongs in the upstream pilot-protocol/trustedagents
module at its inbound auto-accept path, where the presented key is
available. No behaviour change.
The pilotctl changelog feed pointed at teoslayer.github.io/pilot-changelog,
which now 404s after the TeoSlayer to pilot-protocol org rename, and the
daemon MOTD feed used the raw TeoSlayer path. Repoint both to the live
pilot-protocol locations (pilot-protocol.github.io and
raw.githubusercontent.com/pilot-protocol), plus the matching help text and
docs. Historical comments, test fixtures, go.sum, and pilot-skills
references (whose repo was not migrated) are left as-is.
@TeoSlayer TeoSlayer merged commit 3bf753e into main Jun 22, 2026
9 of 11 checks passed
TeoSlayer added a commit that referenced this pull request Jun 22, 2026
The updater module v0.2.3 makes SLSA attestation verification fail
closed when the gh CLI is absent (previously a silent no-op). Bumping
the dependency ships this behavior to the auto-updater binary built by
cmd/updater. The --skip-attestation flag (added in #307) continues to
wire to updater.Config.SkipAttestation as the explicit opt-out for
hosts genuinely without gh.

Co-authored-by: Teodor Calin <teodor@vulturelabs.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