git-security-tool 0.1.1__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/PKG-INFO +66 -25
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/README.md +65 -24
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/__init__.py +1 -1
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/.github/workflows/ci.yml +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/.github/workflows/release.yml +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/.github/workflows/scan.reusable.yml +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/.gitignore +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/ARCHITECTURE.md +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/CLAUDE.md +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/LICENSE +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/pyproject.toml +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/scripts/probe.sh +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/__main__.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/baseline.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/cli.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/config/__init__.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/config/loader.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/git/__init__.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/git/diff.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/git/hooks.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/git/repository.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/ignore.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/installer/__init__.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/installer/dependencies.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/installer/git_hook.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/models/__init__.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/models/finding.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/policy/__init__.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/policy/engine.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/reporter/__init__.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/reporter/sarif.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/reporter/terminal.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/rules/__init__.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/rules/semgrep/crypto_tls.yml +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/rules/semgrep/deserialization.yml +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/rules/semgrep/filesystem_net.yml +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/rules/semgrep/injection.yml +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/rules/semgrep/web.yml +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/scan.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/scanners/__init__.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/scanners/base.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/scanners/gitleaks.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/scanners/ruff.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/scanners/semgrep.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/suggestions/__init__.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/suggestions/llm.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/suggestions/providers.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/tests/test_baseline.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/tests/test_cli.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/tests/test_config.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/tests/test_diff.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/tests/test_ignore.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/tests/test_installer.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/tests/test_policy.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/tests/test_providers.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/tests/test_rules.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/tests/test_sarif.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/tests/test_scan.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/tests/test_scanners.py +0 -0
- {git_security_tool-0.1.1 → git_security_tool-0.1.2}/tests/test_suggestions.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: git-security-tool
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: Local Git security and code-quality gate that runs on pre-commit.
|
|
5
5
|
Project-URL: Homepage, https://github.com/MustafaBasit521/commit-guard
|
|
6
6
|
Project-URL: Issues, https://github.com/MustafaBasit521/commit-guard/issues
|
|
@@ -72,26 +72,82 @@ $ git commit -m "add config loader"
|
|
|
72
72
|
GIT_SECURITY_NO_BLOCK=1 to override
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
-
##
|
|
75
|
+
## Add it to a project
|
|
76
|
+
|
|
77
|
+
### 1. Install the tool (once per machine)
|
|
78
|
+
|
|
79
|
+
The pre-commit hook runs `git-security-tool` from your `PATH`, so install it
|
|
80
|
+
somewhere permanent — [pipx](https://pipx.pypa.io/) is cleanest:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
pipx install "git-security-tool[scanners]" # isolated, always on PATH
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Or into a virtualenv you keep active / on `PATH`:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
pip install "git-security-tool[scanners]"
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Then add **Gitleaks** (a Go binary, not on PyPI) for secret detection —
|
|
93
|
+
[download a release](https://github.com/gitleaks/gitleaks/releases) and put
|
|
94
|
+
it on `PATH`. The scan silently skips any scanner that isn't installed.
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
git-security-tool check # confirms hook status + which scanners are present
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### 2. Turn on the hook (once per repo)
|
|
76
101
|
|
|
77
102
|
```bash
|
|
78
|
-
pip install "git-security-tool[scanners]" # tool + ruff + semgrep
|
|
79
103
|
cd your-repo
|
|
80
|
-
git-security-tool install
|
|
104
|
+
git-security-tool install # writes .git/hooks/pre-commit
|
|
81
105
|
```
|
|
82
106
|
|
|
83
|
-
|
|
84
|
-
|
|
107
|
+
`.git/hooks/` is not version-controlled, so every clone / machine runs this
|
|
108
|
+
once. `git-security-tool uninstall` removes it; `--force` replaces a hook
|
|
109
|
+
you didn't create.
|
|
85
110
|
|
|
86
|
-
|
|
111
|
+
### 3. (existing repo) Baseline what's already there
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
git-security-tool scan --all # see what it finds first
|
|
115
|
+
git-security-tool baseline # grandfather those findings
|
|
116
|
+
git add .git-security-tool-baseline.json && git commit -m "add security baseline"
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
New issues still block — only the pre-existing ones are ignored.
|
|
120
|
+
|
|
121
|
+
### 4. Add the CI check
|
|
122
|
+
|
|
123
|
+
Local hooks can be skipped (`--no-verify`) or missing on a teammate's
|
|
124
|
+
machine, so CI is the real enforcement. Create
|
|
125
|
+
`.github/workflows/security.yml`:
|
|
126
|
+
|
|
127
|
+
```yaml
|
|
128
|
+
name: security
|
|
129
|
+
on: [push, pull_request]
|
|
130
|
+
jobs:
|
|
131
|
+
security:
|
|
132
|
+
uses: MustafaBasit521/commit-guard/.github/workflows/scan.reusable.yml@main
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
That reusable workflow installs the tool + Gitleaks and runs
|
|
136
|
+
`git-security-tool scan --all` over the whole repo.
|
|
137
|
+
|
|
138
|
+
### 5. (optional) Tune it — `.git-security-tool.toml`
|
|
139
|
+
|
|
140
|
+
See [Configuration](#configuration--git-security-tooltoml-optional-repo-root)
|
|
141
|
+
below: severity threshold, disable a scanner, ignore paths, AI suggestions.
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
**Commands:** `scan [--all] [--format sarif]`, `baseline`, `install [--force]`,
|
|
87
146
|
`uninstall`, `check`, `version`.
|
|
88
147
|
|
|
89
148
|
- `scan` — staged changes (pre-commit)
|
|
90
149
|
- `scan --all` — every tracked file (CI / audit); `--format sarif` emits SARIF
|
|
91
150
|
on stdout for GitHub code scanning
|
|
92
|
-
- `baseline` — records current findings to `.git-security-tool-baseline.json`
|
|
93
|
-
so an existing repo can adopt the tool without fixing everything first;
|
|
94
|
-
new issues still block
|
|
95
151
|
|
|
96
152
|
Verify the ruleset end to end: `./scripts/probe.sh` (checks all 17 rules +
|
|
97
153
|
secret detection in a throwaway repo).
|
|
@@ -142,21 +198,6 @@ to the API, and secret-bearing files are never sent.
|
|
|
142
198
|
| `gemini` | `GEMINI_API_KEY` | none (stdlib HTTP) |
|
|
143
199
|
| `anthropic` | `ANTHROPIC_API_KEY` | `pip install "git-security-tool[ai]"` |
|
|
144
200
|
|
|
145
|
-
## CI (the second layer)
|
|
146
|
-
|
|
147
|
-
Local hooks can be skipped (`--no-verify`) or simply not installed on a
|
|
148
|
-
teammate's machine, so CI is the enforcement layer. This repo ships a
|
|
149
|
-
reusable workflow:
|
|
150
|
-
|
|
151
|
-
```yaml
|
|
152
|
-
# .github/workflows/security.yml in your project
|
|
153
|
-
name: security
|
|
154
|
-
on: [push, pull_request]
|
|
155
|
-
jobs:
|
|
156
|
-
security:
|
|
157
|
-
uses: MustafaBasit521/commit-guard/.github/workflows/scan.reusable.yml@main
|
|
158
|
-
```
|
|
159
|
-
|
|
160
201
|
## Overrides
|
|
161
202
|
|
|
162
203
|
- `GIT_SECURITY_NO_BLOCK=1 git commit …` — run the scan, report, never block.
|
|
@@ -43,26 +43,82 @@ $ git commit -m "add config loader"
|
|
|
43
43
|
GIT_SECURITY_NO_BLOCK=1 to override
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
##
|
|
46
|
+
## Add it to a project
|
|
47
|
+
|
|
48
|
+
### 1. Install the tool (once per machine)
|
|
49
|
+
|
|
50
|
+
The pre-commit hook runs `git-security-tool` from your `PATH`, so install it
|
|
51
|
+
somewhere permanent — [pipx](https://pipx.pypa.io/) is cleanest:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
pipx install "git-security-tool[scanners]" # isolated, always on PATH
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Or into a virtualenv you keep active / on `PATH`:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
pip install "git-security-tool[scanners]"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Then add **Gitleaks** (a Go binary, not on PyPI) for secret detection —
|
|
64
|
+
[download a release](https://github.com/gitleaks/gitleaks/releases) and put
|
|
65
|
+
it on `PATH`. The scan silently skips any scanner that isn't installed.
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
git-security-tool check # confirms hook status + which scanners are present
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 2. Turn on the hook (once per repo)
|
|
47
72
|
|
|
48
73
|
```bash
|
|
49
|
-
pip install "git-security-tool[scanners]" # tool + ruff + semgrep
|
|
50
74
|
cd your-repo
|
|
51
|
-
git-security-tool install
|
|
75
|
+
git-security-tool install # writes .git/hooks/pre-commit
|
|
52
76
|
```
|
|
53
77
|
|
|
54
|
-
|
|
55
|
-
|
|
78
|
+
`.git/hooks/` is not version-controlled, so every clone / machine runs this
|
|
79
|
+
once. `git-security-tool uninstall` removes it; `--force` replaces a hook
|
|
80
|
+
you didn't create.
|
|
56
81
|
|
|
57
|
-
|
|
82
|
+
### 3. (existing repo) Baseline what's already there
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
git-security-tool scan --all # see what it finds first
|
|
86
|
+
git-security-tool baseline # grandfather those findings
|
|
87
|
+
git add .git-security-tool-baseline.json && git commit -m "add security baseline"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
New issues still block — only the pre-existing ones are ignored.
|
|
91
|
+
|
|
92
|
+
### 4. Add the CI check
|
|
93
|
+
|
|
94
|
+
Local hooks can be skipped (`--no-verify`) or missing on a teammate's
|
|
95
|
+
machine, so CI is the real enforcement. Create
|
|
96
|
+
`.github/workflows/security.yml`:
|
|
97
|
+
|
|
98
|
+
```yaml
|
|
99
|
+
name: security
|
|
100
|
+
on: [push, pull_request]
|
|
101
|
+
jobs:
|
|
102
|
+
security:
|
|
103
|
+
uses: MustafaBasit521/commit-guard/.github/workflows/scan.reusable.yml@main
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
That reusable workflow installs the tool + Gitleaks and runs
|
|
107
|
+
`git-security-tool scan --all` over the whole repo.
|
|
108
|
+
|
|
109
|
+
### 5. (optional) Tune it — `.git-security-tool.toml`
|
|
110
|
+
|
|
111
|
+
See [Configuration](#configuration--git-security-tooltoml-optional-repo-root)
|
|
112
|
+
below: severity threshold, disable a scanner, ignore paths, AI suggestions.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
**Commands:** `scan [--all] [--format sarif]`, `baseline`, `install [--force]`,
|
|
58
117
|
`uninstall`, `check`, `version`.
|
|
59
118
|
|
|
60
119
|
- `scan` — staged changes (pre-commit)
|
|
61
120
|
- `scan --all` — every tracked file (CI / audit); `--format sarif` emits SARIF
|
|
62
121
|
on stdout for GitHub code scanning
|
|
63
|
-
- `baseline` — records current findings to `.git-security-tool-baseline.json`
|
|
64
|
-
so an existing repo can adopt the tool without fixing everything first;
|
|
65
|
-
new issues still block
|
|
66
122
|
|
|
67
123
|
Verify the ruleset end to end: `./scripts/probe.sh` (checks all 17 rules +
|
|
68
124
|
secret detection in a throwaway repo).
|
|
@@ -113,21 +169,6 @@ to the API, and secret-bearing files are never sent.
|
|
|
113
169
|
| `gemini` | `GEMINI_API_KEY` | none (stdlib HTTP) |
|
|
114
170
|
| `anthropic` | `ANTHROPIC_API_KEY` | `pip install "git-security-tool[ai]"` |
|
|
115
171
|
|
|
116
|
-
## CI (the second layer)
|
|
117
|
-
|
|
118
|
-
Local hooks can be skipped (`--no-verify`) or simply not installed on a
|
|
119
|
-
teammate's machine, so CI is the enforcement layer. This repo ships a
|
|
120
|
-
reusable workflow:
|
|
121
|
-
|
|
122
|
-
```yaml
|
|
123
|
-
# .github/workflows/security.yml in your project
|
|
124
|
-
name: security
|
|
125
|
-
on: [push, pull_request]
|
|
126
|
-
jobs:
|
|
127
|
-
security:
|
|
128
|
-
uses: MustafaBasit521/commit-guard/.github/workflows/scan.reusable.yml@main
|
|
129
|
-
```
|
|
130
|
-
|
|
131
172
|
## Overrides
|
|
132
173
|
|
|
133
174
|
- `GIT_SECURITY_NO_BLOCK=1 git commit …` — run the scan, report, never block.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/installer/dependencies.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/rules/semgrep/crypto_tls.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/rules/semgrep/injection.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/suggestions/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{git_security_tool-0.1.1 → git_security_tool-0.1.2}/src/git_security/suggestions/providers.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|