pci-dss-specialist by borghei/claude-skills
npx skills add https://github.com/borghei/claude-skills --skill pci-dss-specialist实施、评估和维护支付卡行业数据安全标准第 4.0 版的合规性——这是保护支付处理环境中持卡人数据的全球标准。
当您听到以下内容时使用此技能:
python scripts/pci_compliance_checker.py --input controls.json --output compliance_report.json
python scripts/pci_scope_analyzer.py --input business_model.json --output scope_report.json
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
python scripts/pci_compliance_checker.py --input controls.json --format markdown --output gap_report.md
python scripts/pci_scope_analyzer.py --input business_model.json --format markdown --output scope_analysis.md
全面的 PCI DSS v4.0 合规评估引擎。
功能:
用法:
# 全面合规检查
python scripts/pci_compliance_checker.py \
--input controls.json \
--output report.json
# 为利益相关者生成 Markdown 报告
python scripts/pci_compliance_checker.py \
--input controls.json \
--format markdown \
--output compliance_report.md
# 仅检查特定要求
python scripts/pci_compliance_checker.py \
--input controls.json \
--requirements 3,4,7,8 \
--output data_security_report.json
输入格式(controls.json):
{
"organization": "Acme Payments",
"assessment_date": "2026-03-09",
"merchant_level": 2,
"requirements": {
"1": {
"network_segmentation": true,
"firewall_rules_documented": true,
"waf_deployed": true,
"inbound_traffic_restricted": true,
"outbound_traffic_restricted": false,
"wireless_networks_segmented": true,
"notes": "Outbound filtering planned for Q2"
},
"3": {
"pan_storage_minimized": true,
"pan_masked_when_displayed": true,
"pan_encrypted_at_rest": true,
"encryption_algorithm": "AES-256",
"key_management_procedures": true,
"tokenization_implemented": true,
"sad_not_stored_after_auth": true,
"notes": "Tokenization covers 95% of stored PANs"
}
}
}
CDE 范围界定和 SAQ 类型确定引擎。
功能:
用法:
# 确定 SAQ 类型和 CDE 范围
python scripts/pci_scope_analyzer.py \
--input business_model.json \
--output scope_report.json
# Markdown 范围界定工作表
python scripts/pci_scope_analyzer.py \
--input business_model.json \
--format markdown \
--output scoping_worksheet.md
输入格式(business_model.json):
{
"organization": "Acme Payments",
"business_type": "e-commerce",
"payment_channels": ["web", "mobile_app"],
"card_present": false,
"card_not_present": true,
"stores_pan": false,
"processes_pan": false,
"transmits_pan": false,
"payment_processor": "Stripe",
"uses_iframe_redirect": true,
"uses_p2pe": false,
"annual_transactions": 500000,
"card_brands": ["visa", "mastercard", "amex"],
"systems": [
{
"name": "web-frontend",
"type": "web_server",
"handles_cardholder_data": false,
"connected_to_cde": false,
"security_impacting": true,
"description": "Customer-facing e-commerce site with iframe payment"
},
{
"name": "payment-api",
"type": "application_server",
"handles_cardholder_data": false,
"connected_to_cde": true,
"security_impacting": true,
"description": "API server that communicates with Stripe"
}
]
}
支付卡行业数据安全标准(PCI DSS)是由 PCI 安全标准委员会(PCI SSC)制定的全球安全标准,该委员会由美国运通、发现卡、JCB、万事达卡和维萨卡共同创立。它适用于所有存储、处理或传输持卡人数据(CHD)或敏感认证数据(SAD)的实体。
| 日期 | 里程碑 |
|---|---|
| 2022年3月 | PCI DSS v4.0 发布 |
| 2024年3月 | v3.2.1 废止;v4.0 成为唯一有效版本 |
| 2025年3月31日 | 所有未来要求成为强制性要求 |
所有组织现在必须遵守完整的 PCI DSS v4.0 标准,包括所有先前为未来要求的部分。
持卡人数据(CHD):
敏感认证数据(SAD): 授权后绝不得存储,即使已加密。
目标: 通过网络安全控制措施保护持卡人数据环境。
关键子要求:
实施指南:
目标: 确保所有系统都安全配置,没有不必要的默认设置。
关键子要求:
实施指南:
目标: 最小化存储数据并使用强密码学保护。
关键子要求:
实施指南:
令牌化与加密决策:
| 因素 | 令牌化 | 加密 |
|---|---|---|
| 可逆性 | 不可逆(首选) | 使用密钥可逆 |
| 范围缩减 | 将系统从 CDE 范围中移除 | 系统保留在范围内 |
| 性能 | 查找更快(令牌映射) | 加密/解密开销 |
| 用例 | 存档卡、循环计费 | 必须恢复的数据 |
| 推荐 | 尽可能首选令牌化 | 在需要恢复 PAN 时使用 |
目标: 在开放、公共网络上传输时始终加密 CHD。
关键子要求:
实施指南:
目标: 防御所有系统免受恶意软件侵害。
关键子要求:
实施指南:
目标: 通过安全开发和及时修补防范漏洞。
关键子要求:
实施指南:
目标: 将 CHD 的访问权限限制在仅具有合法业务需求的个人。
关键子要求:
实施指南:
目标: 确保所有对 CDE 的访问都被识别并经过强认证。
关键子要求:
实施指南:
目标: 防止对存储、处理或传输 CHD 的系统进行未经授权的物理访问。
关键子要求:
实施指南:
目标: 为所有对 CDE 和 CHD 的访问创建全面的审计追踪。
关键子要求:
实施指南:
目标: 定期测试安全控制措施、系统和网络以验证其有效性。
关键子要求:
实施指南:
目标: 维护涵盖所有 PCI DSS 要求的信息安全政策。
关键子要求:
实施指南:
1. 定制化方法(新增) 组织现在可以使用"定制化方法"而非传统的"定义化方法"来满足 PCI DSS 要求。这允许组织设计自己的安全控制措施,前提是满足每项要求的安全目标。需要有针对性的风险分析文档并由 QSA 验证。
2. 有针对性的风险分析 v4.0 要求组织对某些要求(例如,活动频率、密码/口令策略)执行有记录的有针对性风险分析。这取代了"一刀切"的方法。
3. 增强的认证要求
4. 支付页面脚本安全(6.4.3) 支付页面上的所有脚本必须被管理、授权并监控完整性。这解决了 Magecart 式攻击。
5. 反钓鱼机制(5.4.1) 组织必须实施自动反钓鱼机制(例如,DMARC、电子邮件沙箱)。
6. 在可信内部网络上加密 PAN(4.2.1) PAN 现在必须在所有网络传输过程中加密,而不仅仅是公共网络。需要内部网络加密。
7. 自动日志审查(10.4.1.1) 自动机制必须执行审计日志审查——仅手动审查不再足够。
截至 2025 年 3 月 31 日,以下所有要求已成为强制性要求:
| 要求 | 变更内容 |
|---|---|
| 3.3.2 | 授权前存储的 SAD 必须加密 |
| 3.5.1.2 | 磁盘级加密不再满足要求(必须在磁盘之上) |
| 5.3.3 | 对可移动媒体进行反恶意软件扫描 |
| 5.4.1 | 需要反钓鱼机制 |
| 6.3.2 | 用于漏洞管理的软件清单 |
| 6.4.2 | 面向公众的 Web 应用需使用处于阻止模式的 WAF |
| 6.4.3 | 支付页面脚本管理 |
| 8.3.6 | 12 个字符的最小密码 |
| 8.4.2 | 所有 CDE 访问的 MFA |
| 8.5.1 | MFA 重放攻击保护 |
| 8.6.1-3 | 系统/服务账户管理 |
| 10.4.1.1 | 自动日志审查 |
| 10.7.2 | 检测关键安全控制措施的故障 |
| 11.3.1.1 | 管理所有漏洞(不仅是高危/关键) |
| 11.4.7 | 多租户服务提供商渗透测试 |
| 11.5.1.1 | IDS/IPS 对疑似入侵的警报 |
| 11.6.1 | 支付页面篡改检测 |
| 12.3.1 | 有针对性的风险分析 |
| 12.6.3.1 | 意识培训中的钓鱼/社会工程 |
| 12.10.7 | 响应意外存储的 PAN |
持卡人数据环境(CDE)包括:
| 类别 | 定义 | 在范围内? | 示例 |
|---|---|---|---|
| CDE 系统 | 存储、处理或传输 CHD | 是——全面范围 | 支付服务器、包含 PAN 的数据库、POS 终端 |
| 连接系统 | 直接连接到 CDE | 是——全面范围 | CDE 的 DNS 服务器、用于 CDE 认证的 AD/LDAP |
| 影响安全的系统 | 为 CDE 提供安全服务 | 是——全面范围 | SIEM、AV 服务器、CDE 系统的补丁管理 |
| 范围外系统 | 无连接、无 CHD、无安全影响 | 否 | 隔离的 HR 系统、营销服务器 |
1. 令牌化: 用不可逆令牌替换 PAN。仅处理令牌的系统在范围外。
2. P2PE(点对点加密): 经过验证的 P2PE 解决方案在交互点加密持卡人数据。使用经过验证的 P2PE 的商户可以使用 SAQ P2PE(范围缩减)。
3. 网络分段: 将 CDE 隔离在独立的网段上,使用防火墙和严格的访问控制。非 CDE 段在范围外。
4. 外包处理: 使用第三方支付处理器(Stripe、Braintree、Adyen)处理所有 CHD。商户从不接触持卡人数据。
5. iFrame/重定向: 对于电子商务,使用支付处理器托管的支付页面(iFrame 或重定向)。商户的系统从不接收持卡人数据。
自我评估问卷(SAQ)是适用于不需要进行完整现场评估(ROC)的商户和服务提供商的验证工具。
| SAQ 类型 | 适用对象 | CHD 处理方式 | 问题数量 |
|---|---|---|---|
| SAQ A | 电子商务或 MOTO 商户 | 所有支付处理完全外包;无电子存储/处理/传输 CHD | ~30 |
| SAQ A-EP | 电子商务商户 | 支付页面元素来自第三方,但商户网站影响支付交易的安全性 | ~140 |
| ** |
Implement, assess, and maintain compliance with the Payment Card Industry Data Security Standard version 4.0 — the global standard for protecting cardholder data in payment processing environments.
Use this skill when you hear:
python scripts/pci_compliance_checker.py --input controls.json --output compliance_report.json
python scripts/pci_scope_analyzer.py --input business_model.json --output scope_report.json
python scripts/pci_compliance_checker.py --input controls.json --format markdown --output gap_report.md
python scripts/pci_scope_analyzer.py --input business_model.json --format markdown --output scope_analysis.md
Comprehensive PCI DSS v4.0 compliance assessment engine.
Capabilities:
Usage:
# Full compliance check
python scripts/pci_compliance_checker.py \
--input controls.json \
--output report.json
# Markdown report for stakeholders
python scripts/pci_compliance_checker.py \
--input controls.json \
--format markdown \
--output compliance_report.md
# Check specific requirements only
python scripts/pci_compliance_checker.py \
--input controls.json \
--requirements 3,4,7,8 \
--output data_security_report.json
Input Format (controls.json):
{
"organization": "Acme Payments",
"assessment_date": "2026-03-09",
"merchant_level": 2,
"requirements": {
"1": {
"network_segmentation": true,
"firewall_rules_documented": true,
"waf_deployed": true,
"inbound_traffic_restricted": true,
"outbound_traffic_restricted": false,
"wireless_networks_segmented": true,
"notes": "Outbound filtering planned for Q2"
},
"3": {
"pan_storage_minimized": true,
"pan_masked_when_displayed": true,
"pan_encrypted_at_rest": true,
"encryption_algorithm": "AES-256",
"key_management_procedures": true,
"tokenization_implemented": true,
"sad_not_stored_after_auth": true,
"notes": "Tokenization covers 95% of stored PANs"
}
}
}
CDE scoping and SAQ type determination engine.
Capabilities:
Usage:
# Determine SAQ type and CDE scope
python scripts/pci_scope_analyzer.py \
--input business_model.json \
--output scope_report.json
# Markdown scoping worksheet
python scripts/pci_scope_analyzer.py \
--input business_model.json \
--format markdown \
--output scoping_worksheet.md
Input Format (business_model.json):
{
"organization": "Acme Payments",
"business_type": "e-commerce",
"payment_channels": ["web", "mobile_app"],
"card_present": false,
"card_not_present": true,
"stores_pan": false,
"processes_pan": false,
"transmits_pan": false,
"payment_processor": "Stripe",
"uses_iframe_redirect": true,
"uses_p2pe": false,
"annual_transactions": 500000,
"card_brands": ["visa", "mastercard", "amex"],
"systems": [
{
"name": "web-frontend",
"type": "web_server",
"handles_cardholder_data": false,
"connected_to_cde": false,
"security_impacting": true,
"description": "Customer-facing e-commerce site with iframe payment"
},
{
"name": "payment-api",
"type": "application_server",
"handles_cardholder_data": false,
"connected_to_cde": true,
"security_impacting": true,
"description": "API server that communicates with Stripe"
}
]
}
The Payment Card Industry Data Security Standard (PCI DSS) is a global security standard developed by the PCI Security Standards Council (PCI SSC), founded by American Express, Discover, JCB, Mastercard, and Visa. It applies to all entities that store, process, or transmit cardholder data (CHD) or sensitive authentication data (SAD).
| Date | Milestone |
|---|---|
| March 2022 | PCI DSS v4.0 published |
| March 2024 | v3.2.1 retired; v4.0 is the only active version |
| March 31, 2025 | All future-dated requirements become mandatory |
All organizations must now comply with the full PCI DSS v4.0 standard, including all previously future-dated requirements.
Cardholder Data (CHD):
Sensitive Authentication Data (SAD): Must NEVER be stored after authorization, even if encrypted.
Objective: Protect the cardholder data environment through network security controls.
Key Sub-Requirements:
Implementation Guidance:
Objective: Ensure all systems are configured securely with no unnecessary default settings.
Key Sub-Requirements:
Implementation Guidance:
Objective: Minimize stored data and protect it with strong cryptography.
Key Sub-Requirements:
Implementation Guidance:
Tokenization vs Encryption Decision:
| Factor | Tokenization | Encryption |
|---|---|---|
| Reversibility | Non-reversible (preferred) | Reversible with key |
| Scope reduction | Removes systems from CDE scope | Systems remain in scope |
| Performance | Faster lookup (token maps) | Encryption/decryption overhead |
| Use case | Card-on-file, recurring billing | Data that must be recovered |
| Recommendation | Prefer tokenization when possible | Use when PAN recovery is required |
Objective: Encrypt CHD whenever transmitted over open, public networks.
Key Sub-Requirements:
Implementation Guidance:
Objective: Defend all systems against malware.
Key Sub-Requirements:
Implementation Guidance:
Objective: Protect against vulnerabilities through secure development and timely patching.
Key Sub-Requirements:
Implementation Guidance:
Objective: Limit access to CHD to only those with a legitimate business need.
Key Sub-Requirements:
Implementation Guidance:
Objective: Ensure all access to CDE is identified and strongly authenticated.
Key Sub-Requirements:
Implementation Guidance:
Objective: Prevent unauthorized physical access to systems that store, process, or transmit CHD.
Key Sub-Requirements:
Implementation Guidance:
Objective: Create comprehensive audit trails for all access to CDE and CHD.
Key Sub-Requirements:
Implementation Guidance:
Objective: Regularly test security controls, systems, and networks to verify they work.
Key Sub-Requirements:
Implementation Guidance:
Objective: Maintain an information security policy that addresses all PCI DSS requirements.
Key Sub-Requirements:
Implementation Guidance:
1. Customized Approach (NEW) Organizations can now meet PCI DSS requirements using a "customized approach" rather than the traditional "defined approach." This allows organizations to design their own security controls, provided they meet the security objective of each requirement. Requires targeted risk analysis documentation and validation by QSA.
2. Targeted Risk Analysis v4.0 requires organizations to perform documented, targeted risk analyses for certain requirements (e.g., frequency of activities, password/passphrase policies). This replaces the "one-size-fits-all" approach.
3. Enhanced Authentication Requirements
4. Payment Page Script Security (6.4.3) All scripts on payment pages must be managed, authorized, and monitored for integrity. This addresses Magecart-style attacks.
5. Anti-Phishing Mechanisms (5.4.1) Organizations must implement automated anti-phishing mechanisms (e.g., DMARC, email sandbox).
6. Encryption of PAN Over Trusted Internal Networks (4.2.1) PAN must now be encrypted during transmission over ALL networks, not just public networks. Internal network encryption required.
7. Automated Log Review (10.4.1.1) Automated mechanisms must perform audit log reviews — manual-only review no longer sufficient.
All of the following became mandatory as of March 31, 2025:
| Requirement | What Changed |
|---|---|
| 3.3.2 | SAD encrypted before authorization if stored |
| 3.5.1.2 | Disk-level encryption no longer satisfies requirement (must be above disk) |
| 5.3.3 | Anti-malware scans on removable media |
| 5.4.1 | Anti-phishing mechanisms required |
| 6.3.2 | Software inventory for vulnerability management |
| 6.4.2 | WAF in blocking mode for public web apps |
| 6.4.3 | Payment page script management |
| 8.3.6 | 12-character minimum passwords |
| 8.4.2 | MFA for all CDE access |
| 8.5.1 | MFA replay attack protection |
| 8.6.1-3 | System/service account management |
| 10.4.1.1 | Automated log review |
| 10.7.2 | Detect failures of critical security controls |
The Cardholder Data Environment (CDE) includes:
| Category | Definition | In Scope? | Examples |
|---|---|---|---|
| CDE Systems | Store, process, or transmit CHD | Yes — Full scope | Payment servers, databases with PAN, POS terminals |
| Connected-to | Direct connectivity to CDE | Yes — Full scope | DNS servers for CDE, AD/LDAP for CDE authentication |
| Security-Impacting | Provide security services to CDE | Yes — Full scope | SIEM, AV server, patch management for CDE systems |
| Out of Scope | No connectivity, no CHD, no security impact | No | Isolated HR systems, marketing servers |
1. Tokenization: Replace PAN with non-reversible tokens. Systems that only handle tokens are out of scope.
2. P2PE (Point-to-Point Encryption): Validated P2PE solutions encrypt cardholder data at the point of interaction. Merchants using validated P2PE can use SAQ P2PE (reduced scope).
3. Network Segmentation: Isolate CDE on a separate network segment with firewalls and strict access controls. Non-CDE segments are out of scope.
4. Outsource Processing: Use third-party payment processors (Stripe, Braintree, Adyen) to handle all CHD. The merchant never touches cardholder data.
5. iFrame/Redirect: For e-commerce, use the payment processor's hosted payment page (iFrame or redirect). The merchant's systems never receive cardholder data.
Self-Assessment Questionnaires (SAQs) are validation tools for merchants and service providers not required to undergo a full on-site assessment (ROC).
| SAQ Type | Applies To | CHD Handling | Questions |
|---|---|---|---|
| SAQ A | E-commerce or MOTO merchants | All payment processing fully outsourced; no electronic storage/processing/transmission of CHD | ~30 |
| SAQ A-EP | E-commerce merchants | Payment page elements from third party, but merchant website impacts security of payment transaction | ~140 |
| SAQ B | Merchants with standalone POS (dial-out terminals) | Imprint-only or standalone dial-out terminals; no electronic CHD storage | ~40 |
| SAQ B-IP | Merchants with standalone IP-connected POS | Standalone POS terminals connected via IP; no electronic CHD storage | ~80 |
| SAQ C | Merchants with payment app systems connected to internet | Payment application connected to internet; no electronic CHD storage | ~160 |
Does your organization store, process, or transmit CHD?
├── No → Not subject to PCI DSS
└── Yes → Continue
│
Are you a Service Provider?
├── Yes → SAQ D (Service Provider) or ROC
└── No (Merchant) → Continue
│
Do you store CHD electronically?
├── Yes → SAQ D (Merchant)
└── No → Continue
│
E-commerce only?
├── Yes → Do you fully outsource all payment processing?
│ ├── Yes (iFrame/redirect, no scripts on payment page) → SAQ A
│ └── No (payment page on your server or scripts affecting payment) → SAQ A-EP
├── Card-present (POS)?
│ ├── Using validated P2PE? → SAQ P2PE
│ ├── Standalone dial-out terminal? → SAQ B
│ ├── Standalone IP-connected terminal? → SAQ B-IP
│ └── Payment application system? → SAQ C
└── Virtual terminal only? → SAQ C-VT
Who: Level 2-4 merchants (unless acquirer requires ROC) What: Self-assessment using applicable SAQ type Frequency: Annual Output: Completed SAQ + Attestation of Compliance (AOC)
Who: Level 1 merchants, all Level 1 service providers What: On-site assessment by Qualified Security Assessor (QSA) Frequency: Annual Output: ROC document + AOC
Who: All entities, accompanies SAQ or ROC What: Executive summary confirming compliance status Frequency: Annual, accompanies assessment Output: Signed AOC form
| Level | Annual Visa Transactions | Assessment Required |
|---|---|---|
| Level 1 | Over 6 million | Annual ROC by QSA + quarterly ASV scan |
| Level 2 | 1 million to 6 million | Annual SAQ + quarterly ASV scan |
| Level 3 | 20,000 to 1 million (e-commerce) | Annual SAQ + quarterly ASV scan |
| Level 4 | Under 20,000 (e-commerce) or up to 1 million (other) | Annual SAQ + quarterly ASV scan (recommended) |
Note: Card brands and acquirers may have different thresholds. Check with your acquirer.
| Level | Annual Transactions | Assessment Required |
|---|---|---|
| Level 1 | Over 300,000 | Annual ROC by QSA + quarterly ASV scan |
| Level 2 | Under 300,000 | Annual SAQ D + quarterly ASV scan |
Purpose: Verify CDE is properly isolated from non-CDE networks.
Testing Methods:
Frequency: Annually (every 6 months for service providers)
AWS:
Azure:
GCP:
┌───────────────┐ ┌──────────────────┐ ┌────────────────┐
│ Customer │────▶│ Payment Page │────▶│ Token Service │
│ (Browser) │ │ (Merchant) │ │ (Processor) │
└───────────────┘ └──────────────────┘ └──────┬─────────┘
│
┌────────▼────────┐
│ Token Vault │
│ (PAN → Token) │
└────────┬────────┘
│
┌────────▼────────┐
│ Card Network │
│ (Detokenize) │
└─────────────────┘
Key Points:
DUKPT (Derived Unique Key Per Transaction):
P2PE (Point-to-Point Encryption):
Key Lifecycle:
Deliverables:
| Guide | Description |
|---|---|
| PCI DSS Requirements Guide | Complete 12 requirements with sub-requirements, testing procedures, v4.0 changes |
| PCI Infrastructure Security | Network architecture, cloud deployment, tokenization, key management, API security |
Weekly Installs
1
Repository
GitHub Stars
29
First Seen
Today
Security Audits
Gen Agent Trust HubPassSocketFailSnykPass
Installed on
zencoder1
amp1
cline1
openclaw1
opencode1
cursor1
通过 LiteLLM 代理让 Claude Code 对接 GitHub Copilot 运行 | 高级变通方案指南
31,600 周安装
| 11.3.1.1 | Manage all vulnerabilities (not just high/critical) |
| 11.4.7 | Multi-tenant service provider pen testing |
| 11.5.1.1 | IDS/IPS alerts for suspected compromise |
| 11.6.1 | Payment page tamper detection |
| 12.3.1 | Targeted risk analysis |
| 12.6.3.1 | Phishing/social engineering in awareness training |
| 12.10.7 | Respond to unexpected stored PAN |
| SAQ C-VT | Merchants with web-based virtual terminals | Manual entry via virtual terminal from processor's web-based solution; no electronic CHD storage | ~80 |
| SAQ D (Merchant) | All other merchants | Does not qualify for other SAQ types | ~330 |
| SAQ D (Service Provider) | Service providers | Service providers eligible for SAQ | ~330 |
| SAQ P2PE | Merchants using validated P2PE | Hardware terminals with validated P2PE solution; no electronic CHD storage | ~30 |