Repository navigation
Conversation
Add tenant isolation tests covering MVP criteria rossoctl#6-8: - Auth isolation: JWT audience-based rejection across tenants - RBAC isolation: ServiceAccount namespace scoping validation - Credential isolation: provider secret and ConfigMap separation Add sandbox connectivity tests for MVP criterion rossoctl#2: - Gateway pod/service/port-forward reachability - kubectl exec into sandbox pods (interactive session capability) Tag existing tests (sandbox lifecycle rossoctl#1, OPA enforcement rossoctl#3, credential security rossoctl#4) with the `mvp` marker for filtered runs. Register `mvp` pytest marker in conftest.py. Closes rossoctl#1362 Deferred criteria tracked in rossoctl#1479 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
|
/run-e2e-openshell |
Fixes CodeQL alert "Binding a socket to all network interfaces" by using 127.0.0.1 instead of empty string (all interfaces). Port-forward tests only need localhost connectivity. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
New Commits DetectedThe New HEAD: For maintainers: Please review the new changes and comment Security checklistBefore running E2E tests, verify the PR does NOT contain:
This is an automated security measure to prevent TOCTOU attacks |
|
/run-e2e-openshell |
E2E HyperShift Tests FailedCommit: To re-run tests after fixing issues, comment |
❌ [Experimental] OpenShell E2E Tests FailedCommit: Non-voting. Re-run: |
❌ [Experimental] OpenShell E2E Tests FailedCommit: Non-voting. Re-run: |
E2E HyperShift Tests FailedCommit: To re-run tests after fixing issues, comment |
|
/run-e2e-openshell |
E2E HyperShift Tests FailedCommit: To re-run tests after fixing issues, comment |
❌ [Experimental] OpenShell E2E Tests FailedCommit: Non-voting. Re-run: |
…polling Replace the fire-once 60s poll for credential files with a continuous polling mechanism that never gives up. This fixes transient 401 errors in CI when the client-registration sidecar takes longer than 60s to write /shared/client-id.txt and /shared/client-secret.txt. Changes: - ResolveCredentialFiles now returns a ready channel and polls with exponential backoff (5s→60s) after the initial timeout expires - Add configurable credential_wait_timeout (default 120s) - Return 503 (not silent 401) when identity is not yet loaded - Add /healthz and /readyz HTTP endpoints on port 9091 for Kubernetes readiness probes Fixes: rossoctl/rossoctl#1480 Signed-off-by: Paolo Dettori <[email protected]> Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
Ladas
left a comment
There was a problem hiding this comment.
Security & Code Review
Scope: 6 files, +866/-4 — new multi-tenant E2E tests for tenant isolation (criteria #6-8) and sandbox connectivity (criterion #2).
Security Assessment: PASS
- Subprocess safety: All
subprocess.runandsubprocess.Popencalls use list-form arguments (noshell=Trueon untrusted input). The singlesh -cusage has a hardcoded command string. - Test credentials:
alice123/bob123are intentional well-known fixtures for local Keycloak test users — not production secrets. - JWT handling:
_decode_jwt_payloadskips signature verification but is explicitly test-only, properly scoped and commented. Not copy-paste-dangerous. - Environment variables:
TENANT_1/TENANT_2flow into kubectl as list arguments (not through a shell) — no injection vector even with malicious values.
Code Review: PASS
- Comprehensive tenant isolation coverage: JWT audience rejection, RBAC namespace scoping, credential isolation.
test_13_sandbox_connectivity.pyvalidates gateway health, kubectl exec, and terminal session capability — solid coverage of criterion #2.mvppytest marker is a nice organizational touch for running MVP-focused test suites.- Consistent use of the
kubectl_runhelper from conftest.py (list-form subprocess) throughout.
Note: This PR has merge conflicts that need resolving before merge.
No security vulnerabilities found.
Assisted-By: Claude Code
…ealm Root cause of the HyperShift E2E 401s on PR #1481 (and other PRs that happened to race the operator's ClientRegistrationReconciler): the test token had no `aud` claim because the Keycloak realm scope that carries the audience mapper (`agent-team1-weather-service-aud`) was not yet present when `87-setup-test-credentials.sh` queried for it. The fixture logged "No agent audience scopes found (agents may not be deployed yet)" and moved on, attaching nothing to `kagenti-e2e-tests`. The subsequent `client_credentials` token therefore contained no `aud`, and AuthBridge's `jwt-validation` plugin rejected every inbound request with "audience is required (prevents confused deputy attacks)" → 401. The scope is created asynchronously by kagenti-operator's ClientRegistrationReconciler (default path) or the legacy client-registration sidecar (opt-in). Neither is synchronous with the weather-service Deployment admission, so the fixture and the scope creator race. This change gates the fixture on the observable output of that reconciler — scope presence in realm `default-default-client-scopes` — rather than orchestrating startup timing. Changes: - 87-setup-test-credentials.sh: when agent deployments exist in team1, poll the realm for at least one agent-*-aud scope before attaching. Default timeout 300s; SCOPE_WAIT_TIMEOUT env var overrides. Admin token is refreshed each iteration (master-realm admin tokens live ~60s). Happy path pays ~0s (first iteration finds scopes). - tests/conftest.py: extract token acquisition into `_acquire_agent_token` and expose a new `keycloak_agent_token_refresh` fixture that returns a zero-arg callable minting a fresh token. Existing `keycloak_agent_token` keeps its session-scope cache behavior; the refresh fixture is there so tests can pick up a freshly-scoped token if a future race puts scope attachment after the session fixture cached its tokenless-of-aud value. Not wired into tests in this PR; left as follow-up pending observation. Verification plan: - Green Kind E2E with artificial operator stall: add sleep 60 in 74-deploy-weather-agent.sh, verify wait loop kicks in and proceeds once scope appears. - HyperShift re-run via /run-e2e on a PR to confirm: expected log sequence is "Waiting up to 300s for agent-*-aud scopes..." followed by "Agent audience scope(s) detected after Ns" within ~6 min, then "Added scope 'agent-team1-weather-service-aud' to kagenti-e2e-tests". - Regression check on a healthy cluster: expect ~0s detection time, no measurable slowdown on the happy path. Refs: issue seen on #1480, #1481. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Hai Huang <[email protected]>
Summary
test_12_tenant_isolation.py— multi-tenant isolation tests (criteria add banner #6-8)test_13_sandbox_connectivity.py— sandbox interactive access (criterion Add identity demos #2)mvpmarker (criteria add code of conduct and contributing #1, Fixed git clone typo #3, Add KeyCloak config demo script #4 already covered)mvppytest marker in conftest.pyTest plan
pytest -m mvpcollects all MVP-tagged testspytest kagenti/tests/e2e/openshell/test_12_tenant_isolation.py --collect-onlyshows 20 testse2e-openshell-kind.yamlruns with 2 tenants deployedkubectl auth can-iCloses #1362
Deferred criteria (#5, #9, #10, #11) tracked in #1479
Assisted-By: Claude Code