Community寫作與編輯github.com

getedgehq/security-audit-checklist

對應用程式程式碼、雲端基礎設施、容器、CI/CD 管線及基礎設施即程式碼執行全面的安全審計。涵蓋隱私合規、OWASP 基礎、密碼外洩、API 安全、IAM 配置錯誤、儲存暴露、Kubernetes 強化及網路安全。

security-audit-checklist 是什麼?

這是一份結構化的安全檢查清單技能,旨在協助開發者在將系統部署至生產環境之前,或進行重大變更後,進行全面性的安全審計。其核心價值在於提供一個涵蓋隱私、密碼金鑰、OWASP 十大風險、輸入驗證、API 安全、身分驗證與 session 管理、雲端平台(AWS/GCP/Azure)各層面(IAM、儲存、運算、資料庫、網路、監控)、容器與 Kubernetes、基礎設施即程式碼(IaC)、CI/CD 管線以及 DNS 等領域的詳盡檢查項目。技能本身為純文字清單,可直接手動逐項檢查。此外,它還附帶三個 Python 腳本(於 `scripts/` 目錄下),可自動化執行密碼掃描、HTTP 安全標頭檢查以及 IaC 配置掃描,為審計流程提供效率與深度。支援所有主要的程式語言與平台,其檢查項目與業界最佳實踐和合規要求(如 GDPR、OWASP)緊密對齊,是提升應用程式與雲端安全性的實用工具。

相容平台~Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/getedgehq/skills/tree/main/security-audit-checklist

Installed? Explore more 寫作與編輯 skills: steipete/notion, langchain-ai/langchain, bytedance/podcast-generation · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

安全審計檢查清單

在任何系統上線至生產環境之前,或進行重大變更後,執行以下檢查。

開始之前

檢查清單本身是純文字,不需要任何東西。但 scripts/ 下的三個掃描器是 Python 程式,因此執行它們需要在您的機器上安裝 Python 3(python3 --version)。即使沒有 Python,您仍然可以手動執行檢查清單;只是無法獲得自動化的密碼掃描、標頭檢查和 IaC 讀取功能。

1. 隱私與資料治理

  • 存在隱私權政策:如果應用程式收集、儲存或處理任何用戶資料。將其鏈接放在頁尾和註冊流程中。
  • 了解用戶資料的儲存位置:記錄主要資料庫、快取、日誌、備份和第三方服務。檢查資料駐留要求(GDPR、CCPA)。
  • 資料最小化:只收集你需要的資料。刪除或匿名化你不使用的資料。

2. 密碼與金鑰衛生

  • .env 值未洩漏:掃描整個儲存庫中硬編碼的密碼。
  • 切勿在前端程式碼中暴露 API 金鑰:JS 套件中無金鑰,公共環境變數前綴(REACT_APP_、NEXT_PUBLIC_、VITE_)中無敏感值。
  • 將金鑰移至伺服器端或代理背後:所有需要密碼的第三方 API 呼叫都必須通過後端端點。
  • 從日誌中移除密碼:使用 grep 檢查日誌和錯誤回報器中的金鑰、令牌和密碼。在輸出前遮罩或編輯它們。
  • 立即輪替洩漏的憑證:如果發現任何洩漏。

快速掃描指令:

# 執行內建的密碼掃描器
python3 scripts/scan_secrets.py .

# 手動 ripgrep 模式
grep -rE '(api[_-]?key|secret|token|password)\s*[:=]\s*["\047][a-zA-Z0-9_\-]{16,}' --include='*.{js,ts,py,go,rb,php,java,json,yaml,yml,env,sh,tf,hcl}' .
grep -rE 'AKIA[0-9A-Z]{16}' .  # AWS 金鑰
grep -rE 'ghp_[a-zA-Z0-9]{36}' .  # GitHub 令牌
grep -rE 'sk-[a-zA-Z0-9]{48}' .   # OpenAI 金鑰

3. 安全標頭

  • Content-Security-Policy 限制腳本源,並在可能的情況下阻止內聯執行。
  • X-Frame-Options 或 frame-ancestors 防止點擊劫持。
  • Strict-Transport-Security 強制使用 HTTPS。
  • X-Content-Type-Options: nosniff 存在。
  • Referrer-Policy 限制引用來源洩漏。

在即時 URL 上檢查標頭:

python3 scripts/check_headers.py https://your-app.com

4. OWASP Top 10 基礎

#風險檢查項目
A01中斷的存取控制每個端點檢查身份驗證和授權。沒有 IDOR 漏洞。
A02密碼學失敗密碼使用 bcrypt/Argon2 進行雜湊處理。強制使用 TLS 1.2+。URL 中無敏感資料。
A03注入SQL 使用參數化語句。不要將原始字串串接到查詢中。
A04不安全設計對身份驗證和敏感操作進行速率限制。業務邏輯具有濫用檢查。
A05安全配置錯誤移除預設憑證。在生產環境中關閉除錯模式。錯誤訊息不會洩漏堆疊追蹤。
A06易受攻擊的組件依賴項審計:npm audit、pip-audit、cargo audit、snyk test。
A07身份驗證失敗Session token 是隨機的,並在權限變更時輪替。為敏感帳戶啟用 MFA。
A08資料完整性存在鎖定檔案,盡可能簽署提交。
A09日誌記錄失敗安全事件日誌中不包含密碼。
A10SSRF伺服器端請求使用允許清單。沒有用戶控制的 URL 命中內部服務。

5. 輸入驗證與注入

  • SQL 注入:所有查詢都使用 ORM 參數或預備語句。
  • XSS:用戶輸出已進行 HTML 跳脫。審計 dangerouslySetInnerHTML 和類似的繞過方法。
  • 命令注入:沒有使用用戶輸入的 exec()、system() 或 eval()。
  • 路徑遍歷:檔案路徑已清理,並限制在允許清單目錄中。
  • NoSQL 注入:MongoDB 查詢使用參數化物件。

6. API 安全

  • 檢查 API 回應中是否包含敏感資料:無內部 ID、密碼雜湊、令牌或不必要的 PII。
  • 所有非公開端點都需要身份驗證:無開放的 admin 或除錯路由。
  • 在有人燒光你的 API 帳單之前設定速率限制:對昂貴或身份驗證端點實施每 IP 和每用戶速率限制。返回 429 並附帶 Retry-After。
  • CORS 要嚴格:Access-Control-Allow-Origin 不是 *。對更改狀態的方法需要預檢請求。

7. 身份驗證與 Session

  • 密碼政策:最少 8 個字元,沒有會阻止密碼短語的最大長度限制。
  • 暴力攻擊防護:登入失敗後實施指數退避或 CAPTCHA。
  • Session 管理:安全、httpOnly、SameSite Cookie。JWT 具有短暫的有效期和刷新輪替。
  • 密碼重設:令牌是單次使用、隨機且快速過期的。

8. 雲端供應商安全

適用於 AWS、GCP、Azure 和任何其他雲端平台。

8.1 身分識別與存取管理 (IAM)

  • 不存在根帳戶存取金鑰。已啟用根帳戶 MFA。
  • 最低權限原則:每個角色、用戶和服務帳戶都擁有所需的最小權限。除非絕對必要,否則沒有萬用字元 (*) 動作或資源。
  • 用戶沒有長期有效的存取金鑰。優先使用具有臨時憑證的 IAM 角色(STS、實例設定檔、工作負載身分識別)。
  • 為所有人類用戶強制啟用 MFA,尤其是管理員和帳單存取權限。
  • 移除不活躍的身分識別:刪除或停用超過 90 天未使用的用戶、角色和服務帳戶。
  • 跨帳戶存取使用明確的角色假設,並在適用的情況下使用外部 ID。沒有 Principal: * 的信任政策。

8.2 儲存 (S3 / GCS / Azure Blob)

  • 無公開儲存桶/容器,除非是故意託管公開的靜態資產。在帳戶層級封鎖公開存取。
  • 啟用靜態加密(AES-256 或 KMS)。沒有未加密的儲存磁碟區或快照。
  • 強制傳輸中加密(僅限 HTTPS/TLS)。不允許 http。
  • 生命週期政策會刪除或轉換舊資料。為關鍵儲存桶啟用版本控制。
  • 儲存桶政策不會授予 Principal: * 或 AllUsers。存取透過 IAM 角色進行,而非硬編碼的金鑰。
  • 啟用日誌記錄以記錄存取日誌和物件層級事件(S3 伺服器存取日誌、CloudTrail 資料事件)。

8.3 運算 (EC2 / GCE / Azure VM / Lambda / Cloud Run)

  • 沒有預設安全群組允許 0.0.0.0/0 存取敏感連接埠(22、3389、3306、5432、6379、27017)。
  • 使用 SSM / Session Manager 替代直接 SSH(如果可能)。沒有連接埠 22 向網際網路開放。
  • 在 AWS EC2 上要求 IMDSv2(停用 IMDSv1)。
  • 不將實例中繼資料暴露給容器或不受信任的程式碼。
  • 函式執行環境使用最小權限。Lambda/GCP Cloud Functions 不以管理員角色執行。
  • 函式環境變數不包含純文字密碼。使用密碼管理員(AWS Secrets Manager、GCP Secret Manager、Azure Key Vault)。

8.4 資料庫與快取

  • 無公開存取:資料庫位於私有子網路或 VPC 中。安全群組中沒有 0.0.0.0/0。
  • 啟用靜態和傳輸中加密。
  • 自動備份具有時間點復原功能。
  • 強身份驗證:沒有預設密碼。在支援的情況下使用 IAM 資料庫身份驗證或 TLS 用戶端憑證。
  • 啟用審計日誌記錄以記錄連線和結構描述變更。

8.5 網路

  • VPC / 網路分段:生產、暫存和開發環境位於不同的網路或至少不同的子網路中。
  • 安全群組 / 防火牆預設為拒絕。僅開放所需的連接埠。
  • 沒有過度寬鬆的 CIDR:應避免使用 0.0.0.0/0,除非是面向公眾的負載平衡器上的 HTTPS(連接埠 443)。
  • 資料庫、快取和內部服務使用私有子網路。使用 NAT 閘道或 VPC 端點進行對外網際網路連線。
  • 在適用的情況下啟用 DDoS 保護(AWS Shield、Cloud Armor、Azure DDoS Protection)。
  • DNS / 網域:如果註冊商支援,則啟用 DNSSEC。沒有指向過期 IP 或已刪除資源的懸空 DNS 記錄(子域名接管風險)。

8.6 日誌、監控與警示

  • 在所有區域和服務中啟用 CloudTrail / 審計日誌 / 活動日誌。
  • 日誌完整性:日誌是不可變的,或儲存在具有一次性寫入權限的單獨帳戶中。
  • 敏感資料未被記錄:雲端日誌不包含密碼、令牌或 PII。
  • 配置警報以監控 root 登入、IAM 政策變更、公開儲存桶建立、安全群組變更和失敗的身份驗證高峰。
  • 日誌保留符合合規要求(通常為 1 年)。

9. 容器與編排安全

9.1 Docker / 容器映像

  • 映像中無密碼:掃描 Dockerfile 和層中是否有 .env、config.json 或硬編碼的憑證。
  • 最小基礎映像:盡可能使用 distroless、Alpine 或 scratch 而非完整的 Ubuntu/Debian。
  • 不以 root 身分執行:Dockerfile 設定 USER 為非 root UID/GID。
  • 映像掃描:在註冊表中啟用漏洞掃描(ECR、GCR、ACR、Docker Hub),並在 CI 中封鎖關鍵 CVE。
  • 不可變標籤:不要在生產環境中使用 latest。固定到摘要或特定的 semver。
  • 多階段構建:建構產物和開發依賴項不會出現在最終映像中。

9.2 Kubernetes

  • RBAC:最低權限角色和角色綁定。服務帳戶沒有 cluster-admin。
  • 不要將預設服務帳戶令牌掛載到不需要它們的 pod 中(automountServiceAccountToken: false)。
  • 網路政策:預設拒絕入口/出口,然後明確允許所需的流量。
  • Pod 安全標準:強制執行 restricted 或 baseline 設定檔。沒有特權容器、沒有 hostPath、沒有 hostNetwork。
  • 密碼加密:啟用 etcd 靜態加密。Git 中沒有純文字密碼。
  • 容器執行時期安全:應用 seccomp、AppArmor 或 SELinux 設定檔。
  • 准入控制器:使用 OPA/Gatekeeper 或 Kyverno 來強制執行政策(無 latest 標籤、必需的標籤、資源限制)。
  • 資源限制:每個 pod 都有 CPU 和記憶體限制,以防止透過資源耗盡發動 DoS 攻擊。

10. 基礎設施即程式碼 (IaC)

  • Terraform / CloudFormation / Pulumi / CDK 中無密碼:狀態檔案不包含純文字密碼或金鑰。遠端狀態已加密且存取受控。
  • Terraform 狀態後端是安全的:使用 SSE-KMS 的 S3、DynamoDB 鎖定,且無公開讀取權限。
  • IaC 掃描:在合併前對 Terraform/CloudFormation 執行 checkov、tfsec 或 terrascan。
  • 漂移檢測:定期掃描檢測與 IaC 偏離的手動主控台變更。
  • 模組已固定版本:不要從分支或未版本化的來源拉取模組。

快速 IaC 掃描:

python3 scripts/scan_iac.py .

# 或者如果已安裝,使用專用工具:
checkov -d . --framework terraform,cloudformation,dockerfile
# tfsec .

11. CI/CD 管線安全

  • 管線配置中無密碼:在 .github/workflows、.gitlab-ci.yml、Azure Pipelines 或 Jenkinsfiles 中沒有硬編碼的令牌。
  • 密碼從 CI 平台的內建密碼管理員注入(GitHub Secrets、GitLab CI Variables、Azure DevOps Library)。
  • 管線權限最小化:CI 服務帳戶僅擁有部署所需的最小權限。
  • 分支保護:阻止直接推送到 main/master 分支。所有變更需要 PR/MR + 審查。
  • 已簽署提交或合併要求:對於敏感儲存庫,要求已簽署提交或至少已驗證的合併提交。
  • 依賴項掃描:SCA 工具(Snyk、Dependabot、Renovate)在每個 PR 上執行。
  • SAST:靜態分析(Semgrep、CodeQL、SonarQube)在每個 PR 上執行。
  • 容器掃描:映像在部署前掃描 CVE。
  • 沒有暴露於公共網際網路的自託管執行器,除非透過 VPN 或 IP 允許清單保護。
  • 未經手動批准,管線不執行來自分支的未受信任程式碼(防止 pwn 請求)。

12. 網域與 DNS 安全

  • DNSSEC:如果註冊商支援,則啟用。
  • 沒有指向過期服務的懸空 CNAME / A / NS 記錄(子域名接管風險)。
  • 萬用憑證或來自受信任 CA 的每個主體憑證。生產環境中沒有自簽憑證。
  • 憑證到期監控:在到期前 30 天和 7 天發出警報。
  • CDN / WAF 配置了合理的規則(SQLi、XSS、LFI 封鎖)。在邊緣啟用速率限制。

審計輸出

執行檢查清單後,產生一份簡潔的 markdown 報告,內容包括:

  1. 摘要 — 每個類別的通過 / 失敗 / 需要審查。
  2. 關鍵發現 — 任何必須在上線前修復的項目。
  3. 建議修復 — 特定的程式碼變更、配置更新或程式庫升級。
  4. 風險矩陣 — 每個發現項目的可能性 × 影響。
  5. 補救時間表 — 建議優先順序和截止日期。

Individual skills in this repo

This repo contains 18 individual skills — each has its own dedicated page.

getedgehq/agent-evals

Build evals for an AI agent that already does real work. Use when someone asks "how do I know my agent is right", wants to test an agent before trusting it, compare models on cost versus quality, or turn production failures into tests. Walks from first tasks and yes/no verifiers, to isolated environments, to a trace-driven improvement loop.

getedgehq/cli-ux-review

Audit a command-line tool for user-friendliness — clear situation / next-step / options in every output, colour-highlighted runnable commands, no raw jargon, no silent hangs. Invoke for "CLI UX audit", "review my CLI", "is this CLI intuitive", or before any CLI release.

getedgehq/generate-image

Generate images with OpenAI GPT Image 2 via the Codex CLI, billed through the user's ChatGPT Plus subscription (no OpenAI API key, no per-image API cost). Use when the user asks to create, generate, or make an image, picture, illustration, icon, hero graphic, or concept art from a text prompt.

getedgehq/harness-first

Diagnose and fix an unreliable, expensive, or unsafe LLM agent by auditing its harness (golden set, judge, cost caps, data layer, action approvals, tracing) before blaming or swapping the model. Use when someone says an agent is "burning tokens", "hallucinating", "brittle", gives inconsistent answers, asks whether to switch to a cheaper/better model, or wants to ship an agent or prompt change to customers.

getedgehq/http-error-triage

Run before concluding anything from an HTTP error on a third-party API. Separates a real credential/entitlement problem from a CDN or WAF block, a wrong endpoint, or a client-signature ban. Use whenever an API returns 401/403/402/429 and you are about to say "the key is dead", "credits are exhausted", "the plan lacks access", or "we are rate limited".

getedgehq/linkedin-media-prep

Convert, crop, resize, and compress images and videos for optimal LinkedIn upload quality and file size. Use when the user wants to prepare a photo, image, or video for LinkedIn (profile picture, cover photo, post image, article featured image, post video, or video ad), optimize file size for LinkedIn, crop and resize for LinkedIn dimensions, convert HEIC/RAW/PNG/MOV to LinkedIn-ready JPEG or MP4, or mentions LinkedIn media requirements, specs, or limits.

getedgehq/monid

>-

getedgehq/opendraft

An 18-agent pipeline that turns one topic line into a drafted

getedgehq/people-search

Find and rank professional people for recruiting, partnerships, sales, or research from user-provided data, public web sources, an authenticated search session, or a connected provider. Use for people discovery, LinkedIn or Sales Navigator search design, profile-list ranking, or provider filter translation.

getedgehq/rocketlist

Turn a CV into a shortlist of live startup roles from Rocketlist's public job board, including adjacent job titles the person would never have searched for, each with its published salary, the evidence for the fit, and a direct apply link. Use for "find roles I would be a strong fit for", career pivots, remote or VC-backed job hunts, and salary-visible role discovery.

getedgehq/shadcn-first

>-

getedgehq/skills

Develop or review a branded long-form YouTube channel using Simon Kaiser's public creator-led approach: audience fit, recurring formats, natural brand integration, Time with Brand, and an organic, paid, and Shorts strategy. Use for channel strategy, format briefs, and pilots.

getedgehq/skills

Build a YouTube strategy, evidence-backed idea slate, and title plus thumbnail package using Paddy Galloway's public method. Use when planning a channel, choosing concepts, or preparing a video before filming.

getedgehq/skills

Build or review a buyer-centered strategic narrative using Andy Raskin's public method. Use for sales or investor deck stories, homepage positioning, keynotes, launch narratives, and why-now messaging.

getedgehq/skills

Turn a product URL, launch brief, or approved script into a production-ready launch video. Use for product reveals, feature announcements, SaaS launches, and narrated product films; not for generic explainers or editing existing footage.

getedgehq/strip-image-ai-metadata

Strip C2PA and AI-generation metadata from images (PNG, JPEG, WebP) to remove "Generated by AI" / "ChatGPT" / "DALL-E" labels that platforms like LinkedIn, Instagram, and X display. Use when the user wants to clean AI-generated images before posting, remove AI attribution from photos, strip C2PA manifests, sanitize image metadata for professional use, or verify whether an image contains C2PA data.

getedgehq/top-down-comms

>-

getedgehq/workplan

Create, update, or close work plans for multi-step tasks. Use when starting refactors, bug lists, feature work, migrations, or any task with 2+ steps. Also use after auto-compaction to re-orient. Triggers: "workplan", "work plan", "create a plan", "what's the plan", "where was I", or when Claude detects

相關技能