Closed
Conversation
- Drop legacy --source and force `gitleaks git --pre-commit`. - Add `--log-level=error` and `--no-color` to suppress noisy stderr. - Keep `pass_filenames: false` to prevent filename injection.
…f-first precommit, and secure subprocess handling This major refactor replaces legacy shell-based behavior with a maintainable, testable Python CLI. Key improvements: - Introduces src/caulking/cli.py and config.py built with Typer. - Adds SAFE_BINS validation, absolute-path enforcement, and shell=False subprocess calls for Bandit-safe execution. - Implements global guarded pre-commit hook with Ruff-first enforcement and gitleaks fallback. - Adds uninstall and bootstrap-client to transition cleanly from prior global hooks. - Ensures compatibility with uv, pytest, Ruff, Bandit, and mypy (strict typing enabled). - Updates pyproject.toml with types-PyYAML and dev extras for full lint/test coverage. - Removes obsolete Concourse CI and shell scaffolding. Validation: - Ruff: clean - mypy (strict): clean - Bandit: clean with targeted nosec on validated calls - pytest: all tests passing
6461197 to
1cf7fce
Compare
Start fresh with a minimal, maintainable workflow set: - Add .github/workflows/codeql.yml (Python-only analysis, minimal permissions). - Add .github/workflows/ci.yml (ruff, mypy --strict, bandit, pytest via uv). - Add .github/workflows/pre-commit.yml (run hooks on PRs). - Drop outdated workflows tied to the prior bash-era layout. Rationale: - Old workflows didn’t cover CodeQL and no longer matched the repository shape. - CodeQL was failing when .github/ disappeared and when Actions analysis misfired. - Keeping CodeQL focused on Python avoids false failures and keeps runs fast. Notes: - Uses current non-deprecated actions: actions/checkout@v5, actions/setup-python@v6, actions/cache@v4, github/codeql-action@v4, astral-sh/setup-uv@v7. - Permissions are minimal; no extra scopes granted. Signed-off-by: William Zujkowski <william.zujkowski@gsa.gov>
1cf7fce to
d138d65
Compare
Contributor
|
THIS IS EXCITING! I'll try to set aside some time in the next week to test it out. Instead of doing this as a PR, would it make sense to rename the existing repo to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request modernizes Caulking from its original shell-based implementation into a maintainable, testable Python application that’s easier to extend, audit, and standardize across environments.
The goal of this rewrite is not to replace the spirit of the original tool — which served us well — but to carry its intent forward with stronger type safety, clearer modularity, and a cleaner developer experience.
Changes Proposed in This Pull Request
🧱 Core Rewrite
Converted Caulking’s logic from shell scripts to a proper Python 3 package using Typer for the CLI.
Introduced
src/caulking/with clean module boundaries:installer.py,doctor.py,audit.py,config.py,manifest.py, andcli.pyAdded
pytest-based test coverage undertests/with strict typing (mypy --strict) and security linting (bandit).🧩 Modernized Hook Management
caulking smart-installdetects repo languages (Python, Node, Go, Rust, etc.) and builds or merges a.pre-commit-config.yamlautomatically.🔐 Security & Compliance Enhancements
rules/gitleaks.toml.caulking auditcommand to validate gitleaks installation, global hook enforcement, and overall secret-scanning health.🩺 Diagnostics & Quality of Life
New
caulking preflightcommand verifies thatgit,pre-commit, andgitleaksare properly installed and configured.New
caulking doctormodule provides environment sanity checks and actionable hints.Added
Makefilewith a consistent, developer-friendly command suite:make lint,make type,make sec,make test,make audit, etc.🧹 Legacy Compatibility
Legacy scripts are still available under
scripts/and can safely be uninstalled with:The migration preserves configuration files and automatically backs up modified rc files.
🧪 Testing & Tooling
uvfor reproducible environments and dependency pinning.shell=False), ensuring safe execution across platforms.Repository Layout Before → After
scripts/src/caulking/caulking install,caulking audit,caulking smart-installuv-based reproducible environmentsSecurity Considerations
shell=False), eliminating injection risks.MEDIUM/HIGH) and Ruff (security,bugbear,pycodestyle) rules enforced on every run.~/.caulking-smart-install-backup.How to Test
For legacy environments:
Notes for Reviewers
src/caulking/installer.py,src/caulking/cli.py, and the updatedMakefilefirst to understand the new flow.Acknowledgements
Huge thanks to the original Caulking authors — the design and intent of the original bash implementation directly informed this rewrite. This work builds on their foundation to ensure Caulking continues to be a reliable, lightweight defense mechanism for developers and security teams alike.
Would you like me to generate the corresponding commit message summary block (the single-line + extended format suitable for
git commit --amend) to match this PR?