Firewall Management Service

2021/04/01 - Firewall Management Service - 6 updated api methods

Changes  Added Firewall Manager policy support for AWS Route 53 Resolver DNS Firewall.

GetComplianceDetail (updated) Link ¶
Changes (response)
{'PolicyComplianceDetail': {'Violators': {'ViolationReason': {'FMS_CREATED_SECURITY_GROUP_EDITED',
                                                              'RESOURCE_MISSING_DNS_FIREWALL'}}}}

Returns detailed compliance information about the specified member account. Details include resources that are in and out of compliance with the specified policy. Resources are considered noncompliant for AWS WAF and Shield Advanced policies if the specified policy has not been applied to them. Resources are considered noncompliant for security group policies if they are in scope of the policy, they violate one or more of the policy rules, and remediation is disabled or not possible. Resources are considered noncompliant for Network Firewall policies if a firewall is missing in the VPC, if the firewall endpoint isn't set up in an expected Availability Zone and subnet, if a subnet created by the Firewall Manager doesn't have the expected route table, and for modifications to a firewall policy that violate the Firewall Manager policy's rules.

See also: AWS API Documentation

Request Syntax

client.get_compliance_detail(
    PolicyId='string',
    MemberAccount='string'
)
type PolicyId:

string

param PolicyId:

[REQUIRED]

The ID of the policy that you want to get the details for. PolicyId is returned by PutPolicy and by ListPolicies.

type MemberAccount:

string

param MemberAccount:

[REQUIRED]

The AWS account that owns the resources that you want to get the details for.

rtype:

dict

returns:

Response Syntax

{
    'PolicyComplianceDetail': {
        'PolicyOwner': 'string',
        'PolicyId': 'string',
        'MemberAccount': 'string',
        'Violators': [
            {
                'ResourceId': 'string',
                'ViolationReason': 'WEB_ACL_MISSING_RULE_GROUP'|'RESOURCE_MISSING_WEB_ACL'|'RESOURCE_INCORRECT_WEB_ACL'|'RESOURCE_MISSING_SHIELD_PROTECTION'|'RESOURCE_MISSING_WEB_ACL_OR_SHIELD_PROTECTION'|'RESOURCE_MISSING_SECURITY_GROUP'|'RESOURCE_VIOLATES_AUDIT_SECURITY_GROUP'|'SECURITY_GROUP_UNUSED'|'SECURITY_GROUP_REDUNDANT'|'FMS_CREATED_SECURITY_GROUP_EDITED'|'MISSING_FIREWALL'|'MISSING_FIREWALL_SUBNET_IN_AZ'|'MISSING_EXPECTED_ROUTE_TABLE'|'NETWORK_FIREWALL_POLICY_MODIFIED'|'RESOURCE_MISSING_DNS_FIREWALL',
                'ResourceType': 'string'
            },
        ],
        'EvaluationLimitExceeded': True|False,
        'ExpiredAt': datetime(2015, 1, 1),
        'IssueInfoMap': {
            'string': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • PolicyComplianceDetail (dict) --

      Information about the resources and the policy that you specified in the GetComplianceDetail request.

      • PolicyOwner (string) --

        The AWS account that created the AWS Firewall Manager policy.

      • PolicyId (string) --

        The ID of the AWS Firewall Manager policy.

      • MemberAccount (string) --

        The AWS account ID.

      • Violators (list) --

        An array of resources that aren't protected by the AWS WAF or Shield Advanced policy or that aren't in compliance with the security group policy.

        • (dict) --

          Details of the resource that is not protected by the policy.

          • ResourceId (string) --

            The resource ID.

          • ViolationReason (string) --

            The reason that the resource is not protected by the policy.

          • ResourceType (string) --

            The resource type. This is in the format shown in the AWS Resource Types Reference. For example: AWS::ElasticLoadBalancingV2::LoadBalancer, AWS::CloudFront::Distribution, or AWS::NetworkFirewall::FirewallPolicy.

      • EvaluationLimitExceeded (boolean) --

        Indicates if over 100 resources are noncompliant with the AWS Firewall Manager policy.

      • ExpiredAt (datetime) --

        A timestamp that indicates when the returned information should be considered out of date.

      • IssueInfoMap (dict) --

        Details about problems with dependent services, such as AWS WAF or AWS Config, that are causing a resource to be noncompliant. The details include the name of the dependent service and the error message received that indicates the problem with the service.

        • (string) --

          • (string) --

GetPolicy (updated) Link ¶
Changes (response)
{'Policy': {'SecurityServicePolicyData': {'Type': {'DNS_FIREWALL'}}}}

Returns information about the specified AWS Firewall Manager policy.

See also: AWS API Documentation

Request Syntax

client.get_policy(
    PolicyId='string'
)
type PolicyId:

string

param PolicyId:

[REQUIRED]

The ID of the AWS Firewall Manager policy that you want the details for.

rtype:

dict

returns:

Response Syntax

{
    'Policy': {
        'PolicyId': 'string',
        'PolicyName': 'string',
        'PolicyUpdateToken': 'string',
        'SecurityServicePolicyData': {
            'Type': 'WAF'|'WAFV2'|'SHIELD_ADVANCED'|'SECURITY_GROUPS_COMMON'|'SECURITY_GROUPS_CONTENT_AUDIT'|'SECURITY_GROUPS_USAGE_AUDIT'|'NETWORK_FIREWALL'|'DNS_FIREWALL',
            'ManagedServiceData': 'string'
        },
        'ResourceType': 'string',
        'ResourceTypeList': [
            'string',
        ],
        'ResourceTags': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        'ExcludeResourceTags': True|False,
        'RemediationEnabled': True|False,
        'IncludeMap': {
            'string': [
                'string',
            ]
        },
        'ExcludeMap': {
            'string': [
                'string',
            ]
        }
    },
    'PolicyArn': 'string'
}

Response Structure

  • (dict) --

    • Policy (dict) --

      Information about the specified AWS Firewall Manager policy.

      • PolicyId (string) --

        The ID of the AWS Firewall Manager policy.

      • PolicyName (string) --

        The name of the AWS Firewall Manager policy.

      • PolicyUpdateToken (string) --

        A unique identifier for each update to the policy. When issuing a PutPolicy request, the PolicyUpdateToken in the request must match the PolicyUpdateToken of the current policy version. To get the PolicyUpdateToken of the current policy version, use a GetPolicy request.

      • SecurityServicePolicyData (dict) --

        Details about the security service that is being used to protect the resources.

        • Type (string) --

          The service that the policy is using to protect the resources. This specifies the type of policy that is created, either an AWS WAF policy, a Shield Advanced policy, or a security group policy. For security group policies, Firewall Manager supports one security group for each common policy and for each content audit policy. This is an adjustable limit that you can increase by contacting AWS Support.

        • ManagedServiceData (string) --

          Details about the service that are specific to the service type, in JSON format. For service type SHIELD_ADVANCED, this is an empty string.

          • Example: NETWORK_FIREWALL "{\"type\":\"NETWORK_FIREWALL\",\"networkFirewallStatelessRuleGroupReferences\":[{\"resourceARN\":\"arn:aws:network-firewall:us-west-1:1234567891011:stateless-rulegroup/rulegroup2\",\"priority\":10}],\"networkFirewallStatelessDefaultActions\":[\"aws:pass\",\"custom1\"],\"networkFirewallStatelessFragmentDefaultActions\":[\"custom2\",\"aws:pass\"],\"networkFirewallStatelessCustomActions\":[{\"actionName\":\"custom1\",\"actionDefinition\":{\"publishMetricAction\":{\"dimensions\":[{\"value\":\"dimension1\"}]}}},{\"actionName\":\"custom2\",\"actionDefinition\":{\"publishMetricAction\":{\"dimensions\":[{\"value\":\"dimension2\"}]}}}],\"networkFirewallStatefulRuleGroupReferences\":[{\"resourceARN\":\"arn:aws:network-firewall:us-west-1:1234567891011:stateful-rulegroup/rulegroup1\"}],\"networkFirewallOrchestrationConfig\":{\"singleFirewallEndpointPerVPC\":true,\"allowedIPV4CidrList\":[\"10.24.34.0/28\"]} }"

          • Example: WAFV2 "{\"type\":\"WAFV2\",\"preProcessRuleGroups\":[{\"ruleGroupArn\":null,\"overrideAction\":{\"type\":\"NONE\"},\"managedRuleGroupIdentifier\":{\"version\":null,\"vendorName\":\"AWS\",\"managedRuleGroupName\":\"AWSManagedRulesAmazonIpReputationList\"},\"ruleGroupType\":\"ManagedRuleGroup\",\"excludeRules\":[]}],\"postProcessRuleGroups\":[],\"defaultAction\":{\"type\":\"ALLOW\"},\"overrideCustomerWebACLAssociation\":false,\"loggingConfiguration\":{\"logDestinationConfigs\":[\"arn:aws:firehose:us-west-2:12345678912:deliverystream/aws-waf-logs-fms-admin-destination\"],\"redactedFields\":[{\"redactedFieldType\":\"SingleHeader\",\"redactedFieldValue\":\"Cookies\"},{\"redactedFieldType\":\"Method\"}]}}" In the loggingConfiguration, you can specify one logDestinationConfigs, you can optionally provide up to 20 redactedFields, and the RedactedFieldType must be one of URI, QUERY_STRING, HEADER, or METHOD.

          • Example: WAF Classic "{\"type\": \"WAF\", \"ruleGroups\": [{\"id\":\"12345678-1bcd-9012-efga-0987654321ab\", \"overrideAction\" : {\"type\": \"COUNT\"}}], \"defaultAction\": {\"type\": \"BLOCK\"}}"

          • Example: SECURITY_GROUPS_COMMON "{\"type\":\"SECURITY_GROUPS_COMMON\",\"revertManualSecurityGroupChanges\":false,\"exclusiveResourceSecurityGroupManagement\":false, \"applyToAllEC2InstanceENIs\":false,\"securityGroups\":[{\"id\":\" sg-000e55995d61a06bd\"}]}"

          • Example: SECURITY_GROUPS_CONTENT_AUDIT "{\"type\":\"SECURITY_GROUPS_CONTENT_AUDIT\",\"securityGroups\":[{\"id\":\"sg-000e55995d61a06bd\"}],\"securityGroupAction\":{\"type\":\"ALLOW\"}}" The security group action for content audit can be ALLOW or DENY. For ALLOW, all in-scope security group rules must be within the allowed range of the policy's security group rules. For DENY, all in-scope security group rules must not contain a value or a range that matches a rule value or range in the policy security group.

          • Example: SECURITY_GROUPS_USAGE_AUDIT "{\"type\":\"SECURITY_GROUPS_USAGE_AUDIT\",\"deleteUnusedSecurityGroups\":true,\"coalesceRedundantSecurityGroups\":true}"

      • ResourceType (string) --

        The type of resource protected by or in scope of the policy. This is in the format shown in the AWS Resource Types Reference. For AWS WAF and Shield Advanced, examples include AWS::ElasticLoadBalancingV2::LoadBalancer and AWS::CloudFront::Distribution. For a security group common policy, valid values are AWS::EC2::NetworkInterface and AWS::EC2::Instance. For a security group content audit policy, valid values are AWS::EC2::SecurityGroup, AWS::EC2::NetworkInterface, and AWS::EC2::Instance. For a security group usage audit policy, the value is AWS::EC2::SecurityGroup. For an AWS Network Firewall policy, the value is AWS::EC2::VPC.

      • ResourceTypeList (list) --

        An array of ResourceType.

        • (string) --

      • ResourceTags (list) --

        An array of ResourceTag objects.

        • (dict) --

          The resource tags that AWS Firewall Manager uses to determine if a particular resource should be included or excluded from the AWS Firewall Manager policy. Tags enable you to categorize your AWS resources in different ways, for example, by purpose, owner, or environment. Each tag consists of a key and an optional value. Firewall Manager combines the tags with "AND" so that, if you add more than one tag to a policy scope, a resource must have all the specified tags to be included or excluded. For more information, see Working with Tag Editor.

          • Key (string) --

            The resource tag key.

          • Value (string) --

            The resource tag value.

      • ExcludeResourceTags (boolean) --

        If set to True, resources with the tags that are specified in the ResourceTag array are not in scope of the policy. If set to False, and the ResourceTag array is not null, only resources with the specified tags are in scope of the policy.

      • RemediationEnabled (boolean) --

        Indicates if the policy should be automatically applied to new resources.

      • IncludeMap (dict) --

        Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to include in the policy. Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its child OUs, including any child OUs and accounts that are added at a later time.

        You can specify inclusions or exclusions, but not both. If you specify an IncludeMap, AWS Firewall Manager applies the policy to all accounts specified by the IncludeMap, and does not evaluate any ExcludeMap specifications. If you do not specify an IncludeMap, then Firewall Manager applies the policy to all accounts except for those specified by the ExcludeMap.

        You can specify account IDs, OUs, or a combination:

        • Specify account IDs by setting the key to ACCOUNT. For example, the following is a valid map: {“ACCOUNT” : [“accountID1”, “accountID2”]}.

        • Specify OUs by setting the key to ORG_UNIT. For example, the following is a valid map: {“ORG_UNIT” : [“ouid111”, “ouid112”]}.

        • Specify accounts and OUs together in a single map, separated with a comma. For example, the following is a valid map: {“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}.

        • (string) --

          • (list) --

            • (string) --

      • ExcludeMap (dict) --

        Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to exclude from the policy. Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its child OUs, including any child OUs and accounts that are added at a later time.

        You can specify inclusions or exclusions, but not both. If you specify an IncludeMap, AWS Firewall Manager applies the policy to all accounts specified by the IncludeMap, and does not evaluate any ExcludeMap specifications. If you do not specify an IncludeMap, then Firewall Manager applies the policy to all accounts except for those specified by the ExcludeMap.

        You can specify account IDs, OUs, or a combination:

        • Specify account IDs by setting the key to ACCOUNT. For example, the following is a valid map: {“ACCOUNT” : [“accountID1”, “accountID2”]}.

        • Specify OUs by setting the key to ORG_UNIT. For example, the following is a valid map: {“ORG_UNIT” : [“ouid111”, “ouid112”]}.

        • Specify accounts and OUs together in a single map, separated with a comma. For example, the following is a valid map: {“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}.

        • (string) --

          • (list) --

            • (string) --

    • PolicyArn (string) --

      The Amazon Resource Name (ARN) of the specified policy.

GetProtectionStatus (updated) Link ¶
Changes (response)
{'ServiceType': {'DNS_FIREWALL'}}

If you created a Shield Advanced policy, returns policy-level attack summary information in the event of a potential DDoS attack. Other policy types are currently unsupported.

See also: AWS API Documentation

Request Syntax

client.get_protection_status(
    PolicyId='string',
    MemberAccountId='string',
    StartTime=datetime(2015, 1, 1),
    EndTime=datetime(2015, 1, 1),
    NextToken='string',
    MaxResults=123
)
type PolicyId:

string

param PolicyId:

[REQUIRED]

The ID of the policy for which you want to get the attack information.

type MemberAccountId:

string

param MemberAccountId:

The AWS account that is in scope of the policy that you want to get the details for.

type StartTime:

datetime

param StartTime:

The start of the time period to query for the attacks. This is a timestamp type. The request syntax listing indicates a number type because the default used by AWS Firewall Manager is Unix time in seconds. However, any valid timestamp format is allowed.

type EndTime:

datetime

param EndTime:

The end of the time period to query for the attacks. This is a timestamp type. The request syntax listing indicates a number type because the default used by AWS Firewall Manager is Unix time in seconds. However, any valid timestamp format is allowed.

type NextToken:

string

param NextToken:

If you specify a value for MaxResults and you have more objects than the number that you specify for MaxResults, AWS Firewall Manager returns a NextToken value in the response, which you can use to retrieve another group of objects. For the second and subsequent GetProtectionStatus requests, specify the value of NextToken from the previous response to get information about another batch of objects.

type MaxResults:

integer

param MaxResults:

Specifies the number of objects that you want AWS Firewall Manager to return for this request. If you have more objects than the number that you specify for MaxResults, the response includes a NextToken value that you can use to get another batch of objects.

rtype:

dict

returns:

Response Syntax

{
    'AdminAccountId': 'string',
    'ServiceType': 'WAF'|'WAFV2'|'SHIELD_ADVANCED'|'SECURITY_GROUPS_COMMON'|'SECURITY_GROUPS_CONTENT_AUDIT'|'SECURITY_GROUPS_USAGE_AUDIT'|'NETWORK_FIREWALL'|'DNS_FIREWALL',
    'Data': 'string',
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • AdminAccountId (string) --

      The ID of the AWS Firewall administrator account for this policy.

    • ServiceType (string) --

      The service type that is protected by the policy. Currently, this is always SHIELD_ADVANCED.

    • Data (string) --

      Details about the attack, including the following:

      • Attack type

      • Account ID

      • ARN of the resource attacked

      • Start time of the attack

      • End time of the attack (ongoing attacks will not have an end time)

      The details are in JSON format.

    • NextToken (string) --

      If you have more objects than the number that you specified for MaxResults in the request, the response includes a NextToken value. To list more objects, submit another GetProtectionStatus request, and specify the NextToken value from the response in the NextToken value in the next request.

      AWS SDKs provide auto-pagination that identify NextToken in a response and make subsequent request calls automatically on your behalf. However, this feature is not supported by GetProtectionStatus. You must submit subsequent requests with NextToken using your own processes.

GetViolationDetails (updated) Link ¶
Changes (response)
{'ViolationDetail': {'ResourceViolations': {'DnsDuplicateRuleGroupViolation': {'ViolationTarget': 'string',
                                                                               'ViolationTargetDescription': 'string'},
                                            'DnsRuleGroupLimitExceededViolation': {'NumberOfRuleGroupsAlreadyAssociated': 'integer',
                                                                                   'ViolationTarget': 'string',
                                                                                   'ViolationTargetDescription': 'string'},
                                            'DnsRuleGroupPriorityConflictViolation': {'ConflictingPolicyId': 'string',
                                                                                      'ConflictingPriority': 'integer',
                                                                                      'UnavailablePriorities': ['integer'],
                                                                                      'ViolationTarget': 'string',
                                                                                      'ViolationTargetDescription': 'string'}}}}

Retrieves violations for a resource based on the specified AWS Firewall Manager policy and AWS account.

See also: AWS API Documentation

Request Syntax

client.get_violation_details(
    PolicyId='string',
    MemberAccount='string',
    ResourceId='string',
    ResourceType='string'
)
type PolicyId:

string

param PolicyId:

[REQUIRED]

The ID of the AWS Firewall Manager policy that you want the details for. This currently only supports security group content audit policies.

type MemberAccount:

string

param MemberAccount:

[REQUIRED]

The AWS account ID that you want the details for.

type ResourceId:

string

param ResourceId:

[REQUIRED]

The ID of the resource that has violations.

type ResourceType:

string

param ResourceType:

[REQUIRED]

The resource type. This is in the format shown in the AWS Resource Types Reference. Supported resource types are: AWS::EC2::Instance, AWS::EC2::NetworkInterface, AWS::EC2::SecurityGroup, AWS::NetworkFirewall::FirewallPolicy, and AWS::EC2::Subnet.

rtype:

dict

returns:

Response Syntax

{
    'ViolationDetail': {
        'PolicyId': 'string',
        'MemberAccount': 'string',
        'ResourceId': 'string',
        'ResourceType': 'string',
        'ResourceViolations': [
            {
                'AwsVPCSecurityGroupViolation': {
                    'ViolationTarget': 'string',
                    'ViolationTargetDescription': 'string',
                    'PartialMatches': [
                        {
                            'Reference': 'string',
                            'TargetViolationReasons': [
                                'string',
                            ]
                        },
                    ],
                    'PossibleSecurityGroupRemediationActions': [
                        {
                            'RemediationActionType': 'REMOVE'|'MODIFY',
                            'Description': 'string',
                            'RemediationResult': {
                                'IPV4Range': 'string',
                                'IPV6Range': 'string',
                                'PrefixListId': 'string',
                                'Protocol': 'string',
                                'FromPort': 123,
                                'ToPort': 123
                            },
                            'IsDefaultAction': True|False
                        },
                    ]
                },
                'AwsEc2NetworkInterfaceViolation': {
                    'ViolationTarget': 'string',
                    'ViolatingSecurityGroups': [
                        'string',
                    ]
                },
                'AwsEc2InstanceViolation': {
                    'ViolationTarget': 'string',
                    'AwsEc2NetworkInterfaceViolations': [
                        {
                            'ViolationTarget': 'string',
                            'ViolatingSecurityGroups': [
                                'string',
                            ]
                        },
                    ]
                },
                'NetworkFirewallMissingFirewallViolation': {
                    'ViolationTarget': 'string',
                    'VPC': 'string',
                    'AvailabilityZone': 'string',
                    'TargetViolationReason': 'string'
                },
                'NetworkFirewallMissingSubnetViolation': {
                    'ViolationTarget': 'string',
                    'VPC': 'string',
                    'AvailabilityZone': 'string',
                    'TargetViolationReason': 'string'
                },
                'NetworkFirewallMissingExpectedRTViolation': {
                    'ViolationTarget': 'string',
                    'VPC': 'string',
                    'AvailabilityZone': 'string',
                    'CurrentRouteTable': 'string',
                    'ExpectedRouteTable': 'string'
                },
                'NetworkFirewallPolicyModifiedViolation': {
                    'ViolationTarget': 'string',
                    'CurrentPolicyDescription': {
                        'StatelessRuleGroups': [
                            {
                                'RuleGroupName': 'string',
                                'ResourceId': 'string',
                                'Priority': 123
                            },
                        ],
                        'StatelessDefaultActions': [
                            'string',
                        ],
                        'StatelessFragmentDefaultActions': [
                            'string',
                        ],
                        'StatelessCustomActions': [
                            'string',
                        ],
                        'StatefulRuleGroups': [
                            {
                                'RuleGroupName': 'string',
                                'ResourceId': 'string'
                            },
                        ]
                    },
                    'ExpectedPolicyDescription': {
                        'StatelessRuleGroups': [
                            {
                                'RuleGroupName': 'string',
                                'ResourceId': 'string',
                                'Priority': 123
                            },
                        ],
                        'StatelessDefaultActions': [
                            'string',
                        ],
                        'StatelessFragmentDefaultActions': [
                            'string',
                        ],
                        'StatelessCustomActions': [
                            'string',
                        ],
                        'StatefulRuleGroups': [
                            {
                                'RuleGroupName': 'string',
                                'ResourceId': 'string'
                            },
                        ]
                    }
                },
                'DnsRuleGroupPriorityConflictViolation': {
                    'ViolationTarget': 'string',
                    'ViolationTargetDescription': 'string',
                    'ConflictingPriority': 123,
                    'ConflictingPolicyId': 'string',
                    'UnavailablePriorities': [
                        123,
                    ]
                },
                'DnsDuplicateRuleGroupViolation': {
                    'ViolationTarget': 'string',
                    'ViolationTargetDescription': 'string'
                },
                'DnsRuleGroupLimitExceededViolation': {
                    'ViolationTarget': 'string',
                    'ViolationTargetDescription': 'string',
                    'NumberOfRuleGroupsAlreadyAssociated': 123
                }
            },
        ],
        'ResourceTags': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        'ResourceDescription': 'string'
    }
}

Response Structure

  • (dict) --

    • ViolationDetail (dict) --

      Violation detail for a resource.

      • PolicyId (string) --

        The ID of the AWS Firewall Manager policy that the violation details were requested for.

      • MemberAccount (string) --

        The AWS account that the violation details were requested for.

      • ResourceId (string) --

        The resource ID that the violation details were requested for.

      • ResourceType (string) --

        The resource type that the violation details were requested for.

      • ResourceViolations (list) --

        List of violations for the requested resource.

        • (dict) --

          Violation detail based on resource type.

          • AwsVPCSecurityGroupViolation (dict) --

            Violation details for security groups.

            • ViolationTarget (string) --

              The security group rule that is being evaluated.

            • ViolationTargetDescription (string) --

              A description of the security group that violates the policy.

            • PartialMatches (list) --

              List of rules specified in the security group of the AWS Firewall Manager policy that partially match the ViolationTarget rule.

              • (dict) --

                The reference rule that partially matches the ViolationTarget rule and violation reason.

                • Reference (string) --

                  The reference rule from the master security group of the AWS Firewall Manager policy.

                • TargetViolationReasons (list) --

                  The violation reason.

                  • (string) --

            • PossibleSecurityGroupRemediationActions (list) --

              Remediation options for the rule specified in the ViolationTarget.

              • (dict) --

                Remediation option for the rule specified in the ViolationTarget.

                • RemediationActionType (string) --

                  The remediation action that will be performed.

                • Description (string) --

                  Brief description of the action that will be performed.

                • RemediationResult (dict) --

                  The final state of the rule specified in the ViolationTarget after it is remediated.

                  • IPV4Range (string) --

                    The IPv4 ranges for the security group rule.

                  • IPV6Range (string) --

                    The IPv6 ranges for the security group rule.

                  • PrefixListId (string) --

                    The ID of the prefix list for the security group rule.

                  • Protocol (string) --

                    The IP protocol name ( tcp, udp, icmp, icmpv6) or number.

                  • FromPort (integer) --

                    The start of the port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number. A value of -1 indicates all ICMP/ICMPv6 types.

                  • ToPort (integer) --

                    The end of the port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. A value of -1 indicates all ICMP/ICMPv6 codes.

                • IsDefaultAction (boolean) --

                  Indicates if the current action is the default action.

          • AwsEc2NetworkInterfaceViolation (dict) --

            Violation details for network interface.

            • ViolationTarget (string) --

              The resource ID of the network interface.

            • ViolatingSecurityGroups (list) --

              List of security groups that violate the rules specified in the master security group of the AWS Firewall Manager policy.

              • (string) --

          • AwsEc2InstanceViolation (dict) --

            Violation details for an EC2 instance.

            • ViolationTarget (string) --

              The resource ID of the EC2 instance.

            • AwsEc2NetworkInterfaceViolations (list) --

              Violations for network interfaces associated with the EC2 instance.

              • (dict) --

                Violations for network interfaces associated with an EC2 instance.

                • ViolationTarget (string) --

                  The resource ID of the network interface.

                • ViolatingSecurityGroups (list) --

                  List of security groups that violate the rules specified in the master security group of the AWS Firewall Manager policy.

                  • (string) --

          • NetworkFirewallMissingFirewallViolation (dict) --

            Violation detail for an Network Firewall policy that indicates that a subnet has no Firewall Manager managed firewall in its VPC.

            • ViolationTarget (string) --

              The ID of the AWS Network Firewall or VPC resource that's in violation.

            • VPC (string) --

              The resource ID of the VPC associated with a violating subnet.

            • AvailabilityZone (string) --

              The Availability Zone of a violating subnet.

            • TargetViolationReason (string) --

              The reason the resource has this violation, if one is available.

          • NetworkFirewallMissingSubnetViolation (dict) --

            Violation detail for an Network Firewall policy that indicates that an Availability Zone is missing the expected Firewall Manager managed subnet.

            • ViolationTarget (string) --

              The ID of the AWS Network Firewall or VPC resource that's in violation.

            • VPC (string) --

              The resource ID of the VPC associated with a violating subnet.

            • AvailabilityZone (string) --

              The Availability Zone of a violating subnet.

            • TargetViolationReason (string) --

              The reason the resource has this violation, if one is available.

          • NetworkFirewallMissingExpectedRTViolation (dict) --

            Violation detail for an Network Firewall policy that indicates that a subnet is not associated with the expected Firewall Manager managed route table.

            • ViolationTarget (string) --

              The ID of the AWS Network Firewall or VPC resource that's in violation.

            • VPC (string) --

              The resource ID of the VPC associated with a violating subnet.

            • AvailabilityZone (string) --

              The Availability Zone of a violating subnet.

            • CurrentRouteTable (string) --

              The resource ID of the current route table that's associated with the subnet, if one is available.

            • ExpectedRouteTable (string) --

              The resource ID of the route table that should be associated with the subnet.

          • NetworkFirewallPolicyModifiedViolation (dict) --

            Violation detail for an Network Firewall policy that indicates that a firewall policy in an individual account has been modified in a way that makes it noncompliant. For example, the individual account owner might have deleted a rule group, changed the priority of a stateless rule group, or changed a policy default action.

            • ViolationTarget (string) --

              The ID of the AWS Network Firewall or VPC resource that's in violation.

            • CurrentPolicyDescription (dict) --

              The policy that's currently in use in the individual account.

              • StatelessRuleGroups (list) --

                The stateless rule groups that are used in the Network Firewall firewall policy.

                • (dict) --

                  AWS Network Firewall stateless rule group, used in a NetworkFirewallPolicyDescription.

                  • RuleGroupName (string) --

                    The name of the rule group.

                  • ResourceId (string) --

                    The resource ID of the rule group.

                  • Priority (integer) --

                    The priority of the rule group. AWS Network Firewall evaluates the stateless rule groups in a firewall policy starting from the lowest priority setting.

              • StatelessDefaultActions (list) --

                The actions to take on packets that don't match any of the stateless rule groups.

                • (string) --

              • StatelessFragmentDefaultActions (list) --

                The actions to take on packet fragments that don't match any of the stateless rule groups.

                • (string) --

              • StatelessCustomActions (list) --

                Names of custom actions that are available for use in the stateless default actions settings.

                • (string) --

              • StatefulRuleGroups (list) --

                The stateful rule groups that are used in the Network Firewall firewall policy.

                • (dict) --

                  AWS Network Firewall stateful rule group, used in a NetworkFirewallPolicyDescription.

                  • RuleGroupName (string) --

                    The name of the rule group.

                  • ResourceId (string) --

                    The resource ID of the rule group.

            • ExpectedPolicyDescription (dict) --

              The policy that should be in use in the individual account in order to be compliant.

              • StatelessRuleGroups (list) --

                The stateless rule groups that are used in the Network Firewall firewall policy.

                • (dict) --

                  AWS Network Firewall stateless rule group, used in a NetworkFirewallPolicyDescription.

                  • RuleGroupName (string) --

                    The name of the rule group.

                  • ResourceId (string) --

                    The resource ID of the rule group.

                  • Priority (integer) --

                    The priority of the rule group. AWS Network Firewall evaluates the stateless rule groups in a firewall policy starting from the lowest priority setting.

              • StatelessDefaultActions (list) --

                The actions to take on packets that don't match any of the stateless rule groups.

                • (string) --

              • StatelessFragmentDefaultActions (list) --

                The actions to take on packet fragments that don't match any of the stateless rule groups.

                • (string) --

              • StatelessCustomActions (list) --

                Names of custom actions that are available for use in the stateless default actions settings.

                • (string) --

              • StatefulRuleGroups (list) --

                The stateful rule groups that are used in the Network Firewall firewall policy.

                • (dict) --

                  AWS Network Firewall stateful rule group, used in a NetworkFirewallPolicyDescription.

                  • RuleGroupName (string) --

                    The name of the rule group.

                  • ResourceId (string) --

                    The resource ID of the rule group.

          • DnsRuleGroupPriorityConflictViolation (dict) --

            Violation detail for a DNS Firewall policy that indicates that a rule group that Firewall Manager tried to associate with a VPC has the same priority as a rule group that's already associated.

            • ViolationTarget (string) --

              The ID of the VPC.

            • ViolationTargetDescription (string) --

              A description of the violation that specifies the VPC and the rule group that's already associated with it.

            • ConflictingPriority (integer) --

              The priority setting of the two conflicting rule groups.

            • ConflictingPolicyId (string) --

              The ID of the Firewall Manager DNS Firewall policy that was already applied to the VPC. This policy contains the rule group that's already associated with the VPC.

            • UnavailablePriorities (list) --

              The priorities of rule groups that are already associated with the VPC. To retry your operation, choose priority settings that aren't in this list for the rule groups in your new DNS Firewall policy.

              • (integer) --

          • DnsDuplicateRuleGroupViolation (dict) --

            Violation detail for a DNS Firewall policy that indicates that a rule group that Firewall Manager tried to associate with a VPC is already associated with the VPC and can't be associated again.

            • ViolationTarget (string) --

              The ID of the VPC.

            • ViolationTargetDescription (string) --

              A description of the violation that specifies the rule group and VPC.

          • DnsRuleGroupLimitExceededViolation (dict) --

            Violation details for a DNS Firewall policy that indicates that the VPC reached the limit for associated DNS Firewall rule groups. Firewall Manager tried to associate another rule group with the VPC and failed.

            • ViolationTarget (string) --

              The ID of the VPC.

            • ViolationTargetDescription (string) --

              A description of the violation that specifies the rule group and VPC.

            • NumberOfRuleGroupsAlreadyAssociated (integer) --

              The number of rule groups currently associated with the VPC.

      • ResourceTags (list) --

        The ResourceTag objects associated with the resource.

        • (dict) --

          A collection of key:value pairs associated with an AWS resource. The key:value pair can be anything you define. Typically, the tag key represents a category (such as "environment") and the tag value represents a specific value within that category (such as "test," "development," or "production"). You can add up to 50 tags to each AWS resource.

          • Key (string) --

            Part of the key:value pair that defines a tag. You can use a tag key to describe a category of information, such as "customer." Tag keys are case-sensitive.

          • Value (string) --

            Part of the key:value pair that defines a tag. You can use a tag value to describe a specific value within a category, such as "companyA" or "companyB." Tag values are case-sensitive.

      • ResourceDescription (string) --

        Brief description for the requested resource.

ListPolicies (updated) Link ¶
Changes (response)
{'PolicyList': {'SecurityServiceType': {'DNS_FIREWALL'}}}

Returns an array of PolicySummary objects.

See also: AWS API Documentation

Request Syntax

client.list_policies(
    NextToken='string',
    MaxResults=123
)
type NextToken:

string

param NextToken:

If you specify a value for MaxResults and you have more PolicySummary objects than the number that you specify for MaxResults, AWS Firewall Manager returns a NextToken value in the response that allows you to list another group of PolicySummary objects. For the second and subsequent ListPolicies requests, specify the value of NextToken from the previous response to get information about another batch of PolicySummary objects.

type MaxResults:

integer

param MaxResults:

Specifies the number of PolicySummary objects that you want AWS Firewall Manager to return for this request. If you have more PolicySummary objects than the number that you specify for MaxResults, the response includes a NextToken value that you can use to get another batch of PolicySummary objects.

rtype:

dict

returns:

Response Syntax

{
    'PolicyList': [
        {
            'PolicyArn': 'string',
            'PolicyId': 'string',
            'PolicyName': 'string',
            'ResourceType': 'string',
            'SecurityServiceType': 'WAF'|'WAFV2'|'SHIELD_ADVANCED'|'SECURITY_GROUPS_COMMON'|'SECURITY_GROUPS_CONTENT_AUDIT'|'SECURITY_GROUPS_USAGE_AUDIT'|'NETWORK_FIREWALL'|'DNS_FIREWALL',
            'RemediationEnabled': True|False
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • PolicyList (list) --

      An array of PolicySummary objects.

      • (dict) --

        Details of the AWS Firewall Manager policy.

        • PolicyArn (string) --

          The Amazon Resource Name (ARN) of the specified policy.

        • PolicyId (string) --

          The ID of the specified policy.

        • PolicyName (string) --

          The name of the specified policy.

        • ResourceType (string) --

          The type of resource protected by or in scope of the policy. This is in the format shown in the AWS Resource Types Reference. For AWS WAF and Shield Advanced, examples include AWS::ElasticLoadBalancingV2::LoadBalancer and AWS::CloudFront::Distribution. For a security group common policy, valid values are AWS::EC2::NetworkInterface and AWS::EC2::Instance. For a security group content audit policy, valid values are AWS::EC2::SecurityGroup, AWS::EC2::NetworkInterface, and AWS::EC2::Instance. For a security group usage audit policy, the value is AWS::EC2::SecurityGroup. For an AWS Network Firewall policy, the value is AWS::EC2::VPC.

        • SecurityServiceType (string) --

          The service that the policy is using to protect the resources. This specifies the type of policy that is created, either an AWS WAF policy, a Shield Advanced policy, or a security group policy.

        • RemediationEnabled (boolean) --

          Indicates if the policy should be automatically applied to new resources.

    • NextToken (string) --

      If you have more PolicySummary objects than the number that you specified for MaxResults in the request, the response includes a NextToken value. To list more PolicySummary objects, submit another ListPolicies request, and specify the NextToken value from the response in the NextToken value in the next request.

PutPolicy (updated) Link ¶
Changes (both)
{'Policy': {'SecurityServicePolicyData': {'Type': {'DNS_FIREWALL'}}}}

Creates an AWS Firewall Manager policy.

Firewall Manager provides the following types of policies:

  • An AWS WAF policy (type WAFV2), which defines rule groups to run first in the corresponding AWS WAF web ACL and rule groups to run last in the web ACL.

  • An AWS WAF Classic policy (type WAF), which defines a rule group.

  • A Shield Advanced policy, which applies Shield Advanced protection to specified accounts and resources.

  • A security group policy, which manages VPC security groups across your AWS organization.

  • An AWS Network Firewall policy, which provides firewall rules to filter network traffic in specified Amazon VPCs.

Each policy is specific to one of the types. If you want to enforce more than one policy type across accounts, create multiple policies. You can create multiple policies for each type.

You must be subscribed to Shield Advanced to create a Shield Advanced policy. For more information about subscribing to Shield Advanced, see CreateSubscription.

See also: AWS API Documentation

Request Syntax

client.put_policy(
    Policy={
        'PolicyId': 'string',
        'PolicyName': 'string',
        'PolicyUpdateToken': 'string',
        'SecurityServicePolicyData': {
            'Type': 'WAF'|'WAFV2'|'SHIELD_ADVANCED'|'SECURITY_GROUPS_COMMON'|'SECURITY_GROUPS_CONTENT_AUDIT'|'SECURITY_GROUPS_USAGE_AUDIT'|'NETWORK_FIREWALL'|'DNS_FIREWALL',
            'ManagedServiceData': 'string'
        },
        'ResourceType': 'string',
        'ResourceTypeList': [
            'string',
        ],
        'ResourceTags': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        'ExcludeResourceTags': True|False,
        'RemediationEnabled': True|False,
        'IncludeMap': {
            'string': [
                'string',
            ]
        },
        'ExcludeMap': {
            'string': [
                'string',
            ]
        }
    },
    TagList=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type Policy:

dict

param Policy:

[REQUIRED]

The details of the AWS Firewall Manager policy to be created.

  • PolicyId (string) --

    The ID of the AWS Firewall Manager policy.

  • PolicyName (string) -- [REQUIRED]

    The name of the AWS Firewall Manager policy.

  • PolicyUpdateToken (string) --

    A unique identifier for each update to the policy. When issuing a PutPolicy request, the PolicyUpdateToken in the request must match the PolicyUpdateToken of the current policy version. To get the PolicyUpdateToken of the current policy version, use a GetPolicy request.

  • SecurityServicePolicyData (dict) -- [REQUIRED]

    Details about the security service that is being used to protect the resources.

    • Type (string) -- [REQUIRED]

      The service that the policy is using to protect the resources. This specifies the type of policy that is created, either an AWS WAF policy, a Shield Advanced policy, or a security group policy. For security group policies, Firewall Manager supports one security group for each common policy and for each content audit policy. This is an adjustable limit that you can increase by contacting AWS Support.

    • ManagedServiceData (string) --

      Details about the service that are specific to the service type, in JSON format. For service type SHIELD_ADVANCED, this is an empty string.

      • Example: NETWORK_FIREWALL "{\"type\":\"NETWORK_FIREWALL\",\"networkFirewallStatelessRuleGroupReferences\":[{\"resourceARN\":\"arn:aws:network-firewall:us-west-1:1234567891011:stateless-rulegroup/rulegroup2\",\"priority\":10}],\"networkFirewallStatelessDefaultActions\":[\"aws:pass\",\"custom1\"],\"networkFirewallStatelessFragmentDefaultActions\":[\"custom2\",\"aws:pass\"],\"networkFirewallStatelessCustomActions\":[{\"actionName\":\"custom1\",\"actionDefinition\":{\"publishMetricAction\":{\"dimensions\":[{\"value\":\"dimension1\"}]}}},{\"actionName\":\"custom2\",\"actionDefinition\":{\"publishMetricAction\":{\"dimensions\":[{\"value\":\"dimension2\"}]}}}],\"networkFirewallStatefulRuleGroupReferences\":[{\"resourceARN\":\"arn:aws:network-firewall:us-west-1:1234567891011:stateful-rulegroup/rulegroup1\"}],\"networkFirewallOrchestrationConfig\":{\"singleFirewallEndpointPerVPC\":true,\"allowedIPV4CidrList\":[\"10.24.34.0/28\"]} }"

      • Example: WAFV2 "{\"type\":\"WAFV2\",\"preProcessRuleGroups\":[{\"ruleGroupArn\":null,\"overrideAction\":{\"type\":\"NONE\"},\"managedRuleGroupIdentifier\":{\"version\":null,\"vendorName\":\"AWS\",\"managedRuleGroupName\":\"AWSManagedRulesAmazonIpReputationList\"},\"ruleGroupType\":\"ManagedRuleGroup\",\"excludeRules\":[]}],\"postProcessRuleGroups\":[],\"defaultAction\":{\"type\":\"ALLOW\"},\"overrideCustomerWebACLAssociation\":false,\"loggingConfiguration\":{\"logDestinationConfigs\":[\"arn:aws:firehose:us-west-2:12345678912:deliverystream/aws-waf-logs-fms-admin-destination\"],\"redactedFields\":[{\"redactedFieldType\":\"SingleHeader\",\"redactedFieldValue\":\"Cookies\"},{\"redactedFieldType\":\"Method\"}]}}" In the loggingConfiguration, you can specify one logDestinationConfigs, you can optionally provide up to 20 redactedFields, and the RedactedFieldType must be one of URI, QUERY_STRING, HEADER, or METHOD.

      • Example: WAF Classic "{\"type\": \"WAF\", \"ruleGroups\": [{\"id\":\"12345678-1bcd-9012-efga-0987654321ab\", \"overrideAction\" : {\"type\": \"COUNT\"}}], \"defaultAction\": {\"type\": \"BLOCK\"}}"

      • Example: SECURITY_GROUPS_COMMON "{\"type\":\"SECURITY_GROUPS_COMMON\",\"revertManualSecurityGroupChanges\":false,\"exclusiveResourceSecurityGroupManagement\":false, \"applyToAllEC2InstanceENIs\":false,\"securityGroups\":[{\"id\":\" sg-000e55995d61a06bd\"}]}"

      • Example: SECURITY_GROUPS_CONTENT_AUDIT "{\"type\":\"SECURITY_GROUPS_CONTENT_AUDIT\",\"securityGroups\":[{\"id\":\"sg-000e55995d61a06bd\"}],\"securityGroupAction\":{\"type\":\"ALLOW\"}}" The security group action for content audit can be ALLOW or DENY. For ALLOW, all in-scope security group rules must be within the allowed range of the policy's security group rules. For DENY, all in-scope security group rules must not contain a value or a range that matches a rule value or range in the policy security group.

      • Example: SECURITY_GROUPS_USAGE_AUDIT "{\"type\":\"SECURITY_GROUPS_USAGE_AUDIT\",\"deleteUnusedSecurityGroups\":true,\"coalesceRedundantSecurityGroups\":true}"

  • ResourceType (string) -- [REQUIRED]

    The type of resource protected by or in scope of the policy. This is in the format shown in the AWS Resource Types Reference. For AWS WAF and Shield Advanced, examples include AWS::ElasticLoadBalancingV2::LoadBalancer and AWS::CloudFront::Distribution. For a security group common policy, valid values are AWS::EC2::NetworkInterface and AWS::EC2::Instance. For a security group content audit policy, valid values are AWS::EC2::SecurityGroup, AWS::EC2::NetworkInterface, and AWS::EC2::Instance. For a security group usage audit policy, the value is AWS::EC2::SecurityGroup. For an AWS Network Firewall policy, the value is AWS::EC2::VPC.

  • ResourceTypeList (list) --

    An array of ResourceType.

    • (string) --

  • ResourceTags (list) --

    An array of ResourceTag objects.

    • (dict) --

      The resource tags that AWS Firewall Manager uses to determine if a particular resource should be included or excluded from the AWS Firewall Manager policy. Tags enable you to categorize your AWS resources in different ways, for example, by purpose, owner, or environment. Each tag consists of a key and an optional value. Firewall Manager combines the tags with "AND" so that, if you add more than one tag to a policy scope, a resource must have all the specified tags to be included or excluded. For more information, see Working with Tag Editor.

      • Key (string) -- [REQUIRED]

        The resource tag key.

      • Value (string) --

        The resource tag value.

  • ExcludeResourceTags (boolean) -- [REQUIRED]

    If set to True, resources with the tags that are specified in the ResourceTag array are not in scope of the policy. If set to False, and the ResourceTag array is not null, only resources with the specified tags are in scope of the policy.

  • RemediationEnabled (boolean) -- [REQUIRED]

    Indicates if the policy should be automatically applied to new resources.

  • IncludeMap (dict) --

    Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to include in the policy. Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its child OUs, including any child OUs and accounts that are added at a later time.

    You can specify inclusions or exclusions, but not both. If you specify an IncludeMap, AWS Firewall Manager applies the policy to all accounts specified by the IncludeMap, and does not evaluate any ExcludeMap specifications. If you do not specify an IncludeMap, then Firewall Manager applies the policy to all accounts except for those specified by the ExcludeMap.

    You can specify account IDs, OUs, or a combination:

    • Specify account IDs by setting the key to ACCOUNT. For example, the following is a valid map: {“ACCOUNT” : [“accountID1”, “accountID2”]}.

    • Specify OUs by setting the key to ORG_UNIT. For example, the following is a valid map: {“ORG_UNIT” : [“ouid111”, “ouid112”]}.

    • Specify accounts and OUs together in a single map, separated with a comma. For example, the following is a valid map: {“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}.

    • (string) --

      • (list) --

        • (string) --

  • ExcludeMap (dict) --

    Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to exclude from the policy. Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its child OUs, including any child OUs and accounts that are added at a later time.

    You can specify inclusions or exclusions, but not both. If you specify an IncludeMap, AWS Firewall Manager applies the policy to all accounts specified by the IncludeMap, and does not evaluate any ExcludeMap specifications. If you do not specify an IncludeMap, then Firewall Manager applies the policy to all accounts except for those specified by the ExcludeMap.

    You can specify account IDs, OUs, or a combination:

    • Specify account IDs by setting the key to ACCOUNT. For example, the following is a valid map: {“ACCOUNT” : [“accountID1”, “accountID2”]}.

    • Specify OUs by setting the key to ORG_UNIT. For example, the following is a valid map: {“ORG_UNIT” : [“ouid111”, “ouid112”]}.

    • Specify accounts and OUs together in a single map, separated with a comma. For example, the following is a valid map: {“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}.

    • (string) --

      • (list) --

        • (string) --

type TagList:

list

param TagList:

The tags to add to the AWS resource.

  • (dict) --

    A collection of key:value pairs associated with an AWS resource. The key:value pair can be anything you define. Typically, the tag key represents a category (such as "environment") and the tag value represents a specific value within that category (such as "test," "development," or "production"). You can add up to 50 tags to each AWS resource.

    • Key (string) -- [REQUIRED]

      Part of the key:value pair that defines a tag. You can use a tag key to describe a category of information, such as "customer." Tag keys are case-sensitive.

    • Value (string) -- [REQUIRED]

      Part of the key:value pair that defines a tag. You can use a tag value to describe a specific value within a category, such as "companyA" or "companyB." Tag values are case-sensitive.

rtype:

dict

returns:

Response Syntax

{
    'Policy': {
        'PolicyId': 'string',
        'PolicyName': 'string',
        'PolicyUpdateToken': 'string',
        'SecurityServicePolicyData': {
            'Type': 'WAF'|'WAFV2'|'SHIELD_ADVANCED'|'SECURITY_GROUPS_COMMON'|'SECURITY_GROUPS_CONTENT_AUDIT'|'SECURITY_GROUPS_USAGE_AUDIT'|'NETWORK_FIREWALL'|'DNS_FIREWALL',
            'ManagedServiceData': 'string'
        },
        'ResourceType': 'string',
        'ResourceTypeList': [
            'string',
        ],
        'ResourceTags': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        'ExcludeResourceTags': True|False,
        'RemediationEnabled': True|False,
        'IncludeMap': {
            'string': [
                'string',
            ]
        },
        'ExcludeMap': {
            'string': [
                'string',
            ]
        }
    },
    'PolicyArn': 'string'
}

Response Structure

  • (dict) --

    • Policy (dict) --

      The details of the AWS Firewall Manager policy.

      • PolicyId (string) --

        The ID of the AWS Firewall Manager policy.

      • PolicyName (string) --

        The name of the AWS Firewall Manager policy.

      • PolicyUpdateToken (string) --

        A unique identifier for each update to the policy. When issuing a PutPolicy request, the PolicyUpdateToken in the request must match the PolicyUpdateToken of the current policy version. To get the PolicyUpdateToken of the current policy version, use a GetPolicy request.

      • SecurityServicePolicyData (dict) --

        Details about the security service that is being used to protect the resources.

        • Type (string) --

          The service that the policy is using to protect the resources. This specifies the type of policy that is created, either an AWS WAF policy, a Shield Advanced policy, or a security group policy. For security group policies, Firewall Manager supports one security group for each common policy and for each content audit policy. This is an adjustable limit that you can increase by contacting AWS Support.

        • ManagedServiceData (string) --

          Details about the service that are specific to the service type, in JSON format. For service type SHIELD_ADVANCED, this is an empty string.

          • Example: NETWORK_FIREWALL "{\"type\":\"NETWORK_FIREWALL\",\"networkFirewallStatelessRuleGroupReferences\":[{\"resourceARN\":\"arn:aws:network-firewall:us-west-1:1234567891011:stateless-rulegroup/rulegroup2\",\"priority\":10}],\"networkFirewallStatelessDefaultActions\":[\"aws:pass\",\"custom1\"],\"networkFirewallStatelessFragmentDefaultActions\":[\"custom2\",\"aws:pass\"],\"networkFirewallStatelessCustomActions\":[{\"actionName\":\"custom1\",\"actionDefinition\":{\"publishMetricAction\":{\"dimensions\":[{\"value\":\"dimension1\"}]}}},{\"actionName\":\"custom2\",\"actionDefinition\":{\"publishMetricAction\":{\"dimensions\":[{\"value\":\"dimension2\"}]}}}],\"networkFirewallStatefulRuleGroupReferences\":[{\"resourceARN\":\"arn:aws:network-firewall:us-west-1:1234567891011:stateful-rulegroup/rulegroup1\"}],\"networkFirewallOrchestrationConfig\":{\"singleFirewallEndpointPerVPC\":true,\"allowedIPV4CidrList\":[\"10.24.34.0/28\"]} }"

          • Example: WAFV2 "{\"type\":\"WAFV2\",\"preProcessRuleGroups\":[{\"ruleGroupArn\":null,\"overrideAction\":{\"type\":\"NONE\"},\"managedRuleGroupIdentifier\":{\"version\":null,\"vendorName\":\"AWS\",\"managedRuleGroupName\":\"AWSManagedRulesAmazonIpReputationList\"},\"ruleGroupType\":\"ManagedRuleGroup\",\"excludeRules\":[]}],\"postProcessRuleGroups\":[],\"defaultAction\":{\"type\":\"ALLOW\"},\"overrideCustomerWebACLAssociation\":false,\"loggingConfiguration\":{\"logDestinationConfigs\":[\"arn:aws:firehose:us-west-2:12345678912:deliverystream/aws-waf-logs-fms-admin-destination\"],\"redactedFields\":[{\"redactedFieldType\":\"SingleHeader\",\"redactedFieldValue\":\"Cookies\"},{\"redactedFieldType\":\"Method\"}]}}" In the loggingConfiguration, you can specify one logDestinationConfigs, you can optionally provide up to 20 redactedFields, and the RedactedFieldType must be one of URI, QUERY_STRING, HEADER, or METHOD.

          • Example: WAF Classic "{\"type\": \"WAF\", \"ruleGroups\": [{\"id\":\"12345678-1bcd-9012-efga-0987654321ab\", \"overrideAction\" : {\"type\": \"COUNT\"}}], \"defaultAction\": {\"type\": \"BLOCK\"}}"

          • Example: SECURITY_GROUPS_COMMON "{\"type\":\"SECURITY_GROUPS_COMMON\",\"revertManualSecurityGroupChanges\":false,\"exclusiveResourceSecurityGroupManagement\":false, \"applyToAllEC2InstanceENIs\":false,\"securityGroups\":[{\"id\":\" sg-000e55995d61a06bd\"}]}"

          • Example: SECURITY_GROUPS_CONTENT_AUDIT "{\"type\":\"SECURITY_GROUPS_CONTENT_AUDIT\",\"securityGroups\":[{\"id\":\"sg-000e55995d61a06bd\"}],\"securityGroupAction\":{\"type\":\"ALLOW\"}}" The security group action for content audit can be ALLOW or DENY. For ALLOW, all in-scope security group rules must be within the allowed range of the policy's security group rules. For DENY, all in-scope security group rules must not contain a value or a range that matches a rule value or range in the policy security group.

          • Example: SECURITY_GROUPS_USAGE_AUDIT "{\"type\":\"SECURITY_GROUPS_USAGE_AUDIT\",\"deleteUnusedSecurityGroups\":true,\"coalesceRedundantSecurityGroups\":true}"

      • ResourceType (string) --

        The type of resource protected by or in scope of the policy. This is in the format shown in the AWS Resource Types Reference. For AWS WAF and Shield Advanced, examples include AWS::ElasticLoadBalancingV2::LoadBalancer and AWS::CloudFront::Distribution. For a security group common policy, valid values are AWS::EC2::NetworkInterface and AWS::EC2::Instance. For a security group content audit policy, valid values are AWS::EC2::SecurityGroup, AWS::EC2::NetworkInterface, and AWS::EC2::Instance. For a security group usage audit policy, the value is AWS::EC2::SecurityGroup. For an AWS Network Firewall policy, the value is AWS::EC2::VPC.

      • ResourceTypeList (list) --

        An array of ResourceType.

        • (string) --

      • ResourceTags (list) --

        An array of ResourceTag objects.

        • (dict) --

          The resource tags that AWS Firewall Manager uses to determine if a particular resource should be included or excluded from the AWS Firewall Manager policy. Tags enable you to categorize your AWS resources in different ways, for example, by purpose, owner, or environment. Each tag consists of a key and an optional value. Firewall Manager combines the tags with "AND" so that, if you add more than one tag to a policy scope, a resource must have all the specified tags to be included or excluded. For more information, see Working with Tag Editor.

          • Key (string) --

            The resource tag key.

          • Value (string) --

            The resource tag value.

      • ExcludeResourceTags (boolean) --

        If set to True, resources with the tags that are specified in the ResourceTag array are not in scope of the policy. If set to False, and the ResourceTag array is not null, only resources with the specified tags are in scope of the policy.

      • RemediationEnabled (boolean) --

        Indicates if the policy should be automatically applied to new resources.

      • IncludeMap (dict) --

        Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to include in the policy. Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its child OUs, including any child OUs and accounts that are added at a later time.

        You can specify inclusions or exclusions, but not both. If you specify an IncludeMap, AWS Firewall Manager applies the policy to all accounts specified by the IncludeMap, and does not evaluate any ExcludeMap specifications. If you do not specify an IncludeMap, then Firewall Manager applies the policy to all accounts except for those specified by the ExcludeMap.

        You can specify account IDs, OUs, or a combination:

        • Specify account IDs by setting the key to ACCOUNT. For example, the following is a valid map: {“ACCOUNT” : [“accountID1”, “accountID2”]}.

        • Specify OUs by setting the key to ORG_UNIT. For example, the following is a valid map: {“ORG_UNIT” : [“ouid111”, “ouid112”]}.

        • Specify accounts and OUs together in a single map, separated with a comma. For example, the following is a valid map: {“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}.

        • (string) --

          • (list) --

            • (string) --

      • ExcludeMap (dict) --

        Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to exclude from the policy. Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its child OUs, including any child OUs and accounts that are added at a later time.

        You can specify inclusions or exclusions, but not both. If you specify an IncludeMap, AWS Firewall Manager applies the policy to all accounts specified by the IncludeMap, and does not evaluate any ExcludeMap specifications. If you do not specify an IncludeMap, then Firewall Manager applies the policy to all accounts except for those specified by the ExcludeMap.

        You can specify account IDs, OUs, or a combination:

        • Specify account IDs by setting the key to ACCOUNT. For example, the following is a valid map: {“ACCOUNT” : [“accountID1”, “accountID2”]}.

        • Specify OUs by setting the key to ORG_UNIT. For example, the following is a valid map: {“ORG_UNIT” : [“ouid111”, “ouid112”]}.

        • Specify accounts and OUs together in a single map, separated with a comma. For example, the following is a valid map: {“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}.

        • (string) --

          • (list) --

            • (string) --

    • PolicyArn (string) --

      The Amazon Resource Name (ARN) of the policy.