leakkill 0.4.0__tar.gz → 0.4.1__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.
- {leakkill-0.4.0/src/leakkill.egg-info → leakkill-0.4.1}/PKG-INFO +1 -1
- {leakkill-0.4.0 → leakkill-0.4.1}/src/leakkill/__init__.py +1 -1
- {leakkill-0.4.0 → leakkill-0.4.1}/src/leakkill/cli.py +13 -1
- {leakkill-0.4.0 → leakkill-0.4.1/src/leakkill.egg-info}/PKG-INFO +1 -1
- {leakkill-0.4.0 → leakkill-0.4.1}/tests/test_cli.py +13 -0
- {leakkill-0.4.0 → leakkill-0.4.1}/LICENSE +0 -0
- {leakkill-0.4.0 → leakkill-0.4.1}/README.md +0 -0
- {leakkill-0.4.0 → leakkill-0.4.1}/pyproject.toml +0 -0
- {leakkill-0.4.0 → leakkill-0.4.1}/setup.cfg +0 -0
- {leakkill-0.4.0 → leakkill-0.4.1}/src/leakkill/__main__.py +0 -0
- {leakkill-0.4.0 → leakkill-0.4.1}/src/leakkill/aws.py +0 -0
- {leakkill-0.4.0 → leakkill-0.4.1}/src/leakkill/guard.py +0 -0
- {leakkill-0.4.0 → leakkill-0.4.1}/src/leakkill/providers.py +0 -0
- {leakkill-0.4.0 → leakkill-0.4.1}/src/leakkill/report.py +0 -0
- {leakkill-0.4.0 → leakkill-0.4.1}/src/leakkill/scanner.py +0 -0
- {leakkill-0.4.0 → leakkill-0.4.1}/src/leakkill.egg-info/SOURCES.txt +0 -0
- {leakkill-0.4.0 → leakkill-0.4.1}/src/leakkill.egg-info/dependency_links.txt +0 -0
- {leakkill-0.4.0 → leakkill-0.4.1}/src/leakkill.egg-info/entry_points.txt +0 -0
- {leakkill-0.4.0 → leakkill-0.4.1}/src/leakkill.egg-info/top_level.txt +0 -0
- {leakkill-0.4.0 → leakkill-0.4.1}/tests/test_guard.py +0 -0
- {leakkill-0.4.0 → leakkill-0.4.1}/tests/test_providers.py +0 -0
- {leakkill-0.4.0 → leakkill-0.4.1}/tests/test_scanner.py +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""leakkill: find leaked secrets, check if they're live, revoke them, and guard AI coding agents."""
|
|
2
|
-
__version__ = "0.4.
|
|
2
|
+
__version__ = "0.4.1"
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
Common options: --staged (pre-commit), --history (all commits), --exclude-tests, --json.
|
|
12
12
|
Ignore a line with `leakkill:ignore`; ignore paths with globs in .leakkillignore.
|
|
13
13
|
"""
|
|
14
|
-
import argparse, json, os, sys
|
|
14
|
+
import argparse, difflib, json, os, sys
|
|
15
15
|
from concurrent.futures import ThreadPoolExecutor
|
|
16
16
|
from dataclasses import dataclass
|
|
17
17
|
|
|
@@ -189,6 +189,16 @@ def parser():
|
|
|
189
189
|
return p
|
|
190
190
|
|
|
191
191
|
|
|
192
|
+
def check_paths(paths):
|
|
193
|
+
"""A security tool must never report 'Clean.' for something it didn't scan (e.g. a typo'd command)."""
|
|
194
|
+
missing = [p for p in paths if not os.path.exists(p)]
|
|
195
|
+
for p in missing:
|
|
196
|
+
hint = difflib.get_close_matches(p, sorted(COMMANDS), n=1)
|
|
197
|
+
print(f"leakkill: no such file or directory: {p}" + (f" (did you mean `leakkill {hint[0]}`?)" if hint else ""),
|
|
198
|
+
file=sys.stderr)
|
|
199
|
+
return not missing
|
|
200
|
+
|
|
201
|
+
|
|
192
202
|
def main(argv=None):
|
|
193
203
|
argv = list(sys.argv[1:] if argv is None else argv)
|
|
194
204
|
if argv and argv[0] in LEGACY:
|
|
@@ -196,6 +206,8 @@ def main(argv=None):
|
|
|
196
206
|
if not argv or (argv[0] not in COMMANDS and argv[0] not in ("-h", "--help", "--version")):
|
|
197
207
|
argv.insert(0, "scan")
|
|
198
208
|
args = parser().parse_args(argv)
|
|
209
|
+
if args.cmd in ("scan", "verify", "revoke", "report") and not check_paths(args.paths):
|
|
210
|
+
return 2
|
|
199
211
|
if args.cmd == "guard":
|
|
200
212
|
return guard_mod.guard(sys.stdin.read())
|
|
201
213
|
if args.cmd == "install-hook":
|
|
@@ -76,3 +76,16 @@ def test_revoke_dry_run_warns_about_side_effects(tmp_path, monkeypatch, capsys):
|
|
|
76
76
|
project(tmp_path, monkeypatch); fake_verify(monkeypatch)
|
|
77
77
|
cli.main(["revoke"])
|
|
78
78
|
assert "GitHub emails the token's owner" in capsys.readouterr().out
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def test_typo_command_is_an_error_not_clean(tmp_path, monkeypatch, capsys):
|
|
82
|
+
monkeypatch.chdir(tmp_path)
|
|
83
|
+
assert cli.main(["verfiy"]) == 2
|
|
84
|
+
out = capsys.readouterr()
|
|
85
|
+
assert "Clean" not in out.out and "did you mean `leakkill verify`" in out.err
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def test_missing_path_is_an_error(tmp_path, monkeypatch, capsys):
|
|
89
|
+
monkeypatch.chdir(tmp_path)
|
|
90
|
+
assert cli.main(["scan", "does-not-exist"]) == 2
|
|
91
|
+
assert "no such file or directory: does-not-exist" in capsys.readouterr().err
|
|
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
|