用 Claude Code 审查医疗网站的 GCP IAM 权限
面向医疗网站的 GCP IAM、日志、服务账号和个人信息边界清单。
医疗网站的页面可能很简单,但背后的权限链条常常很乱。一个咨询表单会把姓名、电话、咨询内容、预约日期送到 Cloud Run、邮件、日志、CSV、外部制作公司和广告代理商。
本文说明如何用 Claude Code 盘点 GCP IAM,同时避免把真实患者数据交给代理。目标不是炫技,而是画出边界:谁能看代码,谁能改页面,谁能看日志,谁必须等待院内确认。
本文要点
-
Map forms, logs, secrets, CSV exports, and vendors before changing IAM.
-
Let Claude Code prepare inventory tables, not legal or medical conclusions.
-
Split read-only review, staging work, approval-gated changes, and production deploy.
-
Use official references for IAM, service accounts, audit logs, Data Access logs, Sensitive Data Protection, and medical privacy guidance.
-
Send readers to training because this needs clinic-specific review.
常见失败
医疗网站的权限盘点不是从角色名开始,而是从患者会触碰的页面开始。咨询表单、预约系统、通知邮件、日志、CSV、备份、广告报告和制作公司的修正范围都要放在同一张图上。Claude Code 可以读配置和代码,整理表格、差分、候选问题和检查清单。人要决定个人信息、合同、院内规则、患者说明和发布批准。
Official references: Use IAM securely, service account best practices, Cloud Audit Logs, Data Access audit logs, Sensitive Data Protection, and medical care privacy guidance.
从表单倒推权限
医疗网站的权限盘点不是从角色名开始,而是从患者会触碰的页面开始。咨询表单、预约系统、通知邮件、日志、CSV、备份、广告报告和制作公司的修正范围都要放在同一张图上。Claude Code 可以读配置和代码,整理表格、差分、候选问题和检查清单。人要决定个人信息、合同、院内规则、患者说明和发布批准。
| Area | Inventory | Human review |
| --- | --- | --- |
| Form | fields, destination, confirmation | does it ask too much |
| Runtime | service account, env vars | does patient data reach logs |
| Logs | viewers, retention, data access | who needs read evidence |
| Secrets | API keys, mail credentials | are secrets shared safely |
| CSV | fields, viewers, exports | can vendors see patient data |
Claude Code 负责什么,人负责什么
医疗网站的权限盘点不是从角色名开始,而是从患者会触碰的页面开始。咨询表单、预约系统、通知邮件、日志、CSV、备份、广告报告和制作公司的修正范围都要放在同一张图上。Claude Code 可以读配置和代码,整理表格、差分、候选问题和检查清单。人要决定个人信息、合同、院内规则、患者说明和发布批准。
3 个 Use case
Use case 1: Retired users and vendors
-
Input: IAM export, service accounts, vendor scope, retired staff list.
-
Output: member, role, purpose, patient-data touch point, reviewer.
-
Human review: confirm contract, clinic owner, and whether the access is still needed.
Use case 2: Patient data in logs
-
Input: form handler code, logger calls, sample log names, email templates.
-
Output: logged fields, mask candidates, remove candidates, debug-only fields.
-
Human review: decide whether names, phone numbers, consultation text, symptoms, and dates belong in logs.
Use case 3: Read-only path for AI agents
-
Input: repository, project ID, resources to inspect, and prohibited data.
-
Output: read-only tasks, staging-only tasks, approval-gated tasks, prohibited tasks.
-
Human review: check credentials, commands, output files, deletion targets, and deployments.
可复制提示词
Review GCP IAM for a medical website. Keep patient data away from unnecessary staff, vendors, and AI agents. Build tables for IAM roles, service accounts, logs, secrets, forms, emails, and CSV exports. Do not run change commands. Do not paste real patient values. Mark human approvals. Main CTA: /training/.
可运行检查代码
const iamRows = [{ member: '[email protected]', role: 'roles/editor', purpose: 'LP edit', touchesPatientData: true, reviewer: '' }];
const findings = iamRows.filter((row) => row.role === 'roles/editor' || (row.touchesPatientData && !row.reviewer));
console.log(findings.length ? findings : 'Medical IAM draft passed.');
if (findings.length) process.exitCode = 1;
Pitfall: 代理为了修权限反而扩大权限
医疗网站的权限盘点不是从角色名开始,而是从患者会触碰的页面开始。咨询表单、预约系统、通知邮件、日志、CSV、备份、广告报告和制作公司的修正范围都要放在同一张图上。Claude Code 可以读配置和代码,整理表格、差分、候选问题和检查清单。人要决定个人信息、合同、院内规则、患者说明和发布批准。
The fix is to name prohibited data first: patient names, phone numbers, consultation text, appointment details, inboxes, raw logs, and downloaded service account keys. Use masked samples, column names, or counts when possible.
FAQ
Q. Can the agent read the repository? A. Code and configuration are a good start; real patient messages are not.
Q. Is removing editor enough? A. No. Logs, secrets, CSV exports, emails, datasets, and CI/CD can still expose data.
Q. Why training? A. Permission boundaries depend on the clinic, vendors, and publishing flow.
咨询入口
ClaudeCodeLab training can help map forms, GCP IAM, logs, secrets, service accounts, and vendor boundaries for a medical website.
实际检查结果
This article checks frontmatter, official links, three use cases, input-output-human review labels, code fences, and the /training/ CTA. The code sample is intentionally small and checks broad roles plus missing reviewers.
相关文章
内科·儿科诊所电话和网络咨询初步答复用AI提速的实操手册
用Claude Code把内科·儿科诊所前台的「同样问题打来打去」整理成FAQ和初步答复话术。附提示词模板和校验脚本。
用 Claude Code 整理诊所预约咨询:让电话、表单和 LINE 各司其职
面向诊所的预约页面整理流程:减少初诊患者迷路,也减轻前台反复确认的负担。
宠物医院用 Claude Code 起草主人说明、预约确认与术后护理须知,省一半时间
面向宠物医院前台和兽医。用 Claude Code 起草主人说明文、预约确认、术后护理须知的步骤、可直接复制的提示词,以及个人信息注意事项,全部整理好。
免费 PDF: Claude Code 速查表
输入邮箱即可获取一页 PDF,整理常用命令、审查习惯和安全工作流。
我们会妥善保护你的信息,不发送垃圾邮件。
让 Claude Code 真正进入可验证的工作流
先用免费 PDF 固定基础,再用 Gumroad 教材复用工作流;如果涉及团队导入、权限或收入路径,可以直接咨询。
关于作者
Masa
专注 Claude Code 实务流程、团队导入和内容转化的工程师。