Skip to content

Commit 922ac1e

Browse files
committed
chore: add detect-secrets pre-commit hook
Prevents credential leaks before commit: - Yelp detect-secrets with baseline file - Excludes lock files and test fixtures - 28 secret pattern detectors enabled
1 parent 1fe06ef commit 922ac1e

File tree

3 files changed

+415
-0
lines changed

3 files changed

+415
-0
lines changed

.github/CODEOWNERS

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# CODEOWNERS for cachekit-py
2+
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
3+
#
4+
# These owners will be requested for review when someone opens a pull request
5+
# that modifies code that they own. Order matters - last matching pattern wins.
6+
7+
# Default: repository maintainers own everything
8+
* @cachekit-io/maintainers
9+
10+
# ─────────────────────────────────────────────────────────────────────────────
11+
# CRITICAL SECURITY PATHS
12+
# These require security team review for any changes
13+
# ─────────────────────────────────────────────────────────────────────────────
14+
15+
# Rust core - memory safety, FFI boundaries, cryptography
16+
/rust/ @cachekit-io/maintainers @cachekit-io/security
17+
18+
# Security-critical Python modules
19+
/src/cachekit/serializers/ @cachekit-io/maintainers @cachekit-io/security
20+
/src/cachekit/reliability/ @cachekit-io/maintainers @cachekit-io/security
21+
22+
# ─────────────────────────────────────────────────────────────────────────────
23+
# CI/CD AND RELEASE INFRASTRUCTURE
24+
# Changes here can compromise supply chain
25+
# ─────────────────────────────────────────────────────────────────────────────
26+
27+
/.github/workflows/ @cachekit-io/maintainers @cachekit-io/security
28+
/.github/CODEOWNERS @cachekit-io/maintainers
29+
/release-please-config.json @cachekit-io/maintainers
30+
/.release-please-manifest.json @cachekit-io/maintainers
31+
32+
# ─────────────────────────────────────────────────────────────────────────────
33+
# BUILD AND DEPENDENCY CONFIGURATION
34+
# Supply chain attack surface
35+
# ─────────────────────────────────────────────────────────────────────────────
36+
37+
/pyproject.toml @cachekit-io/maintainers
38+
/rust/Cargo.toml @cachekit-io/maintainers @cachekit-io/security
39+
/rust/Cargo.lock @cachekit-io/maintainers
40+
/.pre-commit-config.yaml @cachekit-io/maintainers
41+
42+
# ─────────────────────────────────────────────────────────────────────────────
43+
# SECURITY DOCUMENTATION
44+
# ─────────────────────────────────────────────────────────────────────────────
45+
46+
/SECURITY.md @cachekit-io/maintainers @cachekit-io/security
47+
/.github/SECURITY.md @cachekit-io/maintainers @cachekit-io/security
48+
49+
# ─────────────────────────────────────────────────────────────────────────────
50+
# DOCUMENTATION
51+
# Lower barrier - docs team can approve
52+
# ─────────────────────────────────────────────────────────────────────────────
53+
54+
/docs/ @cachekit-io/maintainers
55+
/README.md @cachekit-io/maintainers
56+
/CHANGELOG.md @cachekit-io/maintainers
57+
58+
# ─────────────────────────────────────────────────────────────────────────────
59+
# TESTS
60+
# Test changes generally safe, but fuzzing/security tests need security review
61+
# ─────────────────────────────────────────────────────────────────────────────
62+
63+
/tests/ @cachekit-io/maintainers
64+
/tests/security/ @cachekit-io/maintainers @cachekit-io/security
65+
/tests/fuzz/ @cachekit-io/maintainers @cachekit-io/security

.pre-commit-config.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,20 @@ repos:
4848
- id: check-added-large-files
4949
args: [--maxkb=1000]
5050
- id: check-merge-conflict
51+
52+
# Secret scanning - prevent credential leaks
53+
# Uses Yelp's detect-secrets with high entropy detection
54+
- repo: https://github.com/Yelp/detect-secrets
55+
rev: v1.5.0
56+
hooks:
57+
- id: detect-secrets
58+
args:
59+
- --baseline
60+
- .secrets.baseline
61+
exclude: |
62+
(?x)^(
63+
.*\.lock$|
64+
.*\.sum$|
65+
tests/fixtures/.*|
66+
docs/.*\.md$
67+
)$

0 commit comments

Comments
 (0)