AWS - Firewall Manager Enum

Support HackTricks

Firewall Manager

AWS Firewall ManagerAWS WAF, AWS Shield Advanced, Amazon VPC 보안 그룹 및 네트워크 액세스 제어 목록(ACL), AWS Network Firewall, AWS Route 53 Resolver DNS Firewall 및 타사 방화벽의 관리 및 유지 관리를 간소화합니다. 이를 통해 방화벽 규칙, Shield Advanced 보호, VPC 보안 그룹 및 네트워크 방화벽 설정을 한 번만 구성하면 서비스가 이 규칙과 보호를 자동으로 계정 및 리소스 전체에 적용합니다. 새로 추가된 리소스도 포함됩니다.

이 서비스는 공통 태그를 공유하는 리소스나 모든 CloudFront 배포와 같은 특정 리소스를 그룹화하고 보호할 수 있는 기능을 제공합니다. Firewall Manager의 중요한 이점은 새로 추가된 리소스에 자동으로 보호를 확장할 수 있다는 점입니다.

규칙 그룹(WAF 규칙 모음)은 AWS Firewall Manager 정책에 통합될 수 있으며, 이는 CloudFront 배포 또는 애플리케이션 로드 밸런서와 같은 특정 AWS 리소스에 연결됩니다.

AWS Firewall Manager는 보안 그룹 정책의 구성 및 관리를 단순화하기 위해 관리되는 애플리케이션 및 프로토콜 목록을 제공합니다. 이러한 목록을 통해 정책에 의해 허용되거나 거부되는 프로토콜 및 애플리케이션을 정의할 수 있습니다. 관리되는 목록에는 두 가지 유형이 있습니다:

  • Firewall Manager 관리 목록: 이 목록에는 FMS-Default-Public-Access-Apps-Allowed, FMS-Default-Protocols-AllowedFMS-Default-Protocols-Allowed가 포함됩니다. 이 목록은 Firewall Manager에 의해 관리되며 일반 대중에게 허용되거나 거부되어야 하는 일반적으로 사용되는 애플리케이션 및 프로토콜을 포함합니다. 이를 편집하거나 삭제할 수는 없지만 버전을 선택할 수 있습니다.

  • 사용자 정의 관리 목록: 이 목록은 사용자가 직접 관리합니다. 조직의 요구에 맞게 사용자 정의 애플리케이션 및 프로토콜 목록을 만들 수 있습니다. Firewall Manager 관리 목록과 달리 이러한 목록에는 버전이 없지만 사용자 정의 목록을 완전히 제어할 수 있어 필요에 따라 생성, 편집 및 삭제할 수 있습니다.

Firewall Manager 정책은 규칙 그룹에 대해 "차단" 또는 "카운트" 작업만 허용하며 "허용" 옵션은 없습니다.

Prerequisites

Firewall Manager를 구성하여 조직의 리소스를 효과적으로 보호하기 전에 다음 전제 조건 단계를 완료해야 합니다. 이러한 단계는 Firewall Manager가 보안 정책을 시행하고 AWS 환경 전반에서 규정을 준수할 수 있도록 하는 기본 설정을 제공합니다:

  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를 사용하려는 경우 해당 리전에서 기능을 활성화하기 위한 필요한 단계를 수행해야 합니다. 이를 통해 조직이 운영하는 모든 리전에서 일관된 보안 시행이 보장됩니다.

자세한 내용은 Getting started with AWS Firewall Manager AWS WAF policies를 참조하십시오.

Types of protection policies

AWS Firewall Manager는 조직 인프라의 다양한 측면에 대한 보안 제어를 시행하기 위해 여러 유형의 정책을 관리합니다:

  1. AWS WAF Policy: 이 정책 유형은 AWS WAF 및 AWS WAF Classic을 지원합니다. 정책에 의해 보호되는 리소스를 정의할 수 있습니다. AWS WAF 정책의 경우 웹 ACL에서 먼저 실행할 규칙 그룹 세트와 마지막으로 실행할 규칙 그룹 세트를 지정할 수 있습니다. 또한 계정 소유자는 이러한 세트 사이에 실행할 규칙 및 규칙 그룹을 추가할 수 있습니다.

  2. Shield Advanced Policy: 이 정책은 지정된 리소스 유형에 대해 조직 전체에 Shield Advanced 보호를 적용합니다. DDoS 공격 및 기타 위협으로부터 보호하는 데 도움이 됩니다.

  3. Amazon VPC Security Group Policy: 이 정책을 통해 조직 전체에서 사용되는 보안 그룹을 관리하고 AWS 환경 전반에 걸쳐 네트워크 액세스를 제어하기 위한 기본 규칙 세트를 시행할 수 있습니다.

  4. Amazon VPC Network Access Control List (ACL) Policy: 이 정책 유형은 조직에서 사용되는 네트워크 ACL을 제어할 수 있으며, AWS 환경 전반에 걸쳐 기본 네트워크 ACL 세트를 시행할 수 있습니다.

  5. Network Firewall Policy: 이 정책은 조직의 VPC에 AWS Network Firewall 보호를 적용하여 사전 정의된 규칙에 따라 트래픽을 필터링하여 네트워크 보안을 강화합니다.

  6. Amazon Route 53 Resolver DNS Firewall Policy: 이 정책은 조직의 VPC에 DNS Firewall 보호를 적용하여 악성 도메인 해상도 시도를 차단하고 DNS 트래픽에 대한 보안 정책을 시행하는 데 도움이 됩니다.

  7. Third-Party Firewall Policy: 이 정책 유형은 AWS Marketplace 콘솔을 통해 구독할 수 있는 타사 방화벽의 보호를 적용합니다. 이를 통해 신뢰할 수 있는 공급업체의 추가 보안 조치를 AWS 환경에 통합할 수 있습니다.

  8. Palo Alto Networks Cloud NGFW Policy: 이 정책은 조직의 VPC에 Palo Alto Networks Cloud Next Generation Firewall (NGFW) 보호 및 규칙 스택을 적용하여 고급 위협 방지 및 애플리케이션 수준의 보안 제어를 제공합니다.

  9. Fortigate Cloud Native Firewall (CNF) as a Service Policy: 이 정책은 Fortigate Cloud Native Firewall (CNF) as a Service 보호를 적용하여 클라우드 인프라에 맞춘 업계 최고의 위협 방지, 웹 애플리케이션 방화벽 (WAF) 및 API 보호를 제공합니다.

Administrator accounts

AWS Firewall Manager는 관리 범위와 두 가지 유형의 관리자 계정을 통해 조직 내 방화벽 리소스를 관리하는 유연성을 제공합니다.

관리 범위는 Firewall Manager 관리자가 관리할 수 있는 리소스를 정의합니다. AWS Organizations 관리 계정이 조직을 Firewall Manager에 온보딩한 후에는 다른 관리 범위를 가진 추가 관리자를 생성할 수 있습니다. 이러한 범위에는 다음이 포함될 수 있습니다:

  • 관리자가 정책을 적용할 수 있는 계정 또는 조직 단위(OU).

  • 관리자가 작업을 수행할 수 있는 리전.

  • 관리자가 관리할 수 있는 Firewall Manager 정책 유형.

관리 범위는 전체 또는 제한일 수 있습니다. 전체 범위는 관리자에게 모든 지정된 리소스 유형, 리전 및 정책 유형에 대한 액세스를 부여합니다. 반면, 제한된 범위는 리소스, 리전 또는 정책 유형의 하위 집합에만 관리 권한을 제공합니다. 관리자가 역할을 효과적으로 수행하는 데 필요한 권한만 부여하는 것이 좋습니다. 이러한 관리 범위 조건의 조합을 관리자에게 적용하여 최소 권한 원칙을 준수할 수 있습니다.

각각 특정 역할과 책임을 수행하는 두 가지 유형의 관리자 계정이 있습니다:

  • 기본 관리자:

  • 기본 관리자 계정은 Firewall Manager에 온보딩하는 동안 AWS Organizations 조직의 관리 계정에 의해 생성됩니다.

  • 이 계정은 타사 방화벽을 관리할 수 있으며 전체 관리 범위를 가집니다.

  • 조직 전체에 보안 정책을 구성하고 시행하는 주요 관리자 계정 역할을 합니다.

  • 기본 관리자는 모든 리소스 유형 및 관리 기능에 대한 전체 액세스 권한을 가지지만, 조직 내에서 여러 관리자를 사용하는 경우 다른 관리자와 동일한 동등한 수준에서 작동합니다.

  • Firewall Manager 관리자:

  • 이러한 관리자는 AWS Organizations 관리 계정에 의해 지정된 범위 내에서 리소스를 관리할 수 있습니다.

  • Firewall Manager 관리자는 조직 내 특정 역할을 수행하기 위해 생성되며, 책임을 위임하면서도 보안 및 규정 준수 표준을 유지할 수 있습니다.

  • 생성 시 Firewall Manager는 계정이 이미 위임된 관리자인지 확인하기 위해 AWS Organizations에 확인합니다. 그렇지 않은 경우, Firewall Manager는 계정을 Firewall Manager의 위임된 관리자로 지정하기 위해 Organizations를 호출합니다.

이러한 관리자 계정을 관리하려면 Firewall Manager 내에서 생성하고 조직의 보안 요구 사항 및 최소 권한 원칙에 따라 관리 범위를 정의해야 합니다. 적절한 관리 역할을 할당함으로써 조직은 민감한 리소스에 대한 액세스를 세밀하게 제어하면서 효과적인 보안 관리를 보장할 수 있습니다.

조직 내에서 하나의 계정만이 Firewall Manager 기본 관리자 역할을 할 수 있다는 점을 강조하는 것이 중요하며, 이는 "선입선출" 원칙을 따릅니다. 새로운 기본 관리자를 지정하려면 일련의 단계를 따라야 합니다:

  • 먼저, 각 Firewall 관리자 계정은 자신의 계정을 해지해야 합니다.

  • 그런 다음, 기존 기본 관리자는 자신의 계정을 해지하여 조직을 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>

Post Exploitation / Bypass Detection

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

fms:AssociateAdminAccount 권한을 가진 공격자는 Firewall Manager 기본 관리자 계정을 설정할 수 있습니다. fms:PutAdminAccount 권한을 가진 공격자는 Firewall Manager 관리자 계정을 생성하거나 업데이트할 수 있으며, fms:DisassociateAdminAccount 권한을 가진 잠재적 공격자는 현재 Firewall Manager 관리자 계정 연관을 제거할 수 있습니다.

  • Firewall Manager 기본 관리자 계정의 연관 해제는 선입후출 정책을 따릅니다. 모든 Firewall Manager 관리자는 기본 관리자 계정이 연관을 해제하기 전에 연관을 해제해야 합니다.

  • PutAdminAccount를 통해 Firewall Manager 관리자를 생성하려면 계정이 AssociateAdminAccount를 사용하여 이전에 Firewall Manager에 온보딩된 조직에 속해야 합니다.

  • Firewall Manager 관리자 계정의 생성은 조직의 관리 계정에 의해서만 수행될 수 있습니다.

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:PutPolicy, fms: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": []
}

Potential Impact: 보안 통제 해체, 정책 회피, 규정 위반, 운영 중단, 환경 내 잠재적 데이터 유출.

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

fms:BatchAssociateResourcefms:BatchDisassociateResource 권한을 가진 공격자는 각각 Firewall Manager 리소스 세트에서 리소스를 연결하거나 연결 해제할 수 있습니다. 또한, fms:PutResourceSetfms:DeleteResourceSet 권한을 통해 공격자는 AWS Firewall Manager에서 이러한 리소스 세트를 생성, 수정 또는 삭제할 수 있습니다.

# 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>

Potential Impact: 리소스 세트에 불필요한 항목을 추가하면 서비스의 소음 수준이 증가하여 잠재적으로 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**을 사용하려면 지정된 SnsRoleName이 SNS 로그를 게시할 수 있도록 SNS 주제의 액세스 정책을 설정해야 합니다. 제공된 SnsRoleName이 **AWSServiceRoleForFMS**가 아닌 다른 역할인 경우, Firewall Manager 서비스 주체 fms.amazonaws.com이 이 역할을 맡을 수 있도록 신뢰 관계가 구성되어야 합니다.

SNS 액세스 정책 구성에 대한 정보는 다음을 참조하십시오:

https://github.com/HackTricks-wiki/hacktricks-cloud/blob/kr/pentesting-cloud/aws-security/aws-services/aws-services/aws-sns-enum.md
aws fms put-notification-channel --sns-topic-arn <value> --sns-role-name <value>
aws fms delete-notification-channel

잠재적 영향: 이는 보안 경고 누락, 사건 대응 지연, 잠재적 데이터 유출 및 환경 내 운영 중단을 초래할 수 있습니다.

fms:AssociateThirdPartyFirewall, fms:DisssociateThirdPartyFirewall

fms:AssociateThirdPartyFirewall, fms: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

공격자는 Firewall Manager 리소스에서 태그를 추가, 수정 또는 제거하여 조직의 비용 할당, 리소스 추적 및 태그 기반 접근 제어 정책을 방해할 수 있습니다.

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

Potential Impact: 비용 할당, 리소스 추적 및 태그 기반 액세스 제어 정책의 중단.

References

HackTricks 지원

Last updated