Repository navigation
Add a test that an enrollment token cannot read a fenced key - #90
Merged
Merged
Conversation
Pin the enrolled arm of the scoped read decision: an enrollment token with a category grant gets not_found for a fenced key, after the same token reads an ordinary key in that category. Tests only.
|
Design gate skipped: the |
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.
Approved issue: none. This pull request changes tests only. If it fits, please label it
trivial, as CONTRIBUTING.md allows when there is no design to agree.What changes
This adds one test,
tests::connectors_contract::an_enrollment_token_does_not_reach_a_fenced_key, incrates/credentials-module/src/connectors_tests.rs. It pins the enrolled arm of the transfer-key fence in the scoped read decision (read_surface.rs:3947). An enrollment token with a category grant must getnot_foundfor a fenced key. First, the same token reads an ordinary key in the same category, so the test cannot pass because the token was dropped. No production code changes.How it was checked
I made 55 small changes to the scoped read decision and the store functions that it calls, one at a time, and ran both full suites (
credentials-coreandcredentials-module) for each change. Existing tests catch 47 of them, and 6 do not change the answer. This test catches one of the remaining two: with the enrolled fence removed, the request gets past the fence and fails later withkind_not_gettableinstead ofnot_found. I can attach the list of the 55 changes if it helps the review.On the head of this branch (master
7a1be58dplus this commit), on Linux:cargo fmt --all -- --checkandcargo clippy --workspace --all-targets -- -D warningspass.cargo test -p credentials-module --all-features --no-fail-fast: 1951 passed, 1 failed. The failure isshipped_binary_probe_requires_the_gate_export_and_distinguishes_the_seam_binary(tests/import_picker.rs:321). It needs a shipped binary that our runner does not have, and it fails the same way on the clean basef4313a9f.vault_access_approval_samples_regenerate_byte_for_bytefailed with "signal did not arrive within the wall-clock hang guard". It passed in the next full run.credentials-core. Its run had one failure only, theengine_tests.rs:1188test from Add regression tests for record renewal in credentials-core #88.AI helped write this draft.
Summary by cubic
Adds a test that pins the enrolled arm of the transfer-key fence in the scoped read decision, so an enrollment token with a category grant gets
not_foundfor a fenced key. The test first confirms the same token can read an ordinary key in the same category, so it fails if the token were dropped. Tests only; no production code changes.Written for commit 40ebc57. Summary will update on new commits.