Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

git-security-checks

БесплатноЗапускает вложенные скриптыНе проверен

Pre-commit security validation and secret detection via gitleaks. Use when scanning for secrets, setting up gitleaks, or configuring .gitleaks.toml pre-commit…

laurigatesот laurigates★ 61 звезда на GitHub

Об этом скилле

Git Security Checks

When to Use This Skill

Use this skill when... Use the alternative when...
Running gitleaks to scan for secrets before committing Use git-commit-workflow for general staging and commit-message conventions
Configuring .gitleaks.toml allowlists and pre-commit integration Use git-maintain for git fsck integrity checks rather than secret scanning
Validating that no credentials leak into a PR Use git-fix-pr when CI gitleaks scans fail and you need to fix them on branch
Setting up pre-commit hooks for credential scanning Use release-please-protection to detect manual edits to release-managed files

Expert guidance for pre-commit security validation and secret detection using gitleaks and pre-commit hooks.

Core Expertise

  • gitleaks: Scan for hardcoded secrets and credentials using regex + entropy analysis
  • Pre-commit Hooks: Automated security validation before commits
  • Declarative Allowlisting: Manage false positives via .gitleaks.toml configuration
  • Security-First Workflow: Prevent credential leaks before they happen

Quick Security Scan (Recommended)

Run the comprehensive security scan pipeline in one command:

# Full scan: check all tracked files
bash "${CLAUDE_PLUGIN_ROOT}/skills/git-security-checks/scripts/security-scan.sh"

# Staged-only: check only files about to be committed
bash "${CLAUDE_PLUGIN_ROOT}/skills/git-security-checks/scripts/security-scan.sh" --staged-only

The script checks: gitleaks scan (STATUS=inert_config when .gitleaks.toml loads zero rules), sensitive file patterns, .gitignore coverage, high-entropy strings in diffs, and pre-commit hook status. See scripts/security-scan.sh for details.

Gitleaks Workflow

Initial Setup

# Install gitleaks (macOS)
brew install gitleaks

# Install gitleaks (Go)
go install github.com/gitleaks/gitleaks/v8@latest

# Install gitleaks (binary download)
# See https://github.com/gitleaks/gitleaks/releases

# Scan repository
gitleaks detect --source .

# Scan with verbose output
gitleaks detect --source . --verbose

Configuration

Create .gitleaks.toml for project-specific allowlists. Keep the [extend] block: gitleaks loads rules only from [extend] and rules, so a file with just an [allowlist] loads zero rules and every scan reports clean. scripts/security-scan.sh reports that as CONFIG=inert.

title = "Gitleaks Configuration"

[extend]
useDefault = true

[allowlist]
description = "Project-wide allowlist for false positives"
paths = [
    '''test/fixtures/.*''',
    '''.*\.test\.(ts|js)$''',
]

regexes = [
    '''example\.com''',
    '''localhost''',
    '''fake-key-for-testing''',
]

Pre-commit Scan Workflow

Run gitleaks before every commit:

# Scan for secrets in current state
gitleaks detect --source .

# Scan only staged changes (pre-commit mode)
gitleaks protect --staged

# Scan with specific config
gitleaks detect --source . --config .gitleaks.toml

Managing False Positives

Gitleaks provides declarative methods for handling false positives. Every .gitleaks.toml snippet in this section starts with the [extend] block from Configuration, because the file replaces the built-in ruleset rather than adding to it.

1. Inline comments — mark specific lines:

# This line is safe
API_KEY = "fake-key-for-testing-only"  # gitleaks:allow

# Works in any language
password = "test-fixture"  # gitleaks:allow

2. Path-based exclusions — in .gitleaks.toml:

[extend]
useDefault = true

[allowlist]
paths = [
    '''test/fixtures/.*''',
    '''.*\.example$''',
    '''package-lock\.json$''',
]

3. Regex-based allowlists — for specific patterns:

[extend]
useDefault = true

[allowlist]
regexes = [
    '''example\.com''',
    '''localhost''',
    '''PLACEHOLDER''',
]

4. Per-rule allowlists — target specific detection rules:

[extend]
useDefault = true

rules
id = "generic-api-key"
description = "Generic API Key"

[rules.allowlist]
regexes = ['''test-api-key-.*''']
paths = ['''test/.*''']

Complete Pre-commit Security Flow

# 1. Scan for secrets
gitleaks protect --staged

# 2. Run all pre-commit hooks
pre-commit run --all-files --show-diff-on-failure

# 3. Stage your actual changes
git add src/file.ts

# 4. Show what's staged
git status
git diff --cached --stat

# 5. Commit if everything passes
git commit -m "feat(auth): add authentication module"

Pre-commit Hook Integration

.pre-commit-config.yaml

Example configuration with gitleaks:

repos:
  - repo: https://github.com/gitleaks/gitleaks
    rev: v8.22.1
    hooks:
      - id: gitleaks

Running Pre-commit Hooks

# Run all hooks on all files
pre-commit run --all-files

# Run all hooks on staged files only
pre-commit run

# Run specific hook
pre-commit run gitleaks

# S
Полный SKILL.md на GitHub

Установить git-security-checks в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Bash(bash ${CLAUDE_PLUGIN_ROOT}/skills/git-security-checks/scripts/security-scan.sh *)
Bash(gitleaks *)
Bash(pre-commit run *)
Bash(pre-commit install *)
Bash(git status *)
Bash(git diff *)
Bash(git add *)
Bash(git commit *)
Read

Вложенные файлы

REFERENCE.mdscripts/security-scan.sh

FAQ

Что делает скилл git-security-checks?

Pre-commit security validation and secret detection via gitleaks. Use when scanning for secrets, setting up gitleaks, or configuring .gitleaks.toml pre-commit security.

Как установить скилл git-security-checks?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл git-security-checks запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить git-security-checks с