AWS - Macie Enum

AWS - Macie Enum

支持 HackTricks

Macie

Amazon Macie 是一项旨在 自动检测、分类和识别 AWS 账户内数据 的服务。它利用 机器学习 持续监控和分析数据,主要关注通过检查 云跟踪事件 数据和用户行为模式来检测和警报异常或可疑活动。

Amazon Macie 的主要功能:

  1. 主动数据审查:利用机器学习在 AWS 账户内各种操作发生时主动审查数据。

  2. 异常检测:识别不规则活动或访问模式,生成警报以减轻潜在的数据暴露风险。

  3. 持续监控:自动监控和检测 Amazon S3 中的新数据,利用机器学习和人工智能随着时间的推移适应数据访问模式。

  4. 使用 NLP 进行数据分类:利用自然语言处理 (NLP) 对不同数据类型进行分类和解释,分配风险评分以优先处理发现。

  5. 安全监控:识别安全敏感数据,包括 API 密钥、秘密密钥和个人信息,帮助防止数据泄露。

Amazon Macie 是一项 区域性服务,需要 'AWSMacieServiceCustomerSetupRole' IAM 角色和启用的 AWS CloudTrail 才能正常工作。

警报系统

Macie 将警报分类为预定义类别,如:

  • 匿名访问

  • 数据合规

  • 凭证丢失

  • 权限提升

  • 勒索软件

  • 可疑访问等。

这些警报提供详细描述和结果细分,以便有效响应和解决。

仪表板功能

仪表板将数据分类为多个部分,包括:

  • S3 对象(按时间范围、ACL、PII)

  • 高风险 CloudTrail 事件/用户

  • 活动位置

  • CloudTrail 用户身份类型等。

用户分类

用户根据其 API 调用的风险级别分为不同层级:

  • 铂金:高风险 API 调用,通常具有管理员权限。

  • 黄金:与基础设施相关的 API 调用。

  • 白银:中风险 API 调用。

  • 青铜:低风险 API 调用。

身份类型

身份类型包括 Root、IAM 用户、假设角色、联合用户、AWS 账户和 AWS 服务,指示请求的来源。

数据分类

数据分类包括:

  • 内容类型:基于检测到的内容类型。

  • 文件扩展名:基于文件扩展名。

  • 主题:根据文件中的关键词进行分类。

  • 正则表达式:根据特定的正则表达式模式进行分类。

这些类别中最高的风险决定文件的最终风险级别。

研究与分析

Amazon Macie 的研究功能允许对所有 Macie 数据进行自定义查询以进行深入分析。过滤器包括 CloudTrail 数据、S3 存储桶属性和 S3 对象。此外,它支持邀请其他账户共享 Amazon Macie,促进协作数据管理和安全监控。

枚举

# Get buckets
aws macie2 describe-buckets

# Org config
aws macie2 describe-organization-configuration

# Get admin account (if any)
aws macie2 get-administrator-account
aws macie2 list-organization-admin-accounts # Run from the management account of the org

# Get macie account members (run this form the admin account)
aws macie2 list-members

# Check if automated sensitive data discovey is enabled
aws macie2 get-automated-discovery-configuration

# Get findings
aws macie2 list-findings
aws macie2 get-findings --finding-ids <ids>
aws macie2 list-findings-filters
aws macie2 get -findings-filters --id <id>

# Get allow lists
aws macie2 list-allow-lists
aws macie2 get-allow-list --id <id>

# Get different info
aws macie2 list-classification-jobs
aws macie2 list-classification-scopes
aws macie2 list-custom-data-identifiers

后期利用

从攻击者的角度来看,这项服务并不是为了检测攻击者,而是为了检测存储文件中的敏感信息。因此,这项服务可能帮助攻击者在存储桶中找到敏感信息。 然而,攻击者也可能对干扰该服务感兴趣,以防止受害者收到警报,从而更容易窃取该信息。

TODO: 欢迎提交PR!

参考文献

支持 HackTricks

Last updated