Repository navigation
fix(policy): protect the OCI CLI directory in the credential floor - #60
Conversation
~/.oci holds the Oracle Cloud CLI config and its API signing key (oci_api_key.pem), but was missing from CREDENTIAL_COMPONENTS, so an agent with file access could read it. Add it beside .aws and .azure. Found by fede-kamel in openhuman#8182.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Tiny Sweeper reviewReviewed head: Verdict: Ready for maintainer review · Priority: none Diagnostics and supporting detailsFull summaryPull request purpose (title): fix(policy): protect the OCI CLI directory in the credential floor. Purpose (from the pull-request title): protect the OCI CLI directory in the credential floor. The pull request adds `.oci` to the credential floor's protected directory vocabulary so `ProtectedPath2` and the floor vocabulary refuse any path with a `.oci` component, closing the gap where the Oracle Cloud CLI's config and API signing key (`oci_api_key.pem`) were readable while `.aws` and `.azure` were already covered. The entry is a directory, so it joins `CREDENTIAL_COMPONENTS` rather than the file stores, and it is additive and non-breaking because the vocabulary and `gap::credential_roots()` derive from that constant. Existing tests are extended to pin the new entry. The latest-push delta is unavailable, so no push-delta comparison is described. Review snapshot
Completeness: Complete What changed`CREDENTIAL_COMPONENTS` in `crates/tinysecurity-policy/src/path.rs` gains a `.oci` entry among the directory components, so the derived floor vocabulary now refuses paths containing a `.oci` component, case-insensitively and with either separator. The vocabulary test in `crates/tinysecurity-policy/src/floor_tests.rs` now lists `.oci` among expected directory components, and `crates/tinysecurity-policy/src/path_scope_host_port_tests.rs` adds `.oci` refused-path cases including a case variant and a Windows spelling. Features
Tests
FindingsNo active actionable findings. Before mergeNone. Agent review detailscritique
security
tests
commits
description
Evidence and run details
|
Summary
Adds
~/.ocito the credential floor's protected directories. The Oracle Cloud CLI keeps its config and its API signing key (oci_api_key.pem) there, and an agent with file access could read them:.awsand.azurewere covered,.ociwas not. It is a directory, so it joinsCREDENTIAL_COMPONENTS, notCREDENTIAL_FILE_STORES.Related issue
Closes #59. The gap was found by fede-kamel in openhuman#8182, which was closed because the floor now lives here.
API or behavior changes
ProtectedPath2and the floor vocabulary now refuse any path with a.ocicomponent (case-insensitive, either separator). It's additive and not breaking. Hosts that takegap::credential_roots()pick it up when they bump the pin.Validation
Commands actually run, on our Linux CI runner (rustc 1.99.1,
--locked) at 1dfb924:cargo fmt --all -- --check: cleancargo clippy --all-targets --all-features -- -D warnings: 0 warningscargo test -p tinysecurity-policy --all-features: 285 passed, 0 failed (lib 268)cargo test --all-features: 1362 passed, 0 failed (main 24921ba: the same 1362, 0 failed)".oci"line removed, exactly the two tests below fail (266 passed, 2 failed).Tests
vocabulary_splits_directories_from_files_and_keeps_every_constantnow lists.oci.sensitive_files_and_directories_are_refused_case_insensitivelyadds~/.oci/config,~/.OCI/oci_api_key.pemand a WindowsC:\Users\u\.oci\oci_api_key.pem.Documentation
Not needed. No document lists the floor's components; the vocabulary is served by
ProtectedFloor2.Checklist
#[allow(...)],#[ignore], or relaxed lints.envcontents in the diff or the description