Skip to content

auth: let the data-plane identity call the native file access RPCs - #1371

Merged
NancyKwongPerplexity merged 1 commit into
mainfrom
data-plane-native-file-access-authz
Nov 3, 2026
Merged

NancyKwongPerplexity merged 1 commit into
mainfrom
data-plane-native-file-access-authz

Conversation

@NancyKwongPerplexity

@NancyKwongPerplexity NancyKwongPerplexity commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Lets the data-plane edge identity call the two native file access RPCs that #1365 adds to space-api's activation listener. guest_bridge_method (crates/libs/common/svc/src/auth/k8s.rs) now admits /space.node.api.v1.NativeFileAccessApi/AuthorizeNativeFileRequest and /…/PrepareNativeFileCall on a Cluster-role listener, which is where the activation listener serves them.

Everything else stays refused for that identity:

  • the ingress activation RPCs (PrepareIngress, QueueImplicitWake);
  • any later NativeFileAccessApi method, which needs its own review;
  • both methods on a worker, which never serves them.

The caller must still appear in the listener's Cluster allowlist (SPACE_CLUSTER_API_AUTH_ALLOWED_SERVICE_ACCOUNTS). That is deployment configuration, unchanged here. Nothing calls the RPCs yet.

Validation

At this head (fe9375c8), on main at 0271415a:

  • Rebased onto api: serve native file access RPCs on the activation listener #1365's new head with no conflicts; the commit is unchanged (git range-diff reports it identical).
  • cargo fmt --all -- --check, scripts/generate-env-contract.sh --check, scripts/check-rust-error-policy.sh and scripts/source_guards/env_test_hook_boundary.py pass.
  • cargo clippy --locked --all-targets --all-features -p pplx-space-common-svc -- -D warnings passes.
  • cargo check --workspace --all-targets --locked passes.
  • cargo arch against main's baseline, renames and ARCHITECTURE.toml: 0 required findings and 112 advisory, the same findings as main.
  • cargo nextest run --config 'profile.test.package.pplx-space-api.opt-level=0' --all-features --all-targets, one package at a time, with Postgres and Redis from the nextest setup scripts and SPACE_CI_REQUIRE_TEST_DEPS=1: pplx-space-common-svc 134 passed; pplx-space-api 2189 passed, 1 skipped; pplx-space-native-files 2 passed; pplx-space-public-api-http 9 passed; pplx-space-data-plane-server 395 passed; pplx-space-internal-api-server 436 passed.

New test: auth::k8s::tests::data_plane_identity_may_ask_the_api_to_decide_native_file_requests. With the data-plane account in the Cluster allowlist, it checks that both methods are admitted, that a future method on the service and both ingress activation methods are PERMISSION_DENIED, and that a worker refuses the methods. Mutation check: with k8s.rs restored to its previous version, the test fails on the first admitted method with PermissionDenied: guest-bridge service account is not allowed for this node-api method.

Kind ran before the rebase, at c38e35fc on main at 55174478. The rebase changed nothing in this PR, so it was not rerun. Kind (Firecracker, Kubernetes substrate) on a Linux KVM devbox: scripts/tests/smoke-kind-typed.sh native with SPACE_SMOKE_KIND_ADMIN_TOKEN_FILE set.

Head Result
main (55174478) 35 passed, 0 warned, 0 failed, 0 inconclusive
this PR (c38e35fc) 35 passed, 0 warned, 0 failed, 0 inconclusive

Both runs executed the same 35 scenarios, each with exit 0, so Native behaviour is unchanged, as expected with nothing calling the RPCs. The only file scenario in the native inventory is native_contract.file_idempotency_conflict, so this run does not exercise the new RPCs.

Severity and risk

Severity: does not apply (authorization for an RPC with no caller).

Risk: this widens what the data-plane identity may call by exactly the two named methods on Cluster-role listeners. space-api's activation listener is the only one that serves them; on the internal API's cluster listener they are unimplemented. To roll back, revert this PR.

Rollout

To take effect, a deployment must also list the data-plane service account in the activation listener's Cluster allowlist and let the data plane reach the listener. That is deployment configuration, outside this repository.

Stack

This is PR 5 of 5 and depends on native-file-access-rpcs (#1365). Merge in order: #1362, #1363, #1364, #1365, then this PR.

AI assistance: Claude Code drafted the code, tests, and this description; the author reviewed them.

@nikhilbirmiwal-pplx nikhilbirmiwal-pplx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked that guest_bridge_method admits exactly the two NativeFileAccessApi methods only on Cluster-role policies (activation listener), with ingress activation RPCs, other methods, and Worker roles still denied; caller must still pass the Cluster allowlist.

@NancyKwongPerplexity
NancyKwongPerplexity force-pushed the data-plane-native-file-access-authz branch from c38e35f to fe9375c Compare November 3, 2026 19:40
Base automatically changed from native-file-access-rpcs to main November 3, 2026 21:52
Allow the guest-bridge (data-plane edge) service accounts to call
NativeFileAccessApi's AuthorizeNativeFileRequest and
PrepareNativeFileCall on a Cluster-role listener, which is where
space-api's activation listener serves them. Every other method there,
including the ingress activation RPCs and any later NativeFileAccessApi
method, stays refused for that identity, and a worker grants it none of
them.

The caller must still be in the listener's Cluster allowlist
(SPACE_CLUSTER_API_AUTH_ALLOWED_SERVICE_ACCOUNTS); that is deployment
configuration and unchanged here. Nothing calls the RPCs yet.
@NancyKwongPerplexity
NancyKwongPerplexity force-pushed the data-plane-native-file-access-authz branch from fe9375c to d078cb5 Compare November 3, 2026 21:53
@NancyKwongPerplexity
NancyKwongPerplexity added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit 117e050 Nov 3, 2026
23 checks passed
@NancyKwongPerplexity
NancyKwongPerplexity deleted the data-plane-native-file-access-authz branch November 3, 2026 22:25
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.

2 participants