Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .jules/sentinel.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
# Sentinel Journal

## 2026-04-15 - Prevent TOCTOU in SSH Key Restoration

**Vulnerability:** A Time-of-Check to Time-of-Use (TOCTOU) vulnerability where an
SSH private key is briefly world-readable upon creation before `chmod 600` is
applied.

**Learning:** Redirecting output to a file creates the file with default
permissions (often `644`), which exposes sensitive data for a fraction of a
second.

**Prevention:** Wrap commands that create sensitive files in a subshell using
`umask 077` to ensure the file is created with secure permissions (`600`)
natively.
# Sentinel Security Journal

Check failure on line 16 in .jules/sentinel.md

View workflow job for this annotation

GitHub Actions / Lint Documentation

Multiple top-level headings in the same document

.jules/sentinel.md:16 MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "# Sentinel Security Journal"] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md025.md

Check failure on line 16 in .jules/sentinel.md

View workflow job for this annotation

GitHub Actions / Lint Documentation

Headings should be surrounded by blank lines

.jules/sentinel.md:16 MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Above] [Context: "# Sentinel Security Journal"] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md022.md

## 2026-04-16 - Prevent TOCTOU and Symlink Attacks via Insecure Temporary Directories

Expand Down
2 changes: 1 addition & 1 deletion tools/setup-ssh-keys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ cmd_restore() {
chmod 700 "$SSH_DIR"

# Read private key from 1Password and save locally
op read "op://$VAULT/$KEY_NAME/private_key" > "$PRIVATE_KEY_FILE"
(umask 077 && op read "op://$VAULT/$KEY_NAME/private_key" > "$PRIVATE_KEY_FILE")
chmod 600 "$PRIVATE_KEY_FILE"

# Read public key from 1Password and save locally
Expand Down
Loading