AWS - Firewall Manager Enum

支持 HackTricks

Firewall Manager

AWS Firewall Manager 简化了 AWS WAF、AWS Shield Advanced、Amazon VPC 安全组和网络访问控制列表 (ACL)、AWS 网络防火墙、AWS Route 53 解析器 DNS 防火墙和第三方防火墙 的管理和维护。它使您能够仅配置一次防火墙规则、Shield Advanced 保护、VPC 安全组和网络防火墙设置,服务 会自动在您的账户和资源中强制执行这些规则和保护,包括新添加的资源。

该服务提供了 将特定资源分组和保护在一起 的能力,例如共享公共标签的资源或您所有的 CloudFront 分发。Firewall Manager 的一个显著优势是其能够 自动扩展保护到新添加的资源

一个 规则组(WAF 规则的集合)可以纳入 AWS Firewall Manager 策略中,然后链接到特定的 AWS 资源,如 CloudFront 分发或应用负载均衡器。

AWS Firewall Manager 提供 托管的应用程序和协议列表,以简化安全组策略的配置和管理。这些列表允许您定义政策允许或拒绝的协议和应用程序。托管列表有两种类型:

  • Firewall Manager 托管列表:这些列表包括 FMS-Default-Public-Access-Apps-AllowedFMS-Default-Protocols-AllowedFMS-Default-Protocols-Allowed。它们由 Firewall Manager 管理,包含应允许或拒绝公众访问的常用应用程序和协议。无法编辑或删除它们,但可以选择其版本。

  • 自定义托管列表:您自己管理这些列表。您可以创建符合组织需求的自定义应用程序和协议列表。与 Firewall Manager 托管列表不同,这些列表没有版本,但您可以完全控制自定义列表,允许您根据需要创建、编辑和删除它们。

需要注意的是,Firewall Manager 策略仅允许“阻止”或“计数”操作,没有“允许”选项。

先决条件

在配置 Firewall Manager 以有效保护您组织的资源之前,必须完成以下先决步骤。这些步骤提供了 Firewall Manager 强制执行安全策略和确保合规性所需的基础设置:

  1. 加入并配置 AWS Organizations:确保您的 AWS 账户是计划实施 AWS Firewall Manager 策略的 AWS Organizations 组织的一部分。这允许在组织内多个 AWS 账户之间集中管理资源和政策。

  2. 创建 AWS Firewall Manager 默认管理员账户:建立一个专门用于管理 Firewall Manager 安全策略的默认管理员账户。该账户将负责在组织内配置和强制执行安全策略。只有组织的管理账户能够创建 Firewall Manager 默认管理员账户。

  3. 启用 AWS Config:激活 AWS Config,以为 Firewall Manager 提供有效强制执行安全策略所需的配置数据和洞察。AWS Config 有助于分析、审计、监控和审计资源配置和更改,促进更好的安全管理。

  4. 对于第三方政策,在 AWS Marketplace 订阅并配置第三方设置:如果您计划使用第三方防火墙政策,请在 AWS Marketplace 中订阅它们并配置必要的设置。此步骤确保 Firewall Manager 能够集成并强制执行来自受信任第三方供应商的政策。

  5. 对于网络防火墙和 DNS 防火墙政策,启用资源共享:专门为网络防火墙和 DNS 防火墙政策启用资源共享。这允许 Firewall Manager 将防火墙保护应用于您组织的 VPC 和 DNS 解析,增强网络安全。

  6. 在默认禁用的区域使用 AWS Firewall Manager:如果您打算在默认禁用的 AWS 区域使用 Firewall Manager,请确保采取必要步骤以启用其在这些区域的功能。这确保在您组织运营的所有区域内一致的安全强制执行。

有关更多信息,请查看:开始使用 AWS Firewall Manager AWS WAF 策略

保护政策类型

AWS Firewall Manager 管理几种类型的政策,以在您组织的基础设施的不同方面强制执行安全控制:

  1. AWS WAF 策略:此策略类型支持 AWS WAF 和 AWS WAF Classic。您可以定义哪些资源受到该策略的保护。对于 AWS WAF 策略,您可以指定要首先和最后运行的规则组集。此外,账户所有者可以添加在这些集合之间运行的规则和规则组。

  2. Shield Advanced 策略:此策略在组织内为指定的资源类型应用 Shield Advanced 保护。它有助于防范 DDoS 攻击和其他威胁。

  3. Amazon VPC 安全组策略:通过此策略,您可以管理在整个组织中使用的安全组,在您的 AWS 环境中强制执行一组基线规则以控制网络访问。

  4. Amazon VPC 网络访问控制列表 (ACL) 策略:此策略类型使您能够控制在组织中使用的网络 ACL,允许您在 AWS 环境中强制执行一组基线网络 ACL。

  5. 网络防火墙策略:此策略将 AWS 网络防火墙保护应用于您组织的 VPC,增强网络安全,通过预定义规则过滤流量。

  6. Amazon Route 53 解析器 DNS 防火墙策略:此策略将 DNS 防火墙保护应用于您组织的 VPC,帮助阻止恶意域名解析尝试并强制执行 DNS 流量的安全策略。

  7. 第三方防火墙策略:此策略类型应用来自第三方防火墙的保护,这些防火墙通过 AWS Marketplace 控制台提供订阅。它允许您将来自受信任供应商的额外安全措施集成到您的 AWS 环境中。

  8. Palo Alto Networks Cloud NGFW 策略:此策略将 Palo Alto Networks Cloud 下一代防火墙 (NGFW) 保护和规则堆栈应用于您组织的 VPC,提供高级威胁防护和应用级安全控制。

  9. Fortigate 云原生防火墙 (CNF) 作为服务策略:此策略应用 Fortigate 云原生防火墙 (CNF) 作为服务的保护,提供行业领先的威胁防护、Web 应用防火墙 (WAF) 和针对云基础设施的 API 保护。

管理员账户

AWS Firewall Manager 通过其管理范围和两种类型的管理员账户提供灵活性,以管理您组织内的防火墙资源。

管理范围定义了 Firewall Manager 管理员可以管理的资源。在 AWS Organizations 管理账户将组织引入 Firewall Manager 后,它可以创建具有不同管理范围的其他管理员。这些范围可以包括:

  • 管理员可以应用政策的账户或组织单位 (OU)。

  • 管理员可以执行操作的区域。

  • 管理员可以管理的 Firewall Manager 策略类型。

管理范围可以是 完全或受限。完全范围授予管理员对 所有指定资源类型、区域和策略类型 的访问权限。相反,受限范围仅提供对资源、区域或策略类型的子集的管理权限。建议仅授予管理员完成其角色所需的权限。您可以将这些管理范围条件的任意组合应用于管理员,以确保遵循最小权限原则。

有两种不同类型的管理员账户,每种账户都有特定的角色和责任:

  • 默认管理员:

  • 默认管理员账户由 AWS Organizations 组织的管理账户在引入 Firewall Manager 过程中创建。

  • 此账户能够管理第三方防火墙,并拥有完全的管理范围。

  • 它作为 Firewall Manager 的主要管理员账户,负责在组织内配置和强制执行安全策略。

  • 虽然默认管理员对所有资源类型和管理功能具有完全访问权限,但如果在组织内使用多个管理员,它与其他管理员处于同一同级。

  • Firewall Manager 管理员:

  • 这些管理员可以在 AWS Organizations 管理账户指定的范围内管理资源,如管理范围配置所定义的。

  • Firewall Manager 管理员是为了在组织内履行特定角色而创建的,允许在保持安全和合规标准的同时进行责任的委派。

  • 创建后,Firewall Manager 会与 AWS Organizations 检查该账户是否已是委派管理员。如果不是,Firewall Manager 会调用 Organizations 将该账户指定为 Firewall Manager 的委派管理员。

管理这些管理员账户涉及在 Firewall Manager 中创建它们,并根据组织的安全要求和最小权限原则定义其管理范围。通过分配适当的管理角色,组织可以确保有效的安全管理,同时保持对敏感资源访问的细粒度控制。

需要强调的是,在一个组织内只能有一个账户作为 Firewall Manager 默认管理员,遵循“先入后出”原则。要指定新的默认管理员,必须遵循一系列步骤:

  • 首先,每个 Firewall Administrator 管理员账户必须撤销自己的账户。

  • 然后,现有的默认管理员可以撤销自己的账户,有效地将组织从 Firewall Manager 中移除。此过程将导致撤销账户创建的所有 Firewall Manager 策略被删除。

  • 最后,AWS Organizations 管理账户必须指定 Firewall Manager 默认管理员。

Enumeration

# Users/Administrators

## Get the AWS Organizations account that is associated with AWS Firewall Manager as the AWS Firewall Manager default administrator
aws fms get-admin-account

## List of Firewall Manager administrators within the organization
aws fms list-admin-accounts-for-organization # ReadOnlyAccess policy is not enough for this

## Return a list of the member accounts in the FM administrator's AWS organization
aws fms list-member-accounts # Only a Firewall Manager administrator or the Organization's management account can make this request

## List the accounts that are managing the specified AWS Organizations member account
aws fms list-admins-managing-account # ReadOnlyAccess policy is not enough for this

# Resources

## Get the resources that a Firewall Manager administrator can manage
aws fms get-admin-scope --admin-account <value> # ReadOnlyAccess policy is not enough for this

## Returns the summary of the resource sets used
aws fms list-resource-sets # ReadOnlyAccess policy is not enough for this

## Get information about a specific resource set
aws fms get-resource-set --identifier <value>  # ReadOnlyAccess policy is not enough for this

## Retrieve the list of tags for a given resource
aws fms list-tags-for-resource --resource-arn <value>

## List of the resources in the AWS Organization's accounts that are available to be associated with a FM resource set. Only one account is supported per request.
aws fms list-compliance-status --member-account-ids <value> --resource-type <value> # ReadOnlyAccess policy is not enough for this

## List the resources that are currently associated to a resource set
aws fms list-resource-set-resources --identifier <value> # ReadOnlyAccess policy is not enough for this

# Policies

## Returns the list of policies
aws fms list-policies

## Get information about the specified AWS Firewall Manager policy
aws fms get-policy --policy-id <value>

## List all of the third-party firewall policies that are associated with the third-party firewall administrator's account
aws fms list-third-party-firewall-firewall-policies --third-party-firewall <PALO_ALTO_NETWORKS_CLOUD_NGFW|FORTIGATE_CLOUD_NATIVE_FIREWALL> # ReadOnlyAccess policy is not enough for this

# AppsList

## Return a list of apps list
aws fms list-apps-lists --max-results [1-100]

## Get information about the specified AWS Firewall Manager applications list
aws fms get-apps-list --list-id <value>

# Protocols

## Get the details of the Firewall Manager protocols list.
aws fms list-protocols-lists

## Get information about the specified AWS Firewall Manager Protocols list
aws fms get-protocols-list --list-id <value>

# Compliance

## Return a summary of which member accounts are protected by the specified policy
aws fms list-compliance-status --policy-id <policy-id>

## Get detailed compliance information about the specified member account (resources that are in and out of compliance with the specified policy)
aws fms get-compliance-detail --policy-id <value> --member-account <value>

# Other useful info

## Get information about the SNS topic that is used to record AWS Firewall Manager SNS logs (if any)
aws fms get-notification-channel

## Get policy-level attack summary information in the event of a potential DDoS attack
aws fms get-protection-status --policy-id <value> # Just for Shield Advanced policy

## Get the onboarding status of a Firewall Manager admin account to third-party firewall vendor tenant.
aws fms get-third-party-firewall-association-status --third-party-firewall <PALO_ALTO_NETWORKS_CLOUD_NGFW|FORTIGATE_CLOUD_NATIVE_FIREWALL> # ReadOnlyAccess policy is not enough for this

## Get violations' details for a resource based on the specified AWS Firewall Manager policy and AWS account.
aws fms get-violation-details --policy-id <value> --member-account <value> --resource-id <value> --resource-type <value>

后期利用 / 绕过检测

organizations:DescribeOrganization & (fms:AssociateAdminAccount, fms:DisassociateAdminAccount, fms:PutAdminAccount)

拥有 fms:AssociateAdminAccount 权限的攻击者将能够设置防火墙管理器默认管理员账户。拥有 fms:PutAdminAccount 权限的攻击者将能够创建或更新防火墙管理器管理员账户,而拥有 fms:DisassociateAdminAccount 权限的潜在攻击者可以移除当前的防火墙管理器管理员账户关联。

  • 防火墙管理器默认管理员的解除关联遵循先进后出政策。所有防火墙管理器管理员必须解除关联,才能让防火墙管理器默认管理员解除该账户的关联。

  • 要通过 PutAdminAccount 创建防火墙管理器管理员,账户必须属于之前通过 AssociateAdminAccount 加入防火墙管理器的组织。

  • 防火墙管理器管理员账户的创建只能由组织的管理账户完成。

aws fms associate-admin-account --admin-account <value>
aws fms disassociate-admin-account
aws fms put-admin-account --admin-account <value>

潜在影响: 中心化管理的丧失、策略规避、合规性违规以及环境中安全控制的中断。

fms:PutPolicy, fms:DeletePolicy

拥有 fms:PutPolicyfms:DeletePolicy 权限的攻击者将能够创建、修改或永久删除 AWS Firewall Manager 策略。

aws fms put-policy --policy <value> | --cli-input-json file://<policy.json> [--tag-list <value>]
aws fms delete-policy --policy-id <value> [--delete-all-policy-resources | --no-delete-all-policy-resources]

一个通过宽松安全组的宽松策略示例,为了绕过检测,可以是以下内容:

{
"Policy": {
"PolicyName": "permisive_policy",
"SecurityServicePolicyData": {
"Type": "SECURITY_GROUPS_COMMON",
"ManagedServiceData": "{\"type\":\"SECURITY_GROUPS_COMMON\",\"securityGroups\":[{\"id\":\"<permisive_security_group_id>\"}], \"applyToAllEC2InstanceENIs\":\"true\",\"IncludeSharedVPC\":\"true\"}"
},
"ResourceTypeList": ["AWS::EC2::Instance", "AWS::EC2::NetworkInterface", "AWS::EC2::SecurityGroup", "AWS::ElasticLoadBalancingV2::LoadBalancer", "AWS::ElasticLoadBalancing::LoadBalancer"],
"ResourceType": "AWS::EC2::SecurityGroup",
"ExcludeResourceTags": false,
"ResourceTags": [],
"RemediationEnabled": true
},
"TagList": []
}

潜在影响: 安全控制的拆解、政策规避、合规性违规、操作中断,以及环境内潜在的数据泄露。

fms:BatchAssociateResource, fms:BatchDisassociateResource, fms:PutResourceSet, fms:DeleteResourceSet

拥有 fms:BatchAssociateResourcefms:BatchDisassociateResource 权限的攻击者将能够分别将资源关联或取消关联到防火墙管理器资源集。此外,fms:PutResourceSetfms:DeleteResourceSet 权限将允许攻击者创建、修改或删除这些资源集。

# Associate/Disassociate resources from a resource set
aws fms batch-associate-resource --resource-set-identifier <value> --items <value>
aws fms batch-disassociate-resource --resource-set-identifier <value> --items <value>

# Create, modify or delete a resource set
aws fms put-resource-set --resource-set <value> [--tag-list <value>]
aws fms delete-resource-set --identifier <value>

潜在影响: 向资源集添加不必要的项目将增加服务中的噪音水平,可能导致DoS。此外,资源集的变化可能导致资源中断、策略规避、合规性违规以及环境中安全控制的中断。

fms:PutAppsList, fms:DeleteAppsList

拥有**fms:PutAppsListfms:DeleteAppsList**权限的攻击者将能够创建、修改或删除AWS Firewall Manager中的应用程序列表。这可能是关键的,因为未经授权的应用程序可能被允许访问公众,或者对授权应用程序的访问可能被拒绝,从而导致DoS。

aws fms put-apps-list --apps-list <value> [--tag-list <value>]
aws fms delete-apps-list --list-id <value>

潜在影响: 这可能导致配置错误、策略规避、合规性违规以及环境中安全控制的中断。

fms:PutProtocolsList, fms:DeleteProtocolsList

拥有 fms:PutProtocolsListfms:DeleteProtocolsList 权限的攻击者将能够从 AWS Firewall Manager 创建、修改或删除协议列表。与应用程序列表类似,这可能是关键的,因为未经授权的协议可能被公众使用,或者授权协议的使用可能被拒绝,从而导致 DoS。

aws fms put-protocols-list --apps-list <value> [--tag-list <value>]
aws fms delete-protocols-list --list-id <value>

潜在影响: 这可能导致配置错误、策略规避、合规性违规以及环境中安全控制的中断。

fms:PutNotificationChannel, fms:DeleteNotificationChannel

拥有 fms:PutNotificationChannelfms:DeleteNotificationChannel 权限的攻击者将能够删除和指定 Firewall Manager 用于记录 SNS 日志的 IAM 角色和 Amazon Simple Notification Service (SNS) 主题。

要在控制台外使用 fms:PutNotificationChannel,您需要设置 SNS 主题的访问策略,允许指定的 SnsRoleName 发布 SNS 日志。如果提供的 SnsRoleName 是除 AWSServiceRoleForFMS 之外的角色,则需要配置信任关系,以允许 Firewall Manager 服务主体 fms.amazonaws.com 假设该角色。

有关配置 SNS 访问策略的信息:

aws fms put-notification-channel --sns-topic-arn <value> --sns-role-name <value>
aws fms delete-notification-channel

潜在影响: 这可能导致错过安全警报、延迟事件响应、潜在的数据泄露和环境内的操作中断。

fms:AssociateThirdPartyFirewall, fms:DisssociateThirdPartyFirewall

拥有 fms:AssociateThirdPartyFirewallfms:DisssociateThirdPartyFirewall 权限的攻击者将能够将第三方防火墙关联或解除关联,以便通过 AWS Firewall Manager 进行集中管理。

只有默认管理员可以创建和管理第三方防火墙。

aws fms associate-third-party-firewall --third-party-firewall [PALO_ALTO_NETWORKS_CLOUD_NGFW | FORTIGATE_CLOUD_NATIVE_FIREWALL]
aws fms disassociate-third-party-firewall --third-party-firewall [PALO_ALTO_NETWORKS_CLOUD_NGFW | FORTIGATE_CLOUD_NATIVE_FIREWALL]

潜在影响: 解除关联将导致政策规避、合规性违规以及环境内安全控制的中断。另一方面,关联将导致成本和预算分配的中断。

fms:TagResource, fms:UntagResource

攻击者将能够添加、修改或删除防火墙管理器资源的标签,从而干扰您组织基于标签的成本分配、资源跟踪和访问控制政策。

aws fms tag-resource --resource-arn <value> --tag-list <value>
aws fms untag-resource --resource-arn <value> --tag-keys <value>

潜在影响:成本分配、资源跟踪和基于标签的访问控制策略的中断。

参考文献

支持 HackTricks

Last updated