Mounts AWS resources as a local filesystem for infrastructure exploration, security auditing, and configuration analysis using standard Unix tools like grep, diff, and cat.
你的 AWS,直接当成文件系统。

这样:
grep -l "AdministratorAccess" iam/users/*/policies.json
而不是这样:
aws iam list-users --query 'Users[].UserName' --output text | \
xargs -I{} sh -c 'aws iam list-attached-user-policies --user-name {} --query "AttachedPolicies[].PolicyArn" --output text' | \
grep AdministratorAccess
sisu 将 AWS 资源挂载为本地文件系统。用你熟悉的工具 —— grep、cat、diff、vim —— 而不是和 JSON 以及 AWS CLI 搏斗。
AI 友好设计: AI 工具无法 SSH 到服务器或运行交互式 AWS CLI 会话。但有了 sisu,你的整个 AWS 基础设施就变成了简单的文件路径,任何 AI 都能读取。远程 EC2 文件系统位于 ec2/<instance>/fs/ —— 让 AI 无需 SSH 即可浏览 /var/log、/etc 和实例上的任何文件。
目前支持 S3、SSM、IAM、VPC、Lambda、EC2、ECS、CloudFront、Secrets Manager、Route 53 和 CloudWatch Logs。
go install github.com/semonte/sisu@latest
需要 FUSE:
sudo apt install fuse # Ubuntu/Debian
sudo yum install fuse # RHEL/CentOS
sisu
搞定。你的 AWS 现在就在指尖:
~/.sisu/mnt/
├── default/ # AWS 配置文件
│ ├── global/ # IAM, S3, Route 53(区域无关)
│ │ ├── iam/
│ │ ├── route53/
│ │ └── s3/
│ ├── us-east-1/ # 区域服务
│ │ ├── cloudfront/
│ │ ├── ec2/
│ │ ├── ecs/
│ │ ├── lambda/
│ │ ├── logs/
│ │ ├── secrets/
│ │ ├── ssm/
│ │ └── vpc/
│ └── eu-west-1/
│ └── ...
├── prod/ # ~/.aws/credentials 中的其他配置文件
└── staging/
完成后输入 exit。
# 谁有管理员权限?
grep -l "AdministratorAccess" */global/iam/users/*/policies.json
# 开放 SSH 的安全组
grep -r '"FromPort": 22' */us-east-1/vpc/*/security-groups/
# Lambda 可以代入的角色
grep -l "lambda.amazonaws.com" */global/iam/roles/*/info.json
# SSM 中有密码?
grep -r "password" */us-east-1/ssm/
# 环境变量里藏了敏感信息的 Lambda 函数
grep -r "PASSWORD\|SECRET\|API_KEY" */us-east-1/lambda/*/env.json
# 使用已弃用运行时的函数
grep -r "python3.8\|nodejs16" */*/lambda/*/config.json
# 带有公网 IP 的 EC2 实例
grep -r "PublicIpAddress" */*/ec2/*/info.json
# 已停止的实例(白烧钱?)
grep -r '"Name": "stopped"' */*/ec2/*/info.json
# 通过 SSM 连接到 EC2 实例(无需 SSH 密钥!)
./default/us-east-1/ec2/i-abc123/connect
# 查看 EC2 启动日志和内核消息
cat default/us-east-1/ec2/i-abc123/console.log
# 查看所有密钥
ls */us-east-1/secrets/
# 读取一个密钥的值
cat default/us-east-1/secrets/myapp/database/value
# 列出所有 DNS 区域
ls */global/route53/
# 查看某个区域的 DNS 记录
cat default/global/route53/example.com/records.json
# 找出所有 CNAME 记录
grep -r '"Type": "CNAME"' */global/route53/*/records.json
# 在最近日志中搜索错误
grep -i "error" default/us-east-1/logs/aws/lambda/my-function/latest.log
# 查看所有日志组
ls */us-east-1/logs/
# 列出日志流(显示最近 20 条)
ls default/us-east-1/logs/aws/lambda/my-function/
# 查看某个日志流的事件
cat default/us-east-1/logs/aws/lambda/my-function/2024_01_15_abc123/events.log
# ECS:浏览集群、服务和任务
ls default/us-east-1/ecs/my-cluster/my-service/
cat default/us-east-1/ecs/my-cluster/my-service/logs/latest.log
# CloudFront:查看分发和函数
ls default/us-east-1/cloudfront/distributions/
cat default/us-east-1/cloudfront/functions/my-auth/code.js
# S3:检查存储桶策略和访问设置
cat default/global/s3/my-bucket/.meta/policy.json
cat default/global/s3/my-bucket/.meta/public-access-block.json
# 跨账号对比 IAM 角色
diff prod/global/iam/roles/api/info.json staging/global/iam/roles/api/info.json
# 跨区域对比安全组差异
diff default/us-east-1/vpc/vpc-xxx/security-groups/sg-xxx.json default/eu-west-1/vpc/vpc-yyy/security-groups/sg-yyy.json
# Lambda 配置差异
diff prod/us-east-1/lambda/my-func/config.json staging/us-east-1/lambda/my-func/config.json
# 用 jq 美化输出
cat default/global/iam/roles/my-role/info.json | jq '.AssumeRolePolicyDocument'
# 统计角色数量
ls default/global/iam/roles/ | wc -l
# 查找没有标签的资源
cat default/us-east-1/vpc/vpc-xxx/info.json | jq 'select(.Tags == null)'
# 列出所有 Lambda 运行时的使用情况
grep -h "Runtime" */*/lambda/*/config.json | sort | uniq -c
cat default/us-east-1/ssm/myapp/database-url # 读取
echo "postgres://prod:5432" > default/us-east-1/ssm/database-url # 写入
vim default/us-east-1/ssm/myapp/config # 编辑
cp local.txt default/global/s3/my-bucket/backup/
cat default/global/s3/my-bucket/logs/app.log | grep ERROR
rm default/global/s3/my-bucket/old-file.txt
sisu # 从根目录启动
sisu --profile prod # 从 prod/ 启动
sisu --profile prod --region us-east-1 # 从 prod/us-east-1/ 启动
sisu stop # 卸载
sisu --debug # 调试日志
日志流的 events.log 文件是按需从 AWS 流式拉取,而非一次性加载到内存:
cat、grep、head、less# 只拉取足够匹配的批次
grep "ERROR" .../my-stream/events.log
# 只拉取第一批
head -50 .../my-stream/events.log
# 按需加载滚动浏览
less .../my-stream/events.log
# 将拉取所有事件
cat .../my-stream/events.log | wc -l
注意: tail 不能正确用于流式文件,因为它会 seek 到文件末尾,但实际文件大小在完全加载之前是未知的。请使用 cat ... | tail 作为变通方法。
每个服务的日志直接位于其资源下 —— 无需四处寻找日志组:
# Lambda 函数日志
cat default/us-east-1/lambda/my-function/logs/latest.log
# EC2 实例日志(自动搜索包含实例 ID 的日志组)
cat default/us-east-1/ec2/i-abc123/logs/latest.log
# ECS 服务日志
cat default/us-east-1/ecs/my-cluster/my-service/logs/latest.log
# CloudFront 函数日志
cat default/us-east-1/cloudfront/functions/my-auth/logs/latest.log
所有集成日志均使用流式读取 —— 按需获取事件。
浏览 ECS 集群、服务和任务:
ecs/
├── my-cluster/
│ ├── web-service/
│ │ ├── info.json # 服务配置
│ │ ├── logs/
│ │ │ └── latest.log # 流式服务日志
│ │ └── tasks/
│ │ └── abc123/
│ │ └── info.json # 任务详情
│ └── api-service/
│ └── ...
# 列出所有 ECS 集群
ls default/us-east-1/ecs/
# 查看服务配置
cat default/us-east-1/ecs/my-cluster/web-service/info.json
# 流式获取服务日志
cat default/us-east-1/ecs/my-cluster/web-service/logs/latest.log
# 列出正在运行的任务
ls default/us-east-1/ecs/my-cluster/web-service/tasks/
浏览 CloudFront 分发和函数:
cloudfront/
├── distributions/
│ └── E1ABC123/
│ ├── info.json # 分发配置
│ └── origins.json # 包含 OAC/OAI 信息的源站
└── functions/
└── my-auth/
├── code.js # 函数源代码
├── config.json # 函数配置
└── logs/
└── latest.log # 函数执行日志
# 列出分发
ls default/us-east-1/cloudfront/distributions/
# 检查源站访问配置(排查 S3 访问问题!)
cat default/us-east-1/cloudfront/distributions/E1ABC123/origins.json
# 查看和编辑 CloudFront 函数代码
cat default/us-east-1/cloudfront/functions/my-auth/code.js
# 调试函数执行
cat default/us-east-1/cloudfront/functions/my-auth/logs/latest.log
每个 S3 存储桶都有一个隐藏的 .meta/ 目录,包含存储桶配置:
# 查看存储桶策略
cat default/global/s3/my-bucket/.meta/policy.json
# 检查阻止公开访问的设置
cat default/global/s3/my-bucket/.meta/public-access-block.json
调试 CloudFront 到 S3 的访问问题时非常有用!
每个 EC2 实例暴露如下内容:
ls default/us-east-1/ec2/i-abc123/
# info.json security-groups.json tags.json console.log connect fs/ logs/
通过 SSM 连接(无需 SSH 密钥、无需公网 IP):
./default/us-east-1/ec2/i-abc123/connect
查看启动日志和内核消息:
cat default/us-east-1/ec2/i-abc123/console.log
远程浏览实例的文件系统(通过 SSM Run Command):
# 列出实例上的文件
ls default/us-east-1/ec2/i-abc123/fs/etc/
# 读取远程文件
cat default/us-east-1/ec2/i-abc123/fs/etc/hostname
# 跨远程日志搜索
grep ERROR default/us-east-1/ec2/i-abc123/fs/var/log/syslog
# 比较实例间的配置
diff prod/us-east-1/ec2/i-111/fs/etc/nginx/nginx.conf \
prod/us-east-1/ec2/i-222/fs/etc/nginx/nginx.conf
无需 SSH 密钥或开放端口 —— 底层使用 SSM Run Command。
| 工具 | 作用 |
|---|---|
| fzf | 模糊查找器(带预览) |
| jq | JSON 查询/转换 |
| difftastic | 结构化差异(理解 JSON) |
# 交互式浏览和预览任何资源
find */global/iam/roles -name "info.json" | fzf --preview 'jq . {}'
# 查找内存设置较大的 Lambda 函数
jq -r 'select(.MemorySize > 512) | .FunctionName' */us-east-1/lambda/*/config.json
# 对比生产与预发布配置
difft prod/us-east-1/lambda/api/config.json staging/us-east-1/lambda/api/config.json
因为都是文件,AI 工具可以直接读取和分析你的 AWS:
cd ~/.sisu/mnt && claude
"查找允许从 0.0.0.0/0 SSH 的安全组"
"检查 IAM 角色中过于宽松的策略"
"对比生产与预发布的 Lambda 配置"
问题: ECS 服务失败,提示 "No Container Instances were found in your cluster"
使用 sisu 无需 SSH 即可诊断:
# 检查集群状态 —— 没有实例注册
cat ecs/jobdeck-cluster/info.json | jq '.RegisteredContainerInstancesCount'
# → 0
# 检查服务配置 —— 使用 EC2 启动类型
cat ecs/jobdeck-cluster/jobdeck-api/info.json | jq '.LaunchType, .FailedTasks'
# → "EC2", 136
# EC2 实例存在 —— 检查其 ECS 配置
cat ec2/i-xxx/fs/etc/ecs/ecs.config
# → ECS_CLUSTER=jobdeck-cluster ✓
# 检查 ECS 代理日志 —— 没有代理日志!
ls ec2/i-xxx/fs/var/log/ecs/
# → ecs-volume-plugin.log(缺少 ecs-agent.log!)
# 检查正在运行的 AMI
cat ec2/i-xxx/fs/etc/image-id
# → image_name="amzn2-ami-minimal-hvm" ← 不是 ECS 优化版!
根因发现: EC2 实例使用的是 Amazon Linux 2 最小化 AMI,而非 ECS 优化版。最小化 AMI 虽然安装了 ECS 包,但代理服务默认未启用。
修复: 使用 ECS 优化 AMI,或者在用户数据中添加 systemctl enable --now ecs。
以上所有排障都是由 Claude AI 通过 sisu 浏览文件系统完成的 —— 无需手动 SSH!
MIT
| 服务 | 读取 | 写入 | 删除 |
|---|
| S3(对象、存储桶策略、访问设置) | ✓ | ✓ | ✓ |
| SSM 参数存储 | ✓ | ✓ | ✓ |
| IAM(用户、角色、策略、组) | ✓ | - | - |
| VPC(子网、安全组、路由) | ✓ | - | - |
| Lambda(配置、策略、环境变量、日志) | ✓ | - | - |
| EC2(实例、安全组、标签、日志、远程文件系统) | ✓ | - | - |
| ECS(集群、服务、任务、日志) | ✓ | - | - |
| CloudFront(分发、函数、日志) | ✓ | - | - |
| Secrets Manager | ✓ | - | - |
| Route 53(区域、记录) | ✓ | - | - |
| CloudWatch Logs | ✓ | - | - |