Repository navigation
(fix) Feat/4945 policy change closes everything - #5361
johntmyers merged 19 commits into
Conversation
|
All contributors have signed the DCO ✍️ ✅ |
|
I have read the DCO document and I hereby sign the DCO. |
|
recheck |
f6cf210 to
180527a
Compare
… affect them (v0.1.7 backport) Backport of feat/4945-policy-change-closes-everything (PR ai-openshell#5361) onto v0.1.7, squashed, for running against a v0.1.7 gateway and the openshell-firecracker driver. Not for merging. Differences from the branch: v0.1.7 has no credential placements, so the resolver tracking in ProviderCredentialState wraps the v0.1.7 resolvers directly, and one relay test uses rewrite_header_value in place of rewrite_header_value_for_name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
88d6b76 to
4ac8e89
Compare
6390b5b to
a996acd
Compare
a996acd to
3b4dee2
Compare
|
/ok to test 3b4dee2 |
BlockedGitHub reports merge conflicts with @johntmyers, I checked the current-head runs after your test request. Action required: @mr-miles, resolve the merge conflicts and inspect the failed Linux Rust lint jobs. A maintainer must accept linked issues #4945, #5363, #5365, #5366, and #5367 with DCO passed. Branch Checks is still running, with Rust lint failures on x86_64-linux and aarch64-linux. The annotations report exit code 101, but detailed logs were inaccessible from this sandbox, so the lint cause is not established. No workflow approvals, reruns, or dispatches were performed. Gator metadata
|
3b4dee2 to
0c01687
Compare
Blocked@mr-miles, your updated branch is now mergeable with Current-head CI runs now exist, including Branch E2E Checks, but require native GitHub Actions approval. Branch Checks, Helm Lint, and Trivy Changes also report PR Issue Acceptance failed because linked issues #4945, #5363, #5365, #5366, and #5367 still have Action required: a maintainer must review and approve the pending current-head workflow runs in GitHub, decide acceptance of the five linked issues, and rerun PR Issue Acceptance after accepting them. Workflow approval and reruns are outside this invocation's authorization. Gator metadata
|
BlockedThe new head passes DCO and PR Issue Acceptance, resolving the earlier issue-acceptance blocker. Current-head Branch Checks, Helm Lint, Trivy Changes, and Branch E2E Checks await native GitHub Actions approval. Code review remains deferred under the process-blocker gate. Action required: a maintainer must inspect and approve the pending current-head workflows in GitHub. The existing The previous head had failed Rust lint jobs; those results do not establish the outcome for this new commit. No workflow approval, rerun, or dispatch was performed. Gator metadata
|
johntmyers
left a comment
There was a problem hiding this comment.
gator-agent
PR Review Status
The first code review is complete. One blocking Warning remains: an authenticated connection can survive rotation of a credential it used.
@johntmyers, I checked the current-head runs following your test request: required checks and the selected E2E suite have passed. The earlier merge, issue-acceptance, DCO, and workflow-approval blockers are resolved, so the earlier process-only reports did not suppress this review.
Action required: @mr-miles, address the credential-continuity finding below and add the two regression cases.
Blocking findings:
GATOR-2e90ffc0-01: Preserve credential invalidation across publication and coalesced rotations.
Carried findings: None.
Gator metadata
- Validation: Implements accepted issues #5363, #5365, #5366, and #5367; partially addresses accepted issue #4945 within the stated connection-revalidation scope.
- Docs: Published policy management and network rules pages updated; no navigation change needed.
- Checks: Current-head required DCO, Branch Checks, Helm Lint, and E2E passed; PR Issue Acceptance and Trivy Changes also passed. Non-required statuses do not gate progression.
- E2E: Existing
test:e2e; current-head Branch E2E Checks run 44834339546 completed successfully. No additional trigger needed; no Windows-specific change identified. - Head SHA:
2e90ffc0337a94455cd4d110e2e3c48c99a3ef7e - Base SHA:
de7c2a5f3d6e5eb00f9bb56a5cf8a10becedbd69 - Merge base SHA:
de7c2a5f3d6e5eb00f9bb56a5cf8a10becedbd69 - Patch ID:
9c8831fda394e154bb00ea888d4236e404b30443 - Gator payload:
16 - Review mode:
initial - Previous reviewed SHA:
none - Review budget exhausted:
no - Maintainer decision required:
no - Next state:
gator:in-review
johntmyers
left a comment
There was a problem hiding this comment.
gator-agent
PR Review Status
The follow-up code review found no new blocking issues. GATOR-2e90ffc0-01 is fixed: credential continuity is checked after configuration publication, and credential versions retain intervening rotations and revocations. The added regression cases cover the publication race and A→B→A transitions, including prepared installs and grant configuration changes. I checked the code and test coverage; no local tests were run.
@mr-miles, your latest commit addresses both parts of the credential finding. I also verified @johntmyers's resolution of the original thread and preserved it.
Required Branch Checks and E2E are running on this head. The existing test:e2e label is appropriate, and no additional trigger is needed. The failed advisory compatibility review is not a required gate. Gator will inspect required CI results next cycle.
Blocking findings: None.
Carried findings: None; GATOR-2e90ffc0-01 is resolved.
Gator metadata
- Validation: Preserved project-validity review for accepted connection-revalidation issues; follow-up stays within that scope.
- Docs: Existing published policy management and network rules updates remain applicable; no new UX contract introduced by this fix.
- Checks: DCO, Helm Lint, PR Issue Acceptance, and Trivy Changes passed. Required Branch Checks remains pending.
- E2E: Existing
test:e2e; current-head Branch E2E Checks run 44844509966 is in progress. - Head SHA:
53380750ae427217ed37a94beff907b50a9ec948 - Base SHA:
de7c2a5f3d6e5eb00f9bb56a5cf8a10becedbd69 - Merge base SHA:
de7c2a5f3d6e5eb00f9bb56a5cf8a10becedbd69 - Patch ID:
23f5cfb48dd30dae3974f39c2a8dc58e2d532c8a - Gator payload:
16 - Review mode:
follow_up - Previous reviewed SHA:
2e90ffc0337a94455cd4d110e2e3c48c99a3ef7e - Review budget exhausted:
no - Maintainer decision required:
no - Next state:
gator:watch-pipeline
Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com>
0721c9f to
be9adeb
Compare
BlockedCurrent-head Branch Checks, Helm Lint, and the selected E2E workflow await native GitHub Actions approval. DCO and PR Issue Acceptance pass; the PR is ready for review and mergeable. The existing Action required: a maintainer must inspect and approve Branch Checks, Helm Lint, and Branch E2E Checks in GitHub. Workflow approval, reruns, and dispatch are outside this invocation's authorization. The completed initial and follow-up code reviews remain in the history. I verified @johntmyers's maintainer authority and preserved the resolution of Gator metadata
|
Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com>
BlockedCurrent-head Branch Checks, Helm Lint, and the selected E2E workflow await native GitHub Actions approval. DCO and PR Issue Acceptance pass; the PR is ready for review and mergeable. The existing Action required: a maintainer must inspect and approve Branch Checks, Helm Lint, and Branch E2E Checks in GitHub. Workflow approval, reruns, and dispatch are outside this invocation's authorization. The completed initial and follow-up code reviews remain in the history. I verified @johntmyers's maintainer authority and checked the resolved credential-continuity thread; its resolution remains preserved. This patch differs from the last reviewed patch, so its author-only delta needs follow-up review once the process blocker clears. No reviewer ran this cycle; this process report is not a code-review disposition and must not suppress that follow-up. Gator metadata
|
johntmyers
left a comment
There was a problem hiding this comment.
gator-agent
PR Review Status
The follow-up code review found no new blocking issues in the author changes since the last reviewed patch. The earlier process-only report deferred this review; its workflow-approval blocker has now cleared. The prior credential-continuity finding, GATOR-2e90ffc0-01, remains resolved.
@johntmyers, I checked your backend integration: connection revalidation retains raw L7 rules, Cedar guards keep strict invalidation, and credential-change notifications use the shared backend. I also checked the DNS refresh and transparent-relay integration against the updated destination filtering and published docs. This was a code-only review; no local tests were run.
Required Branch Checks and E2E are queued on this head. The existing test:e2e label has selected a current-head run, so no additional trigger is needed. Gator will inspect the required results next cycle.
Blocking findings: None.
Carried findings: None; GATOR-2e90ffc0-01 remains resolved.
Gator metadata
- Validation: Preserved project validity for the accepted connection-revalidation issues; the backend integration stays within that scope.
- Docs: Published policy management and network rules pages cover YAML revalidation, strict Cedar invalidation, and persistent DNS placeholders; no navigation change needed.
- Checks: Required DCO and Helm Lint passed; required Branch Checks is pending. PR Issue Acceptance and Trivy Changes passed. Non-required statuses do not gate progression.
- E2E: Existing
test:e2e; current-head Branch E2E Checks run 45449368612 is queued. No Windows-specific change identified. - Head SHA:
297661e7ed6412e3299a3c49b591a15b5be447af - Base SHA:
9551cbada4babd38aa03f8948474cdc5bd206acc - Merge base SHA:
9551cbada4babd38aa03f8948474cdc5bd206acc - Patch ID:
020079031432c61a9ea314475a606fa5a4c7e789 - Gator payload:
16 - Review mode:
follow_up - Previous reviewed SHA:
53380750ae427217ed37a94beff907b50a9ec948 - Review budget exhausted:
no - Maintainer decision required:
no - Next state:
gator:watch-pipeline
f16795b
Monitoring CompleteMonitoring is complete because this PR has merged. The final-head code review found no blocking issues, the earlier credential-continuity finding remains resolved, and all required checks, including the selected E2E suite, passed. I am removing the active Gator metadata
|
Summary
Every network policy reload, provider attach/detach, and middleware registry change causes outbound network connections to be closed by the supervisor, and errors reported back to the sandbox.
This was deliberate (#2373, "invalidate relays on policy changes") and is documented, but much coarser than it needs to be. Also the behaviour is very confusing for workloads that ask for approvals while they are running, causing agents to focus on "solving" and diagnosing connectivity issues rather than their assigned work.
This PR adds the ability to re-validate open connections against a newly received policy, and close them only if the new policy would not allow them. The same behaviour applies for credential changes.
Related issue
Changes
Policy reloads
ConnectionPolicyContractis compared, to re-evaluate the connection against the new policy.revalidating_generation_guard.Policy DNS
allowed_ipsno longer refuses kept answers. A name also keeps its address on a fresh lookup instead of taking a new one from the never-reused pool on every reload (proto conversion stamps a hash of the whole policy into every endpoint).eligible_portsgate are removed, since mappings are no longer tied to a generation or to the ports authored when they were published. A hostname the current policy no longer allows refreshes to an observation at another address, and the connection is denied.PolicyDnsService::lookup_for_pin), so a TTL-0 mapping that expires during authorization is refreshed rather than refused. The bare store and its non-refreshing lookup are test-only, so no connection path can bypass the refresh.Provider credentials
SecretResolverandinject_or_report.Credential revocation (pre-existing bug)
revoke_provider_environment, and invalid bindings go throughreject_provider_bindings.Endpoint status (MCP)
Direct transparent TCP (Linux)
pin_transparent_tcp) so it can be tested without a netfilter-redirected socket.Safety boundaries
Release notes
Re-validate open connections using YAML policies against newly received rules, and close them only if those rules change how the connection is treated. Cached policy DNS answers keep working across policy changes, and an expired answer is refreshed when a connection uses it.
Testing
Structured as red/green pairs:
Rebased onto main, including #5650's refresh-on-connect, IPv6 destination checks, and the shared Rego/Cedar runtime interface. Revalidation retains full Rego endpoint rules; destination filtering and credential-revocation notifications use the shared backend contracts.
Local validation: 1,871 network tests passed serially (two ignored), 77 Cedar runtime tests, 151 conformance tests (three ignored), 17 focused passthrough tests, and four supervisor credential tests passed. The experimental supervisor check and full pre-commit hook passed. A Linux ARM64 cross-build of the network crate also passed after fixing the transparent relay's DNS service reference. Parallel network runs hit eight timeout failures; the same test binary passed serially.
Manual check: open a long-lived connection (for example a WebSocket or
curlto a slow endpoint) through the sandbox proxy, approve an endpoint for a different host, and confirm that the connection survives, the log shows "Policy change does not affect established connection; re-pinned", and the connection closes when its own host's rules change.Running in my own setup, have had no occurrences of dropped connections using the updated code. Previously I had an approx 60% success rate on triggering it with approvals while the agents were at work.
Checklist