Langsung ke konten
Skillpedia
Keamanan40k Β· #7419

secret-scanning

Fungsinya

Tool ini membantu menemukan dan mencegah informasi sensitif, seperti password dan kunci akses, agar tidak terekspos secara tidak sengaja di kode GitHub Anda. Tool ini dapat memberi peringatan jika ada kebocoran, bahkan memblokir push yang mengandung secret.

Kapan dipakai

  • βœ“Saat mengatur keamanan proyek Anda di GitHub.
  • βœ“Saat Anda curiga ada password atau kunci yang terkirim secara tidak sengaja.
  • βœ“Untuk mencegah secret dikirim ke repository.

Link skill

https://github.com/github/awesome-copilot/blob/main/skills/secret-scanning/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/github/awesome-copilot/blob/main/skills/secret-scanning/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBagaimana cara mengatur push protection untuk repository saya?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

GitHub memindai kode Anda untuk mencari pola secret yang sudah dikenal. Jika menemukannya, GitHub bisa memberi tahu Anda atau memblokir push, tergantung pada konfigurasi Anda.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Secret Scanning

This skill provides procedural guidance for configuring GitHub secret scanning β€” detecting leaked credentials, preventing secret pushes, defining custom patterns, and managing alerts.

When to Use This Skill

Use this skill when the request involves:

  • Enabling or configuring secret scanning for a repository or organization
  • Setting up push protection to block secrets before they reach the repository
  • Defining custom secret patterns with regular expressions
  • Resolving a blocked push from the command line
  • Triaging, dismissing, or remediating secret scanning alerts
  • Configuring delegated bypass for push protection
  • Excluding directories from secret scanning via secret_scanning.yml
  • Understanding alert types (user, partner, push protection)
  • Enabling validity checks or extended metadata checks
  • Scanning local code changes for secrets before committing (via MCP / AI coding agent) β€” see the Pre-Commit Scanning via AI Coding Agents section below for the recommended plugin

How Secret Scanning Works

Secret scanning automatically detects exposed credentials across:

  • Entire Git history on all branches
  • Issue descriptions, comments, and titles (open and closed)
  • Pull request titles, descriptions, and comments
  • GitHub Discussions titles, descriptions, and comments
  • Wikis and secret gists

Availability

Repository Type Availability
Public repos Automatic, free
Private/internal (org-owned) Requires GitHub Secret Protection on Team/Enterprise Cloud
User-owned Enterprise Cloud with Enterprise Managed Users

Core Workflow β€” Enable Secret Scanning

Step 1: Enable Secret Protection

  1. Navigate to repository Settings β†’ Advanced Security
  2. Click Enable next to "Secret Protection"
  3. Confirm by clicking Enable Secret Protection

For organizations, use security configurations to enable at scale:

  • Settings β†’ Advanced Security β†’ Global settings β†’ Security configurations

Step 2: Enable Push Protection

Push protection blocks secrets during the push process β€” before they reach the repository.

  1. Navigate to repository Settings β†’ Advanced Security
  2. Enable "Push protection" under Secret Protection

Push protection blocks secrets in:

  • Command line pushes
  • GitHub UI commits
  • File uploads
  • REST API requests
  • REST API content creation endpoints

Step 3: Configure Exclusions (Optional)

Create .github/secret_scanning.yml to auto-close alerts for specific directories:

paths-ignore:
  - "docs/**"
  - "test/fixtures/**"
  - "**/*.example"

Limits:

  • Maximum 1,000 entries in paths-ignore
  • File must be under 1 MB
  • Excluded paths also skip push protection checks

Best practices:

  • Be as specific as possible with exclusion paths
  • Add comments explaining why each path is excluded
  • Review exclusions periodically β€” remove stale entries
  • Inform the security team about exclusions

Step 4: Enable Additional Features (Optional)

Non-provider patterns β€” detect private keys, connection strings, generic API keys:

  • Settings β†’ Advanced Security β†’ enable "Scan for non-provider patterns"

AI-powered generic secret detection β€” uses Copilot to detect unstructured secrets like passwords:

  • Settings β†’ Advanced Security β†’ enable "Use AI detection"

Validity checks β€” verify if detected secrets are still active:

  • Settings β†’ Advanced Security β†’ enable "Validity checks"
  • GitHub periodically tests detected credentials against provider APIs
  • Status shown in alert: active, inactive, or unknown

Extended metadata checks β€” additional context about who owns a secret:

  • Requires validity checks to be enabled first
  • Helps prioritize remediation and identify responsible teams

Core Workflow β€” Resolve Blocked Pushes

When push protection blocks a push from the command line:

Option A: Remove the Secret

If the secret is in the latest commit:

# Remove the secret from the file
# Then amend the commit
git commit --amend --all
git push

If the secret is in an earlier commit:

# Find the earliest commit containing the secret
git log

# Start interactive rebase before that commit
git rebase -i <COMMIT-ID>~1

# Change 'pick' to 'edit' for the offending commit
# Remove the secret, then:
git add .
git commit --amend
git rebase --continue
git push

Option B: Bypass Push Protection

  1. Visit the URL returned in the push error message (as the same user)

…

Pertanyaan umum

Apa yang dimaksud dengan 'secret'?

Secret adalah informasi sensitif seperti password, API key, token, dan sertifikat yang tidak boleh dibagikan secara publik atau terekspos di dalam kode.

Apa yang terjadi jika secret ditemukan?

Tergantung konfigurasinya, Anda mungkin menerima peringatan, atau push kode bisa diblokir sampai secret tersebut dihapus atau ditangani.

Bisakah saya mengabaikan file atau folder tertentu?

Bisa. Anda dapat mengonfigurasi GitHub agar mengabaikan path tertentu yang memang wajar berisi secret dan tidak perlu dipindai.

Detail

Deskripsi asli dari pembuat

Guide for configuring and managing GitHub secret scanning, push protection, custom patterns, and secret alert remediation. For pre-commit secret scanning in AI coding agents via the GitHub MCP Server, this skill references the Advanced Security plugin (`advanced-security@copilot-plugins`). Use this skill when enabling secret scanning, setting up push protection, defining custom patterns, triaging

repo: github/awesome-copilot

Popularitas

Bintang GitHub
40k
Peringkat
#7419
Lisensi
MIT
Diperbarui
15/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa