Commit Graph

29 Commits

Author SHA1 Message Date
Flo
5bd5a74df9 fix: SSH permissions test failing in Linux containers
Use if/else for stat format detection instead of || which can fail
under set -e. Remove run wrapper for apply_ssh_config.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-31 18:29:40 +02:00
Flo
1e11105b5c feat: add --skip-host flag to e2e.sh
Skip host interactive tests when only running containers.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-31 18:11:18 +02:00
Flo
1795661975 fix: e2e.sh unbound variable on empty build_args
Use ${arr[@]+"${arr[@]}"} pattern for nounset-safe empty array expansion.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-31 18:08:21 +02:00
Flo
dd6257985b fix: v0.2.3 e2e distro loop, FIDO2 freeze, grouped prompts
Fix e2e.sh distro iteration broken by IFS setting (use bash array).
Fix FIDO2 detection freezing on macOS (check ssh-sk-helper, don't
invoke ssh-keygen). Group apply prompts into 6 categories. Fix Linux
gitleaks install hint.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-31 18:05:19 +02:00
Flo
e24206e0b5 chore: release v0.2.2
Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-31 17:49:15 +02:00
Flo
d8e7665e72 fix: FIDO2 detection no longer freezes on macOS
Detect Homebrew openssh by checking for ssh-sk-helper binary instead
of running ssh-keygen (which blocks waiting for a FIDO touch).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-31 17:47:11 +02:00
Flo
475faf23df fix: v0.2.1 FIDO2 macOS keygen, grouped prompts, Linux hints
Use Homebrew ssh-keygen for FIDO2 key generation on macOS instead of
searching for libsk-libfido2.dylib (removed in modern openssh). Group
interactive apply prompts into 6 categories with explanations. Fix
Linux gitleaks install hint to show apt/dnf instead of brew.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-31 17:39:14 +02:00
Flo
09f6369bec refactor: group apply prompts with explanations
Replace ~25 individual y/n prompts with 6 logical groups, each showing
a table of pending changes with one-line explanations before prompting.
Also fix FIDO2 middleware detection (needs brew openssh, not just libfido2).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-31 15:30:00 +02:00
Flo
8037cb7908 feat: v0.2.0 expanded hardening
Add gitleaks pre-commit hook, global gitignore, plaintext credential
detection, SSH key hygiene audit, 8 new git config settings, and
safe.directory wildcard detection. Fix ssh-keygen macOS compatibility,
FIDO2 detection via ioreg, and interactive test isolation.

Implements docs/specs/2026-03-31-v0.2.0-expanded-hardening.md

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-31 14:03:29 +02:00
Flo
0e6d04fefb feat: add host-side interactive tests for macOS coverage
Add test/run-interactive.sh that runs tmux interactive tests on
the host in an isolated HOME. Covers macOS ssh-keygen which
cannot be tested in Linux containers. e2e.sh now runs host
interactive tests first, then container matrix. Skips gracefully
if tmux is not installed.

Closes: #23

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-31 12:41:08 +02:00
Flo
26ea0bc106 fix: run interactive tmux tests in e2e pipeline
e2e.sh now runs both BATS and interactive tests per distro:
build -> BATS -> interactive. Failure stage shown in summary.

Closes: #22

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-31 11:39:43 +02:00
Flo
f1b9d0183d feat: add e2e container test harness
Implements spec docs/specs/2026-03-30-e2e-container-tests.md:
- 5 Containerfiles (ubuntu, debian, fedora, alpine, arch)
- test/e2e.sh runner with --runtime, --rebuild, single-distro mode
- tmux-based interactive tests (full accept, safety gate decline,
  signing generate, signing skip)
- All scripts pass shellcheck

Closes: #18, #19, #20

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-31 11:30:40 +02:00
Flo
2ff3a1a56c chore: finalize CHANGELOG for v0.1.0
Add security items from post-bump hygiene fixes to the 0.1.0
changelog entry.

Closes: #16

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
v0.1.0
2026-03-31 00:24:46 +02:00
Flo
0cc6f76be2 fix: minor hygiene from code review
Remove unused SIGNING_KEY_PATH variable (dead code), add trap for
temp file cleanup in apply_ssh_directive, add -- separator before
ssh-keygen path arguments, add info message when falling back to
in-memory credential cache on Linux.

Closes: #15

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-31 00:23:55 +02:00
Flo
93887f0d68 docs: update README for v0.1.0
Add safety review gate description, OSINT signing key advisory,
test running instructions, per-org signing key recommendation,
and fix placeholder URL in quick start.

Closes: #14

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-31 00:18:21 +02:00
Flo
6bed9e3e0d chore: bump version to v0.1.0
Initial release of git-harden.sh with audit/apply modes, SSH signing
wizard, FIDO2 support, SSH config hardening, safety review gate,
and 64 BATS tests.

Closes: #13

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-31 00:12:57 +02:00
Flo
0af4409467 feat: add OSINT advisory about signing key reuse
Warn users in the signing wizard that reusing the same signing key
across personal and work accounts enables cross-platform identity
correlation. Recommend separate keys per org with git includeIf.
Also added to admin recommendations section.

Closes: #12

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-31 00:00:14 +02:00
Flo
e7c29c62c3 fix: safety gate defaults to no, fix gemini CLI syntax
Change prompt default from Y to N so users must explicitly opt in.
Fix gemini command to use -p flag for non-interactive stdin mode.
Consolidate review prompt text into a variable.

Closes: #11

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-30 23:51:27 +02:00
Flo
6dd2e6aec8 docs: update e2e spec for safety review gate
Add safety gate prompt to all interactive tmux scenarios, add new
"safety gate decline" test scenario, update acceptance criteria.

Closes: #10

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-30 23:47:11 +02:00
Flo
902d1abac0 fix: force base-10 in version_gte to prevent octal interpretation
Use 10#$var arithmetic prefix to avoid bash interpreting leading
zeros as octal (e.g., 08 or 09 would cause "value too great for
base" errors). 2 new tests (64 total).

Closes: #9

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-30 23:45:04 +02:00
Flo
d204ae5a9a fix: version parsing and SSH config comment/quote handling
Replace sed 's/[^0-9.]//g' with grep -oE for semver extraction —
fixes breakage on Apple Git suffix and rc versions. Add
strip_ssh_value() helper to strip inline comments and surrounding
quotes from SSH config values. Applied to IdentityFile scanning,
audit_ssh_directive, and apply_ssh_directive. 9 new tests (62 total).

Closes: #8

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-30 23:40:51 +02:00
Flo
b227ec1f73 feat: add pre-execution safety review prompt
Asks users to confirm they've reviewed the script before it modifies
config. On decline, prints instructions for piping the script to
Claude Code or Gemini CLI for a security review. Skipped with -y
and --audit flags. 3 new tests (53 total).

Closes: #7

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-30 23:20:54 +02:00
Flo
5e8a34ef68 test: add BATS test suite with 50 tests
Covers arg parsing, version comparison, audit phase (git config,
signing, SSH), apply phase (settings, SSH directives, url rewrite),
signing key detection (standard/custom/tilde/sk-preference),
allowed signers, -y mode, backup, and end-to-end idempotency.
All tests run in isolated HOME to avoid touching real config.

Closes: #6

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-30 23:10:57 +02:00
Flo
da2ffea132 docs: add README with usage, settings, and threat model
Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-30 14:00:04 +02:00
Flo
078d55982b chore: Add agentic coding tooling 2026-03-30 13:39:40 +02:00
Flo
2a5302388e feat(git-harden): implement git-harden.sh script
Interactive shell script that audits and hardens global git config.
Implements the design spec with: object integrity checks, protocol
restrictions, filesystem protection, hook redirection, SSH signing
wizard with FIDO2 support, SSH config hardening, and credential
helper detection. Supports --audit, -y, and interactive modes.

Implements: #5

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-30 13:38:34 +02:00
Flo
10465dac24 Address external review feedback
Add Bash 3.2 compatibility constraint (macOS ships ancient bash),
add config backup before applying changes, preserve ssh-keygen stderr
during FIDO2 key generation, verify key file before enabling signing
in -y mode.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 16:56:01 +01:00
Flo
9b7cfd8f3b Address spec review findings
Fix incorrect CVE reference for core.fsmonitor, clarify bash/zsh
compatibility (shebang is bash, works from zsh sessions), fix -y mode
signing behavior to not break commits when no key exists, clarify
submodule.recurse scope, add pull.rebase conflict warning, improve
SSH config and credential helper detection specifics, add FIDO2
touch prompt, and clarify audit exit code for missing signing keys.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 14:40:29 +01:00
Flo
1efd68a408 Add design spec for git-harden.sh
Interactive shell script that audits and hardens global git config
with security-focused defaults: object integrity, protocol restrictions,
filesystem protection, hook control, SSH signing with FIDO2 support,
and credential security.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 13:50:43 +01:00