ISO 27001 Evidence Collection
Systematically collect audit evidence for ISO 27001:2022 and SOC 2. This skill provides API-first evidence collection commands, organizes evidence by control, and validates completeness before auditor review.
Security Model
- - No scripts executed — this skill is markdown-only procedural guidance
- No secrets required — works with reference checklists; CLI commands use existing local credentials
- Evidence stays local — all outputs go to the local filesystem
- IP-clean — references NIST SP 800-53 (public domain); ISO controls cited by section ID only
When to Use
Activate this skill when:
- 1. Preparing evidence package for external audit — 2-4 weeks before auditor arrives
- Quarterly evidence refresh — update evidence that has aged beyond the audit window
- After remediation — collect evidence proving a finding has been fixed
- New system onboarding — establish baseline evidence for a newly in-scope system
- Evidence gap analysis — identify what's missing before the audit
Do NOT use for:
- - Running the internal audit itself — use INLINECODE0
- SOC 2-only readiness assessment — use INLINECODE1
- Interpreting audit findings — use the internal audit skill
Core Concepts
Evidence Hierarchy (Best to Worst)
| Rank | Type | Example | Why Better |
|---|
| 1 | API export (JSON/CSV) | INLINECODE2 | Timestamped, tamper-evident, reproducible |
| 2 |
System-generated report | SOC 2 report from vendor, SIEM export | Authoritative source, includes metadata |
| 3 |
Configuration export | Terraform state, policy JSON | Shows intended state, version-controlled |
| 4 |
Screenshot with system clock |
screencapture -x ~/evidence/... | Visual proof, but harder to validate |
| 5 |
Manual attestation | Signed statement by responsible person | Last resort, requires corroboration |
Evidence Freshness Requirements
| Evidence Type | Max Age | Refresh Cadence |
|---|
| Access lists | 90 days | Quarterly |
| Vulnerability scans |
30 days | Monthly |
| Configuration exports | 90 days | Quarterly |
| Training records | 12 months | Annual |
| Penetration test | 12 months | Annual |
| Policy documents | 12 months | Annual review |
| Incident records | Audit period | Continuous |
| Risk assessment | 12 months | Annual + on change |
Evidence Naming Convention
CODEBLOCK0
Examples:
- - INLINECODE4
- INLINECODE5
- INLINECODE6
Step-by-Step Workflow
Step 1: Identify Evidence Gaps
Determine what evidence is missing or stale.
CODEBLOCK1
Step 2: Prioritize Collection
Order evidence collection by:
- 1. Missing evidence for Critical-tier controls — audit blockers
- Stale evidence past renewal date — auditor will reject
- Evidence for Relevant-tier controls — expected but not blocking
- Checkbox-tier evidence — policies and attestations
Step 3: Collect by Platform
Run evidence collection commands grouped by platform to minimize context-switching.
GitHub Evidence
CODEBLOCK2
GCP Evidence
CODEBLOCK3
Azure Evidence
CODEBLOCK4
Google Workspace Evidence
CODEBLOCK5
macOS Endpoint Evidence
CODEBLOCK6
Step 4: Validate Evidence Package
Check completeness before submitting to auditor:
- 1. Completeness: Do you have evidence for every applicable control in the SoA?
- Freshness: Is every piece of evidence within the required age?
- Format: Are API exports in JSON/CSV with timestamps? Screenshots have system clock visible?
- Naming: Files follow the naming convention?
- Coverage: Critical-tier controls have at least 2 forms of evidence?
CODEBLOCK7
Step 5: Generate Evidence Index
Create an index file listing all evidence, mapped to controls:
CODEBLOCK8
DO / DON'T
DO
- - Use API exports with ISO 8601 timestamps over screenshots whenever possible
- Collect evidence from the SOURCE system (IdP, not a secondary report)
- Include metadata: collection date, system version, user who collected
- Store evidence in version-controlled directory with clear naming
- Collect evidence for the AUDIT PERIOD (usually past 12 months), not just current state
- Use
screencapture -x ~/evidence/{filename}.png for screenshots (captures without shadow/border)
DON'T
- - Take screenshots without visible system clock (menu bar on macOS, taskbar on Windows)
- Collect evidence from sandbox/staging instead of production
- Manually edit evidence after collection (auditors may verify against source)
- Wait until the week before the audit to collect everything
- Assume stale evidence is acceptable — check freshness requirements above
- Mix evidence from different audit periods in the same file
Troubleshooting
| Problem | Solution |
|---|
| API command requires auth | Use existing local credentials: gcloud auth login, az login, INLINECODE10 |
| Tool not installed |
Install:
brew install gh,
brew install --cask google-cloud-sdk,
brew install azure-cli |
| Insufficient permissions | Request read-only access to the relevant service; document the access request as evidence |
| Evidence too large | Use
--limit or
--max-events flags; collect summary statistics instead of full export |
| Vendor won't provide SOC 2 report | Request via their trust center; if unavailable, document the request and use their security page |
| Screenshot doesn't include clock | On macOS: use full-screen capture, or
screencapture -x which includes menu bar |
Rules
For detailed evidence collection guidance by topic:
| File | Coverage |
|---|
| INLINECODE17 | CLI commands by cloud provider (GCP, Azure, AWS, GitHub, Google Workspace) |
| INLINECODE18 |
When and how to take audit-ready screenshots |
|
rules/evidence-types.md | Evidence type requirements per control domain |
Attribution
Evidence collection procedures and control guidance developed with Internal ISO Audit (Hazel Castro, ISO 27001 Lead Auditor, 14+ years, 100+ audits).
Runtime Detection
- 1. Compliance MCP server available (best) — Automated gap detection, evidence freshness tracking
- Local compliance data available (good) — Reads evidence status from INLINECODE20
- Reference only (baseline) — Uses embedded checklists and command reference
ISO 27001 证据收集
系统化收集ISO 27001:2022和SOC 2的审计证据。本技能提供API优先的证据收集命令,按控制项组织证据,并在审计师审查前验证完整性。
安全模型
- - 不执行脚本 — 本技能仅为基于Markdown的程序性指导
- 无需密钥 — 使用参考检查清单;CLI命令使用现有的本地凭证
- 证据保留在本地 — 所有输出均保存至本地文件系统
- IP清洁 — 引用NIST SP 800-53(公共领域);ISO控制项仅通过章节ID引用
使用时机
在以下情况下激活本技能:
- 1. 为外部审计准备证据包 — 审计师到达前2-4周
- 季度证据更新 — 更新已超出审计窗口期的证据
- 整改完成后 — 收集证明已修复发现项的证据
- 新系统接入 — 为新纳入范围的系统建立基线证据
- 证据差距分析 — 在审计前识别缺失项
请勿用于:
- - 执行内部审计本身 — 请使用 iso-27001-internal-audit
- 仅SOC 2就绪评估 — 请使用 soc2-readiness
- 解读审计发现项 — 请使用内部审计技能
核心概念
证据层级(从优到劣)
| 等级 | 类型 | 示例 | 优势 |
|---|
| 1 | API导出(JSON/CSV) | gcloud iam service-accounts list --format=json | 带时间戳、防篡改、可复现 |
| 2 |
系统生成报告 | 供应商SOC 2报告、SIEM导出 | 权威来源,包含元数据 |
| 3 |
配置导出 | Terraform状态、策略JSON | 显示预期状态,版本受控 |
| 4 |
含系统时钟的截图 | screencapture -x ~/evidence/... | 可视化证明,但较难验证 |
| 5 |
手动证明 | 负责人签署声明 | 最后手段,需佐证 |
证据时效性要求
| 证据类型 | 最大时效 | 更新频率 |
|---|
| 访问列表 | 90天 | 季度 |
| 漏洞扫描 |
30天 | 月度 |
| 配置导出 | 90天 | 季度 |
| 培训记录 | 12个月 | 年度 |
| 渗透测试 | 12个月 | 年度 |
| 政策文件 | 12个月 | 年度审查 |
| 事件记录 | 审计周期 | 持续 |
| 风险评估 | 12个月 | 年度+变更时 |
证据命名规范
{控制项ID}{证据类型}{YYYY-MM-DD}.{扩展名}
示例:
- - A.5.15user-access-list2026-02-28.json
- A.8.8vulnerability-scan2026-02-28.csv
- A.8.13backup-test-results2026-02-28.pdf
分步工作流程
第1步:识别证据差距
确定缺失或过时的证据。
如果合规MCP可用:
list
evidencegaps(framework=iso27001_2022, tier=critical)
如果读取本地合规数据:
检查 compliance/evidence/*.md 文件中 upload_status != OK 的项
检查 renewal_next 日期以查找即将到期的项
第2步:确定收集优先级
按以下顺序收集证据:
- 1. 关键级控制项的缺失证据 — 审计阻塞项
- 已过更新日期的过期证据 — 审计师将拒绝
- 相关级控制项的证据 — 预期但不阻塞
- 复选框级证据 — 政策和证明
第3步:按平台收集
按平台分组运行证据收集命令,以减少上下文切换。
GitHub 证据
bash
组织设置:MFA要求、默认权限
gh api orgs/{org} | jq {
two
factorrequirement_enabled,
default
repositorypermission,
members
cancreate
publicrepositories
} > evidence/A.5.17
github-org-mfa$(date +%Y-%m-%d).json
生产仓库的分支保护
for repo in $(gh repo list {org} --json name -q .[].name); do
gh api repos/{org}/$repo/branches/main/protection 2>/dev/null | \
jq {repo: $repo, protection: .} >> evidence/A.8.32
branch-protection$(date +%Y-%m-%d).json
done
最近合并的PR(变更管理证据)
gh pr list --state merged --limit 50 --json number,title,author,reviewDecision,mergedAt,mergedBy \
> evidence/A.8.32
change-records$(date +%Y-%m-%d).json
Dependabot告警(漏洞管理)
gh api repos/{org}/{repo}/dependabot/alerts?state=open \
> evidence/A.8.8
dependabot-alerts$(date +%Y-%m-%d).json
密钥扫描告警
gh api orgs/{org}/secret-scanning/alerts --paginate \
> evidence/A.8.24
secret-scanning$(date +%Y-%m-%d).json
审计日志
gh api orgs/{org}/audit-log?per_page=100 \
> evidence/A.8.15
github-audit-log$(date +%Y-%m-%d).json
GCP 证据
bash
IAM策略(访问控制)
gcloud projects get-iam-policy {project} --format=json \
> evidence/A.5.15
gcp-iam-policy$(date +%Y-%m-%d).json
服务账号
gcloud iam service-accounts list --format=json \
> evidence/A.5.16
gcp-service-accounts$(date +%Y-%m-%d).json
审计日志配置
gcloud projects get-iam-policy {project} --format=json | jq .auditConfigs \
> evidence/A.8.15
gcp-audit-config$(date +%Y-%m-%d).json
日志接收器(集中化)
gcloud logging sinks list --format=json \
> evidence/A.8.15
gcp-log-sinks$(date +%Y-%m-%d).json
计算实例(资产清单)
gcloud compute instances list --format=json \
> evidence/A.5.9
gcp-compute-inventory$(date +%Y-%m-%d).json
Cloud SQL备份配置
gcloud sql backups list --instance={instance} --format=json \
> evidence/A.8.13
gcp-sql-backups$(date +%Y-%m-%d).json
防火墙规则
gcloud compute firewall-rules list --format=json \
> evidence/A.8.20
gcp-firewall-rules$(date +%Y-%m-%d).json
Azure 证据
bash
角色分配(访问控制)
az role assignment list --all --output json \
> evidence/A.5.15
azure-role-assignments$(date +%Y-%m-%d).json
活动日志(审计追踪)
az monitor activity-log list --max-events 100 --output json \
> evidence/A.8.15
azure-activity-log$(date +%Y-%m-%d).json
网络安全组
az network nsg list --output json \
> evidence/A.8.20
azure-nsgs$(date +%Y-%m-%d).json
备份任务
az backup job list --resource-group {rg} --vault-name {vault} --output json \
> evidence/A.8.13
azure-backup-jobs$(date +%Y-%m-%d).json
存储加密
az storage account list --query [].{name:name, encryption:encryption} --output json \
> evidence/A.8.24
azure-storage-encryption$(date +%Y-%m-%d).json
Google Workspace 证据
bash
含MFA状态的用户列表
gam print users fields primaryEmail,name,isEnrolledIn2Sv,isEnforcedIn2Sv,lastLoginTime,suspended \
> evidence/A.5.17
workspace-users-mfa$(date +%Y-%m-%d).csv
管理员角色
gam print admins > evidence/A.8.2
workspace-admins$(date +%Y-%m-%d).csv