Skip to content

fix(apps): require the engine capability for engine provider profiles - #576

Merged
RentnerKev merged 5 commits into
mainfrom
rentner/fix/engine-provider-capabilities
Nov 26, 2026
Merged

RentnerKev merged 5 commits into
mainfrom
rentner/fix/engine-provider-capabilities

Conversation

@RentnerKev

Copy link
Copy Markdown
Member

Summary

Part of #454, criterion: "Native engine capability changes are preflighted and visible; unsupported modules cannot be dynamically injected or silently disable protection."

The manifest contract (rentnerproxy-app-contracts at 409240d35f45) accepts a load-balancer or crowdsec provider that does not require the engine capability that applies its contributions. The official profiles pair them (load-balancer → caddy.load-balancing.v1, crowdsec → caddy.crowdsec.v1 in contracts/v1/fixtures.json), but validate_manifest / check_manifest_compatibility never check that pairing.

Such a manifest passed every platform preflight:

A target release whose engine dropped the capability therefore looked compatible in the update dialog, and the provider would meet an engine that cannot apply or enforce what it contributes.

Change

Installer::check_environment (core/src/app_install.rs) now also requires that every engine provider the manifest declares requires its engine capability and that the environment offers it. Every check goes through this function, so the result is the same incompatibleManifest outcome everywhere: catalog incompatible, no download, the installed release does not launch, and the target check reports incompatible, which blocks the update preview.

The bundled installer.json still offers no engine capabilities. Until the load-balancer and CrowdSec broker PRs add theirs there, apps with those provider profiles are not installable on this platform. The public app catalog only lists rentnerproxy.greeting, which has no providers, so no published app is affected.

Rest of the criterion (already met, unchanged)

  • Unknown capability names: a closed enum in the manifest schema, the closed set in Installer::with_config, and the bounded TargetEnvironment::valid (target_environment_admits_bounded_protocol_versions_and_names).
  • Preflight and visibility: feat: preview apps and built-in features before an image update #571 (target_check_reads_installed_manifests_from_the_accepted_catalog, upgradePreview.ts → blocked, release-app-requirements.test.ts pins the release asset to installer.json).
  • Fixed module set: static xcaddy build with pinned modules (docker/caddy/tooling/build.sh), caddy list-modules checks in both Dockerfiles, and the appliance check in startup.ts (exact CrowdSec module set; no layer4 or appsec in the live config).
  • No runtime injection by apps: the Caddy admin socket is in /var/lib/rentnerproxy/proxy (0710 rentnerproxy:crowdsec). App children run under their own UID with no supplementary groups, and seccomp allows only AF_UNIX sockets (restricted_child_fixture asserts TCP EPERM). /load with an unknown handler is rejected with 400 and keeps the active revision (proxy-smoke.ts). No App API operation carries engine JSON: owned hosts carry a hostname and an upstream, load-balancer contributions carry a policy enum and upstreams, and an unavailable CrowdSec evaluate is allowed: false.

Related issue

Refs #454 (other criteria stay open)

Type of change

  • Bug fix
  • New feature
  • Refactoring
  • Documentation
  • CI / tooling
  • Dependency update
  • Other

Testing

Kiri, rust:1.99.1-bookworm (AMD64):

  • cargo fmt --check: clean
  • cargo clippy --locked --all-targets --all-features -- -D warnings: clean
  • cargo test --locked --all-features --lib: 1077 passed, 0 failed, 24 ignored

New tests in core/tests/private/app_install.rs:

  • engine_providers_require_the_engine_capability_that_applies_them: paired, unpaired and unoffered combinations through check_environment.
  • engine_capability_changes_are_preflighted_for_engine_providers (Linux AMD64/ARM64): signed catalog → incompatible listing with no download → install once the engine offers the capability → check_target reports incompatible for a target without it → recover (launch) refuses after the capability is dropped. An unpaired load-balancer release stays incompatible even where the engine offers load balancing.

Checklist

  • I tested the relevant functionality.
  • Existing tests pass.
  • I added or updated tests where appropriate.
  • This PR does not include secrets, credentials, production data, or private certificates/keys.
  • I updated documentation where necessary.
  • I linked the relevant issue for a feature or fix, or explained why no issue is needed.

Breaking changes

Apps that declare a load-balancer or crowdsec provider without the matching engine capability are now incompatible. No published app does this.

Screenshots

None

🤖 Generated with Claude Code

The manifest contract accepts a load-balancer or CrowdSec provider that
does not require the engine capability that applies its contributions.
Such a manifest passed every compatibility check: install, catalog
availability, launch of an installed release and the upgrade target
check. A target release whose engine drops the capability therefore
looked compatible, and the provider would meet an engine that cannot
apply or enforce what it contributes.

The installer now requires every engine provider to declare its engine
capability (load-balancer -> caddy.load-balancing.v1, crowdsec ->
caddy.crowdsec.v1, as the official profiles pair them) and the platform
to offer it. All checks share this path, so the result is the same
incompatibleManifest outcome everywhere.

Refs #454

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@RentnerKev
RentnerKev merged commit db22463 into main Nov 26, 2026
15 checks passed
@RentnerKev
RentnerKev deleted the rentner/fix/engine-provider-capabilities branch November 26, 2026 05:40
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.

1 participant