fix(policy)!: reject unsupported TLS endpoint values - #3414
lunarwhite wants to merge 1 commit into
Conversation
johntmyers
left a comment
There was a problem hiding this comment.
gator-agent
PR Review Status
This accepted issue-backed policy cleanup is project-valid, and the migration and schema documentation are present. The initial code review found one blocking mismatch between the newly accepted TLS spelling and its runtime meaning.
Action required: please make validation and runtime parsing agree on whether case variants such as SKIP are accepted, and add regression coverage for the chosen contract.
Blocking findings:
GATOR-deed4de9-01: validation accepts case variants that the runtime interprets differently
Carried findings:
- None
Non-blocking suggestions:
- None
Gator metadata
- Validation: linked issue #3310 is accepted and this PR implements its policy-schema cleanup
- Docs: Fern policy reference and release migration notes are updated
- Checks: lightweight current-head checks and DCO are green; required full checks have not been dispatched
- E2E: required for policy enforcement and supervisor-network behavior, but deferred until the blocking finding is resolved
- Head SHA:
deed4de95d0817c02652a3be7637e9e57d768ef5 - Base SHA:
fc03bffead64f09c1f756a8eea6391ada999cf7a - Merge base SHA:
c502be9fd73c41bab25f0a88587b7a3d90c96b55 - Patch ID:
d326cd9bda107cfacd73d41104c06dcf166c7899 - Gator payload:
9 - Review mode:
initial - Previous reviewed SHA: none
- Review budget exhausted: no
- Maintainer decision required: no
- Next state:
gator:in-review
Signed-off-by: Yuedong Wu <dwcn22@outlook.com>
deed4de to
e6c2892
Compare
|
Label |
|
/ok to test e6c2892 |
johntmyers
left a comment
There was a problem hiding this comment.
gator-agent
PR Review Status
The follow-up review confirms that exact lowercase skip is now the only accepted opt-out spelling and that accepted values are checked against runtime parsing. The prior TLS-mode mismatch is resolved, with no new blocking findings in the author delta.
Blocking findings:
- No blocking findings remain
Carried findings:
- None;
GATOR-deed4de9-01is resolved
Gator metadata
- Validation: linked accepted issue #3310 covers this policy-schema cleanup
- Docs: Fern policy reference and release migration notes are updated
- Checks: current-head Branch Checks and Helm Lint are running
- E2E:
test:e2eapplied; current-head mirror created and Branch E2E Checks are running - Head SHA:
e6c28923b1b60f4fff67448c8154e578270b7e4e - Base SHA:
50c5cf8ed0423f545fee7e0ccc7e7699eec9e290 - Merge base SHA:
c502be9fd73c41bab25f0a88587b7a3d90c96b55 - Patch ID:
6e17746529cf8b656121f7e3c6902e0a34a442aa - Gator payload:
9 - Review mode:
follow_up - Previous reviewed SHA:
deed4de95d0817c02652a3be7637e9e57d768ef5 - Review budget exhausted: no
- Maintainer decision required: no
- Next state:
gator:watch-pipeline
|
Looks all check passed/skipped, no inflight jobs running |
Summary
The endpoint
tlsfield now accepts only an omitted value, meaning auto-detect and terminate for inspection, orskip.terminateandpassthroughbecame no-ops when termination became automatic, leaving a MED-severity deprecation warning as their only remaining effect; they are now rejected along with any other unrecognized value, and the warning machinery is deleted rather than upgraded.Removing the field from an existing policy is exactly behavior-preserving, since
parse_tls_modealready resolved both spellings toAuto. The schema break lands inside the pre-0.1.0 windowrfc/0014-release-stabilitydesignates for finalizing interfaces.Related Issue
Closes #3310
Changes
validate_tls_modeas a tenth arm ofvalidate_l7_endpoint_semantics, via a newtlsfield onL7EndpointFields. This covers gateway admission and stored reads, the supervisor's OPA-data load, and provider-profile lint in one place, and reusesPolicyViolation::InvalidL7Endpointrather than adding a variant.validate_tls_modedirectly innetwork_endpoint_from_json, the one boundary that cannot use the seam because agent-authored proposals validate field-by-field before aNetworkEndpointexists. Without it an in-sandbox agent could author a value the gateway rejects.parse_l7_config, which now delegates toparse_tls_mode, and the deprecation warning invalidate_l7_policies.parse_tls_modekeeps its lenient_ => Autofallback, which inspects and so still fails closed.effective_tlsinmerge.rsand the unreachable "TLS terminate" TUI annotation, both dead once the values are rejected.tls: terminateendpoints fromproviders/aws-s3.yaml. That file is compiled in and unwrapped bybuiltin_profiles(), so enforcing without cleaning it would panic the gateway on first catalog access — hence one commit.tls: nonevalues from three SPIFFE example profiles, already invalid before this change but failing silently.skills/generate-sandbox-policy/, which told agentstls: terminatewas required for HTTPS plus L7, and warn there against substitutingtls: skipfor a rejected value.policy-schema.mdx, theproto/sandbox.protocomment and regenerated Go binding, the accepted-values invariant inarchitecture/security-policy.md, and the quickstart README.Upgrade impact
A stored policy carrying a removed value fails validation on read, so
GetSandboxConfigreturnsFAILED_PRECONDITION.openshell policy list --globalreports which revision is invalid and why, andpolicy set --globalre-applies a corrected policy because it validates only the incoming one.policy delete --globaldoes not recover, since it decodes the stored policy before removing the key; that is pre-existing and filed separately, so the migration note points atset.The community sandbox images still ship
tls: terminatein their baked/etc/openshell/policy.yaml, but RFC-0012 put the supervisor in its own container with no mount of the workload rootfs, so an image-baked policy is not read on any path. Cleaning those images is hygiene, not a prerequisite here.Testing
mise run pre-commitpassesChecklist