|
1 | | -# Aikido Secrets Pre-commit Hook (aikido-precommit) |
2 | | - |
3 | | -Installs [AikidoSec's pre-commit hook](https://github.com/AikidoSec/pre-commit) for scanning secrets, passwords, and API keys before commits. This helps prevent accidentally committing sensitive information to your repositories. |
4 | | - |
5 | | -## Features |
6 | 1 |
|
7 | | -- Scans staged files for secrets, API keys, passwords, and other sensitive data |
8 | | -- Runs automatically on `git commit` when global hooks are configured |
9 | | -- Supports Linux (x86_64, ARM64) and macOS (ARM64) |
10 | | -- Lightweight binary with no runtime dependencies |
11 | | -- Configurable version selection |
12 | | - |
13 | | -## Usage |
14 | | - |
15 | | -Add this Feature to your `devcontainer.json`: |
| 2 | +# Aikido Secrets Pre-commit Hook (aikido-precommit) |
16 | 3 |
|
17 | | -```jsonc |
18 | | -{ |
19 | | - "image": "mcr.microsoft.com/devcontainers/base:ubuntu", |
20 | | - "features": { |
21 | | - "ghcr.io/proxayfox/devcontainer-features/aikido-precommit:1": {} |
22 | | - } |
23 | | -} |
24 | | -``` |
| 4 | +Installs AikidoSec's pre-commit hook for scanning secrets, passwords, and API keys before commits |
25 | 5 |
|
26 | | -### With Custom Options |
| 6 | +## Example Usage |
27 | 7 |
|
28 | | -```jsonc |
29 | | -{ |
30 | | - "image": "mcr.microsoft.com/devcontainers/base:ubuntu", |
31 | | - "features": { |
32 | | - "ghcr.io/proxayfox/devcontainer-features/aikido-precommit:1": { |
33 | | - "version": "v1.0.116", |
34 | | - "setupGlobalHooks": true |
35 | | - } |
36 | | - } |
| 8 | +```json |
| 9 | +"features": { |
| 10 | + "ghcr.io/ProxayFox/devcontainer-features/aikido-precommit:1": {} |
37 | 11 | } |
38 | 12 | ``` |
39 | 13 |
|
40 | 14 | ## Options |
41 | 15 |
|
42 | | -Option | Type | Default | Description |
43 | | ------------------- | ------- | ---------- | ------------------------------------------------------------------ |
44 | | -`version` | string | `v1.0.116` | Version of the aikido-local-scanner to install |
45 | | -`setupGlobalHooks` | boolean | `true` | Configure git global hooks path (set to `false` for download-only) |
46 | | - |
47 | | -## How It Works |
48 | | - |
49 | | -When `setupGlobalHooks` is `true` (default), the Feature: |
50 | | - |
51 | | -1. Installs the `aikido-local-scanner` binary to `/usr/local/bin/` |
52 | | -2. Configures `git config --global core.hooksPath` to use `/etc/git-hooks/` (or respects an existing hooks path) |
53 | | -3. Creates a `pre-commit` hook that runs the scanner on every commit |
54 | | - |
55 | | -When you run `git commit`, the scanner will: |
56 | | - |
57 | | -- Analyze staged files for potential secrets |
58 | | -- Block the commit if secrets are detected |
59 | | -- Allow the commit to proceed if no issues are found |
60 | | - |
61 | | -## Manual Usage |
62 | | - |
63 | | -You can also run the scanner manually: |
64 | | - |
65 | | -```bash |
66 | | -# Scan a repository |
67 | | -aikido-local-scanner pre-commit-scan /path/to/repo |
68 | | - |
69 | | -# Scan the current repository |
70 | | -aikido-local-scanner pre-commit-scan "$(git rev-parse --show-toplevel)" |
71 | | -``` |
72 | | - |
73 | | -## Download-Only Mode |
74 | | - |
75 | | -If you prefer to manage git hooks yourself, set `setupGlobalHooks` to `false`: |
76 | | - |
77 | | -```jsonc |
78 | | -{ |
79 | | - "features": { |
80 | | - "ghcr.io/proxayfox/devcontainer-features/aikido-precommit:1": { |
81 | | - "setupGlobalHooks": false |
82 | | - } |
83 | | - } |
84 | | -} |
85 | | -``` |
86 | | - |
87 | | -This installs only the binary without modifying your git configuration. |
| 16 | +| Options Id | Description | Type | Default Value | |
| 17 | +|-----|-----|-----|-----| |
| 18 | +| version | Version of the aikido-local-scanner to install | string | v1.0.116 | |
| 19 | +| setupGlobalHooks | Configure git global hooks path (set to false for download-only) | boolean | true | |
88 | 20 |
|
89 | | -## Supported Platforms |
90 | 21 |
|
91 | | -- Linux x86_64 |
92 | | -- Linux ARM64 |
93 | | -- macOS ARM64 (Apple Silicon) |
94 | 22 |
|
95 | | -## Resources |
| 23 | +--- |
96 | 24 |
|
97 | | -- [AikidoSec Pre-commit Repository](https://github.com/AikidoSec/pre-commit) |
98 | | -- [Aikido Security](https://www.aikido.dev/) |
| 25 | +_Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/ProxayFox/devcontainer-features/blob/main/src/aikido-precommit/devcontainer-feature.json). Add additional notes to a `NOTES.md`._ |
0 commit comments