Firewall Management Service

2020/01/08 - Firewall Management Service - 3 new 1 updated api methods

Changes  AWS Firewall Manager now supports tagging, and tag-based access control, of policies.

TagResource (new) Link ¶

Adds one or more tags to an AWS resource.

See also: AWS API Documentation

Request Syntax

client.tag_resource(
    ResourceArn='string',
    TagList=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type ResourceArn

string

param ResourceArn

[REQUIRED]

The Amazon Resource Name (ARN) of the resource. The Firewall Manager policy is the only AWS resource that supports tagging, so this ARN is a policy ARN.

type TagList

list

param TagList

[REQUIRED]

The tags to add to 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) -- [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

{}

Response Structure

  • (dict) --

ListTagsForResource (new) Link ¶

Retrieves the list of tags for the specified AWS resource.

See also: AWS API Documentation

Request Syntax

client.list_tags_for_resource(
    ResourceArn='string'
)
type ResourceArn

string

param ResourceArn

[REQUIRED]

The Amazon Resource Name (ARN) of the resource to return tags for. The Firewall Manager policy is the only AWS resource that supports tagging, so this ARN is a policy ARN..

rtype

dict

returns

Response Syntax

{
    'TagList': [
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • TagList (list) --

      The tags 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.

UntagResource (new) Link ¶

Removes one or more tags from an AWS resource.

See also: AWS API Documentation

Request Syntax

client.untag_resource(
    ResourceArn='string',
    TagKeys=[
        'string',
    ]
)
type ResourceArn

string

param ResourceArn

[REQUIRED]

The Amazon Resource Name (ARN) of the resource. The Firewall Manager policy is the only AWS resource that supports tagging, so this ARN is a policy ARN.

type TagKeys

list

param TagKeys

[REQUIRED]

The keys of the tags to remove from the resource.

  • (string) --

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

PutPolicy (updated) Link ¶
Changes (request)
{'TagList': [{'Key': 'string', 'Value': 'string'}]}

Creates an AWS Firewall Manager policy.

Firewall Manager provides the following types of policies:

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

  • An AWS WAF policy, which contains a rule group and defines which resources are to be protected by that rule group

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

Each policy is specific to one of the three types. If you want to enforce more than one policy type across accounts, you can 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'|'SHIELD_ADVANCED'|'SECURITY_GROUPS_COMMON'|'SECURITY_GROUPS_CONTENT_AUDIT'|'SECURITY_GROUPS_USAGE_AUDIT',
            '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 friendly 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: WAF ManagedServiceData": "{\"type\": \"WAF\", \"ruleGroups\": [{\"id\": \"12345678-1bcd-9012-efga-0987654321ab\", \"overrideAction\" : {\"type\": \"COUNT\"}}], \"defaultAction\": {\"type\": \"BLOCK\"}}

      • Example: SECURITY_GROUPS_COMMON "SecurityServicePolicyData":{"Type":"SECURITY_GROUPS_COMMON","ManagedServiceData":"{\"type\":\"SECURITY_GROUPS_COMMON\",\"revertManualSecurityGroupChanges\":false,\"exclusiveResourceSecurityGroupManagement\":false,\"securityGroups\":[{\"id\":\" sg-000e55995d61a06bd\"}]}"},"RemediationEnabled":false,"ResourceType":"AWS::EC2::NetworkInterface"}

      • Example: SECURITY_GROUPS_CONTENT_AUDIT "SecurityServicePolicyData":{"Type":"SECURITY_GROUPS_CONTENT_AUDIT","ManagedServiceData":"{\"type\":\"SECURITY_GROUPS_CONTENT_AUDIT\",\"securityGroups\":[{\"id\":\" sg-000e55995d61a06bd \"}],\"securityGroupAction\":{\"type\":\"ALLOW\"}}"},"RemediationEnabled":false,"ResourceType":"AWS::EC2::NetworkInterface"} 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 "SecurityServicePolicyData":{"Type":"SECURITY_GROUPS_USAGE_AUDIT","ManagedServiceData":"{\"type\":\"SECURITY_GROUPS_USAGE_AUDIT\",\"deleteUnusedSecurityGroups\":true,\"coalesceRedundantSecurityGroups\":true}"},"RemediationEnabled":false,"Resou rceType":"AWS::EC2::SecurityGroup"}

  • 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 .

  • 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 to include in the policy. If IncludeMap is null, all accounts in the organization in AWS Organizations are included in the policy. If IncludeMap is not null, only values listed in IncludeMap are included in the policy.

    The key to the map is ACCOUNT . For example, a valid IncludeMap would be {“ACCOUNT” : [“accountID1”, “accountID2”]} .

    • (string) --

      • (list) --

        • (string) --

  • ExcludeMap (dict) --

    Specifies the AWS account IDs to exclude from the policy. The IncludeMap values are evaluated first, with all the appropriate account IDs added to the policy. Then the accounts listed in ExcludeMap are removed, resulting in the final list of accounts to add to the policy.

    The key to the map is ACCOUNT . For example, a valid ExcludeMap would be {“ACCOUNT” : [“accountID1”, “accountID2”]} .

    • (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'|'SHIELD_ADVANCED'|'SECURITY_GROUPS_COMMON'|'SECURITY_GROUPS_CONTENT_AUDIT'|'SECURITY_GROUPS_USAGE_AUDIT',
            '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 that was created.

      • PolicyId (string) --

        The ID of the AWS Firewall Manager policy.

      • PolicyName (string) --

        The friendly 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: WAF ManagedServiceData": "{\"type\": \"WAF\", \"ruleGroups\": [{\"id\": \"12345678-1bcd-9012-efga-0987654321ab\", \"overrideAction\" : {\"type\": \"COUNT\"}}], \"defaultAction\": {\"type\": \"BLOCK\"}}

          • Example: SECURITY_GROUPS_COMMON "SecurityServicePolicyData":{"Type":"SECURITY_GROUPS_COMMON","ManagedServiceData":"{\"type\":\"SECURITY_GROUPS_COMMON\",\"revertManualSecurityGroupChanges\":false,\"exclusiveResourceSecurityGroupManagement\":false,\"securityGroups\":[{\"id\":\" sg-000e55995d61a06bd\"}]}"},"RemediationEnabled":false,"ResourceType":"AWS::EC2::NetworkInterface"}

          • Example: SECURITY_GROUPS_CONTENT_AUDIT "SecurityServicePolicyData":{"Type":"SECURITY_GROUPS_CONTENT_AUDIT","ManagedServiceData":"{\"type\":\"SECURITY_GROUPS_CONTENT_AUDIT\",\"securityGroups\":[{\"id\":\" sg-000e55995d61a06bd \"}],\"securityGroupAction\":{\"type\":\"ALLOW\"}}"},"RemediationEnabled":false,"ResourceType":"AWS::EC2::NetworkInterface"} 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 "SecurityServicePolicyData":{"Type":"SECURITY_GROUPS_USAGE_AUDIT","ManagedServiceData":"{\"type\":\"SECURITY_GROUPS_USAGE_AUDIT\",\"deleteUnusedSecurityGroups\":true,\"coalesceRedundantSecurityGroups\":true}"},"RemediationEnabled":false,"Resou rceType":"AWS::EC2::SecurityGroup"}

      • 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 .

      • 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 to include in the policy. If IncludeMap is null, all accounts in the organization in AWS Organizations are included in the policy. If IncludeMap is not null, only values listed in IncludeMap are included in the policy.

        The key to the map is ACCOUNT . For example, a valid IncludeMap would be {“ACCOUNT” : [“accountID1”, “accountID2”]} .

        • (string) --

          • (list) --

            • (string) --

      • ExcludeMap (dict) --

        Specifies the AWS account IDs to exclude from the policy. The IncludeMap values are evaluated first, with all the appropriate account IDs added to the policy. Then the accounts listed in ExcludeMap are removed, resulting in the final list of accounts to add to the policy.

        The key to the map is ACCOUNT . For example, a valid ExcludeMap would be {“ACCOUNT” : [“accountID1”, “accountID2”]} .

        • (string) --

          • (list) --

            • (string) --

    • PolicyArn (string) --

      The Amazon Resource Name (ARN) of the policy that was created.