Repository navigation
fix(apps): require the engine capability for engine provider profiles - #576
Merged
Merged
Conversation
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]>
Contributor
|
Caution Review failedThe pull request is closed.
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. |
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-contractsat409240d35f45) accepts aload-balancerorcrowdsecprovider 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.v1incontracts/v1/fixtures.json), butvalidate_manifest/check_manifest_compatibilitynever check that pairing.Such a manifest passed every platform preflight:
Installer::prepare),Manager::launch→Installer::recover),Installer::check_target).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 sameincompatibleManifestoutcome everywhere: catalogincompatible, no download, the installed release does not launch, and the target check reportsincompatible, which blocks the update preview.The bundled
installer.jsonstill 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 listsrentnerproxy.greeting, which has no providers, so no published app is affected.Rest of the criterion (already met, unchanged)
Installer::with_config, and the boundedTargetEnvironment::valid(target_environment_admits_bounded_protocol_versions_and_names).target_check_reads_installed_manifests_from_the_accepted_catalog,upgradePreview.ts→blocked,release-app-requirements.test.tspins the release asset toinstaller.json).xcaddybuild with pinned modules (docker/caddy/tooling/build.sh),caddy list-moduleschecks in both Dockerfiles, and the appliance check instartup.ts(exact CrowdSec module set; no layer4 or appsec in the live config)./var/lib/rentnerproxy/proxy(0710 rentnerproxy:crowdsec). App children run under their own UID with no supplementary groups, and seccomp allows onlyAF_UNIXsockets (restricted_child_fixtureasserts TCPEPERM)./loadwith 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 CrowdSecevaluateisallowed: false.Related issue
Refs #454 (other criteria stay open)
Type of change
Testing
Kiri,
rust:1.99.1-bookworm(AMD64):cargo fmt --check: cleancargo clippy --locked --all-targets --all-features -- -D warnings: cleancargo test --locked --all-features --lib: 1077 passed, 0 failed, 24 ignoredNew tests in
core/tests/private/app_install.rs:engine_providers_require_the_engine_capability_that_applies_them: paired, unpaired and unoffered combinations throughcheck_environment.engine_capability_changes_are_preflighted_for_engine_providers(Linux AMD64/ARM64): signed catalog →incompatiblelisting with no download → install once the engine offers the capability →check_targetreportsincompatiblefor 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
Breaking changes
Apps that declare a
load-balancerorcrowdsecprovider without the matching engine capability are now incompatible. No published app does this.Screenshots
None
🤖 Generated with Claude Code