Skip to content

chore(agent): drop dev-skip-broker-signature cargo feature - #2019

Merged
Benoît Cortier (CBenoit) merged 2 commits into
masterfrom
claude/remove-broker-signature-flag-078e08
Sep 30, 2026
Merged

Benoît Cortier (CBenoit) merged 2 commits into
masterfrom
claude/remove-broker-signature-flag-078e08

Conversation

@CBenoit

Copy link
Copy Markdown
Member

Removes the development-only dev-skip-broker-signature cargo feature.
Skipping package broker client signature validation is already opt-in through the __debug__.skip_broker_signature_validation configuration option (off by default), the same model as skip_msi_signature_validation.
The extra compile-time gate only duplicated that control and required a dedicated CI step to run some tests.

Changes:

  • Drop the feature from now-package-broker and devolutions-agent; the debug option is now honored directly (a DEBUG MODE warning is still logged when the bypass is used).
  • Policy route authorization tests in now-package-broker are no longer feature-gated, so they run with the regular cargo test --workspace.
  • Remove the Run policy route authorization tests CI step and build the agent for the policy tester without --features; the tester still enables the bypass through its generated agent.json.

Reviewer note: on a production build, whoever can edit agent.json can now disable broker client signature validation. The trusted-writer check on the client executable is not affected by the bypass.

Follow-up to #1981.

🤖 Generated with Claude Code

The broker client signature bypass is already opt-in through the
`skip_broker_signature_validation` debug configuration option, matching
how `skip_msi_signature_validation` works. The extra compile-time gate
only forced a dedicated CI step to run the policy route authorization
tests, which now run as part of the regular workspace test run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings September 30, 2026 15:27
@CBenoit

Copy link
Copy Markdown
Member Author

Implementation notes:

  • signature_validation_skipped() in now-package-broker/src/auth.rs is removed; validate_connection checks the flag directly.
  • The shipping_build / dev_build test modules are merged into two tests: validate_connection_validates_signature_unless_skipped (unsigned test binary fails without the bypass, passes with it) and signature_bypass_does_not_disable_trusted_writer_security.
  • shared_router_exposes_policy_management_routes now only asserts the bypass-enabled statuses, since test state always sets skip_signature_validation: true.
  • Verified locally: cargo +nightly fmt --all, cargo clippy -p now-package-broker -p devolutions-agent --tests -- -D warnings, and cargo test -p now-package-broker (430 passed, 2 ignored).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

A production security bypass needs explicit human acceptance, and the revised test does not verify signature enforcement when the bypass is off.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

This PR removes the development-only Cargo gate for the Agent’s package-broker signature bypass. The debug configuration option now controls the bypass in all builds.

Changes:

  • Remove the feature gate and its dedicated CI test step.
  • Run policy route authorization tests in the regular workspace test run.
  • Update signature-validation tests for the new behavior.
File Description
devolutions-agent/​src/​service.rs Passes the debug bypass setting to the broker.
devolutions-agent/​src/​config.rs Removes the obsolete feature-gate documentation.
devolutions-agent/​Cargo.toml Removes the Agent feature.
crates/​now-package-broker/​src/​server/​mod.rs Ungates route authorization tests.
crates/​now-package-broker/​src/​auth.rs Removes the gate and revises authentication tests.
crates/​now-package-broker/​Cargo.toml Removes the broker feature.
.github/​workflows/​ci.yml Builds without the feature and removes its dedicated test step.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread crates/now-package-broker/src/auth.rs Outdated
The previous test failed on the missing trusted-writer guard before the
Authenticode check ran. Retain the executable handle and a test-only
security guard so the non-bypassed path is proven to reject the unsigned
test binary, and cover the bypass in a separate test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CBenoit
Benoît Cortier (CBenoit) merged commit 218da8d into master Sep 30, 2026
46 checks passed
@CBenoit
Benoît Cortier (CBenoit) deleted the claude/remove-broker-signature-flag-078e08 branch September 30, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants