Commit graph

16 commits

Author SHA1 Message Date
Anthony Sottile
8f6152921e drop python3.6 support
python 3.6 reached end of life on 2021-12-23

Committed via https://github.com/asottile/all-repos
2022-01-15 19:24:05 -05:00
Anthony Sottile
39ab2ed85e replace exit(main()) with raise SystemExit(main())
Committed via https://github.com/asottile/all-repos
2021-10-23 13:23:50 -04:00
Luís Ferreira
1b4e30e9aa
detect_private_key: add OpenVPN shared-secret key block
'OpenVPN Static key V1' label is often used by OpenVPN for providing hardening
security with additional HMAC signatures to the SSL/TLS handshake packets. They
are shared secrets and should be kept private.

Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2021-10-02 20:53:39 +01:00
Luís Ferreira
ccdf02dfd4
detect_private_key: add textual version of PKCS #8 encrypted private keys
As described by RFC7468 and RFC5958, keys that are encoded using the "ENCRYPTED
PRIVATE KEY" label are described as private key information and therefore can
contain secrets, even though encrypted.

Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2021-10-02 20:53:33 +01:00
Anthony Sottile
f5c42a050b pre-commit-hooks: python3.6+ 2020-02-05 11:22:18 -08:00
Anthony Sottile
030bfac7e4 Apply typing to all of pre-commit-hooks 2019-01-31 20:09:15 -08:00
Ryan Delaney
b1feed0ced Add ban for pgp/gpg private key blocks 2018-10-22 12:11:59 -07:00
vin01
45d3850244 Detect putty & sshcom private keys 2018-05-19 00:31:16 +01:00
nicain
70ee59f9e6
Update detect_private_key.py 2018-01-13 17:16:50 -08:00
Anthony Sottile
9cee71b5df Add pyupgrade 2017-03-12 18:01:29 -07:00
Chris Kuehl
cdb3e2e4bf Add trailing comma 2016-12-26 14:51:26 -08:00
Daniel Roschka
c549cb25a1 Detect Ed25519 keys as well
Ed255519 keys generated by OpenSSH contain "BEGIN OPENSSH PRIVATE KEY"
as identifier. This commit adds coverage for such keys as well.
2016-12-26 19:09:53 +01:00
Chris Kuehl
ca2be345a1 detect_private_key: print *filenames*, not the key 2015-08-01 17:02:29 -07:00
Anthony Sottile
07c938e1b1 Allow arbitrary binary to pass the private key hook check. Resolves #64 2015-06-11 13:28:10 -07:00
Alexander Dupuy
a6023ac0d7 Implement Markdown trailing space line break preservation
Markdown uses two or more trailing spaces on a line to indicate a forced
line break `<br/>` - these will be preserved for files with a markdown
extension (default = `.md` or `.markdown`).

Add `--markdown-linebreak-ext=X,Y` to add extensions (`*` matches any),
and `--no-markdown-linebreak-ext` to disable this feature.

If you want to set specific extension `foo` only (and not md/markdown),
use `--no-markdown-linebreak-ext --markdown-linebreak-ext=foo`

Tries to prevent --markdown-linebreak-ext from eating filenames as if they were
extensions by rejecting any with '.' or '/' (or even Windows-style '\' or ':')

Update README.md to include information on these arguments as well as
arguments added to other hooks

Add extensive tests using pytest.mark.parametrize

test that `txt` file is not considered as 'txt' extension
test that `.txt` file is not considered as 'txt' extension

The latter is the (correct) behavior of os.path.splitext(), and an example
of why it is better to use the libraries than to mangle strings yourself.
2015-05-11 08:52:32 +02:00
Cameron Paul
68a7729327 Detect OpenSSH private keys 2015-03-07 09:35:30 -08:00