Skip to content

fix(policy): protect the OCI CLI directory in the credential floor - #60

Merged
senamakel merged 3 commits into
tinyhumansai:mainfrom
M3gA-Mind:fix/oci-credential-floor
Nov 12, 2026
Merged

senamakel merged 3 commits into
tinyhumansai:mainfrom
M3gA-Mind:fix/oci-credential-floor

Conversation

@M3gA-Mind

@M3gA-Mind M3gA-Mind commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds ~/.oci to 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: .aws and .azure were covered, .oci was not. It is a directory, so it joins CREDENTIAL_COMPONENTS, not CREDENTIAL_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

ProtectedPath2 and the floor vocabulary now refuse any path with a .oci component (case-insensitive, either separator). It's additive and not breaking. Hosts that take gap::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: clean
  • cargo clippy --all-targets --all-features -- -D warnings: 0 warnings
  • cargo 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)
  • Red control: with the ".oci" line removed, exactly the two tests below fail (266 passed, 2 failed).

Tests

  • vocabulary_splits_directories_from_files_and_keeps_every_constant now lists .oci.
  • sensitive_files_and_directories_are_refused_case_insensitively adds ~/.oci/config, ~/.OCI/oci_api_key.pem and a Windows C:\Users\u\.oci\oci_api_key.pem.

Documentation

Not needed. No document lists the floor's components; the vocabulary is served by ProtectedFloor2.

Checklist

  • The change is focused on one logical change
  • No new #[allow(...)], #[ignore], or relaxed lints
  • No secrets, tokens, or .env contents in the diff or the description

~/.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.
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1507f4cd-a0b8-4b50-b8a8-fda98810413e
Pre-merge checks: Passed 1 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Title check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
Passed Passed checks: 1 passed

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@tinysweeper

tinysweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

Reviewed head: f555538b51fcafe7c7a87ff81b511e5dea66fc97

Verdict: Ready for maintainer review · Priority: none
Coverage: Reviewed 3 of 3 files.
Pull request purpose (title): fix(policy): protect…

Diagnostics and supporting details

Full summary

Pull 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

Change surface Files Review signal Count
Production 1 Active findings 0
Tests 2 Noted findings 0
Documentation 0 Resolved findings 0
Configuration 0 Pending checks/questions 0

Completeness: Complete
Test assessment: Test coverage is assessed from changed tests and lane evidence; execution is not claimed without trusted check data.

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

  • Added — `.oci` added to the credential floor's protected directories: Paths containing a `.oci` component are now refused by `ProtectedPath2` and the floor vocabulary, protecting the Oracle Cloud CLI config and API signing key directory that was previously uncovered. Additive and non-breaking; hosts picking up `gap::credential_roots()` inherit it on a pin bump. (crates/tinysecurity-policy/src/path.rs pub(super) const CREDENTIAL_COMPONENTS: &[&str] = &[)

Tests

  • unit test update — `vocabulary_splits_directories_from_files_and_keeps_every_constant` now asserts `.oci` is present in the floor vocabulary's directory components, failing if the constant entry is removed.: Extends the existing vocabulary assertion to pin the new entry; the tests lane reports the assertion fails if the vocabulary entry is removed. (crates/tinysecurity-policy/src/floor_tests.rs fn every_vocabulary_entry_is_recognised_by_the_floor() {)
  • unit test update — `sensitive_files_and_directories_are_refused_case_insensitively` adds `/.oci/config`, `/.OCI/oci_api_key.pem`, and a Windows `C:\Users\u\.oci\oci_api_key.pem` to the refused-path cases.: Covers case-insensitive matching and both separator styles for the new component; the tests lane reports the new assertions fail if the constant were removed. (crates/tinysecurity-policy/src/path_scope_host_port_tests.rs fn sensitive_files_and_directories_are_refused_case_insensitively() {)

Findings

No active actionable findings.

Before merge

None.

Agent review details

critique

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: Reviewed 3 files; 0 findings. _The code index is behind this pull request (indexed at `45319ee51aa5`), so retrieved context may be out of date._

security

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: Reviewed 3 files; 0 findings. _The code index is behind this pull request (indexed at `45319ee51aa5`), so retrieved context may be out of date._

tests

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: Tests lane answered with no reportable defect, noting the new behaviour is pinned by assertions that would fail if the constant were removed, including case-insensitive and Windows forms.
  • Lane summary: The change adds `.oci` to the credential-store component list and extends the existing vocabulary and host-port tests to cover it, including case-insensitive and Windows forms. The new behaviour is pinned by assertions that would fail if the constant were removed, so the change looks sound; I found no reportable defect. _The code index is behind this pull request (indexed at `45319ee51aa5`), so retrieved context may be out of date._

commits

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: Commits lane answered with no sensitive content in committed files.
  • Lane summary: No sensitive content in committed files. _The code index is behind this pull request (indexed at `45319ee51aa5`), so retrieved context may be out of date._

description

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: Description lane answered with no defects, confirming the diff matches the description: `.oci` flows through `credential_store`, `floor_vocabulary`, `credential_roots` and `path_subtree`'s overlap check, and the two touched tests are updated consistently.
  • Lane summary: The change adds `.oci` to `CREDENTIAL_COMPONENTS`, which flows through `credential_store`, `floor_vocabulary`, `credential_roots` and `path_subtree`'s overlap check, and the two touched tests are updated consistently with the vocabulary-length assertion. The description matches the diff accurately; no defects found. _The code index is behind this pull request (indexed at `45319ee51aa5`), so retrieved context may be out of date._
Evidence and run details
  • Models: ladder/vectors-oai3, deepseek-v4.1-flash
  • Spend: $0.005220
  • Tokens: 369916 input · 5240 output · 103936 cached · 105 embedding
  • Updated: 2026-11-11T15:17:20Z
Head State Pass summary
1dfb9246a58c ready for maintainer review 0 active finding(s), 0 resolved finding(s) (at 2026-11-11T10:29:15Z)
02e4131b0e3e ready for maintainer review 0 active finding(s), 0 resolved finding(s) (at 2026-11-11T13:05:27Z)
f555538b51fc ready for maintainer review 0 active finding(s), 0 resolved finding(s) (at 2026-11-11T15:17:20Z)

tinysweeper 0.1.2

@tinysweeper tinysweeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

tinysweeper found nothing blocking. Approving.

Diagnostics

Total spend: $0.0054

@senamakel
senamakel merged commit 7f023ba into tinyhumansai:main Nov 12, 2026
26 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Protect the OCI credential directory (~/.oci) in the credential floor

2 participants