Skip to content

fix: security hardening across all shell scripts#7

Merged
Jense5 merged 1 commit into
mainfrom
Jense5/security-audit
Mar 27, 2026
Merged

fix: security hardening across all shell scripts#7
Jense5 merged 1 commit into
mainfrom
Jense5/security-audit

Conversation

@Jense5
Copy link
Copy Markdown
Contributor

@Jense5 Jense5 commented Mar 27, 2026

Summary

Full security audit and remediation of all shell scripts, addressing critical through low severity issues across 15 files:

  • Eliminate code injection: replaced unsafe eval in lib/audit.sh with a safe quoted-argument parser; added module name validation in lib/profile.sh to block path traversal
  • Fix race conditions & resource leaks: atomic symlink creation in dotfiles module; temp file cleanup via EXIT trap in lib/state.sh; chmod 700 on state directory
  • Surface silent failures: brew bundle, mise install, sudo xcodebuild, and chmod 600 errors are now reported instead of swallowed by || true
  • Harden SSH config: quoted IdentityFile path; added key type/strength validation warning for DSA and short RSA keys; validated ZSH_BIN before writing to /etc/shells
  • Pin supply chain: bun@latestbun@1.2 in both profiles; documented install.sh trust model with verification instructions
  • Security defaults: enabled macOS firewall and screen lock on sleep

Test plan

  • Run shellcheck --severity=warning on all scripts (passes clean)
  • Run MBP_FORCE=1 mbp setup on a test machine and verify all modules complete
  • Verify mbp audit parses macOS defaults without eval
  • Confirm dotfile symlinks are created atomically
  • Confirm weak SSH key warning triggers with a test DSA key

🤖 Generated with Claude Code

…ilures

Full security audit and remediation across 14 files: replace unsafe eval
with safe arg parser in audit.sh, add module name validation, fix TOCTOU
race in dotfile symlinks, quote SSH config variables, add temp file cleanup
traps, surface masked errors in brew/mise, pin bun version, add SSH key
strength warnings, enable macOS firewall and screen lock defaults.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Jense5 Jense5 merged commit 9a14753 into main Mar 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant