@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:39.383Z") @Stability(value=Stable) public class CfnPolicy extends CfnResource implements IInspectable
An AWS Firewall Manager policy.
Firewall Manager provides the following types of policies:
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.
These policies require some setup to use. For more information, see the sections on prerequisites and getting started under AWS Firewall Manager .
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.fms.*;
CfnPolicy cfnPolicy = CfnPolicy.Builder.create(this, "MyCfnPolicy")
.excludeResourceTags(false)
.policyName("policyName")
.remediationEnabled(false)
.resourceType("resourceType")
.securityServicePolicyData(SecurityServicePolicyDataProperty.builder()
.type("type")
// the properties below are optional
.managedServiceData("managedServiceData")
.policyOption(PolicyOptionProperty.builder()
.networkFirewallPolicy(NetworkFirewallPolicyProperty.builder()
.firewallDeploymentModel("firewallDeploymentModel")
.build())
.thirdPartyFirewallPolicy(ThirdPartyFirewallPolicyProperty.builder()
.firewallDeploymentModel("firewallDeploymentModel")
.build())
.build())
.build())
// the properties below are optional
.deleteAllPolicyResources(false)
.excludeMap(Map.of(
"account", List.of("account"),
"orgunit", List.of("orgunit")))
.includeMap(Map.of(
"account", List.of("account"),
"orgunit", List.of("orgunit")))
.resourcesCleanUp(false)
.resourceTags(List.of(ResourceTagProperty.builder()
.key("key")
// the properties below are optional
.value("value")
.build()))
.resourceTypeList(List.of("resourceTypeList"))
.tags(List.of(PolicyTagProperty.builder()
.key("key")
.value("value")
.build()))
.build();
| Modifier and Type | Class and Description |
|---|---|
static class |
CfnPolicy.Builder
A fluent builder for
CfnPolicy. |
static interface |
CfnPolicy.IEMapProperty
Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to include in or exclude from the policy.
|
static interface |
CfnPolicy.NetworkFirewallPolicyProperty
Example:
|
static interface |
CfnPolicy.PolicyOptionProperty
Example:
|
static interface |
CfnPolicy.PolicyTagProperty
A collection of key:value pairs associated with an AWS resource.
|
static interface |
CfnPolicy.ResourceTagProperty
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.
|
static interface |
CfnPolicy.SecurityServicePolicyDataProperty
Example:
|
static interface |
CfnPolicy.ThirdPartyFirewallPolicyProperty
Example:
|
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnPolicy(software.constructs.Construct scope,
String id,
CfnPolicyProps props)
Create a new `AWS::FMS::Policy`.
|
protected |
CfnPolicy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnPolicy(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAttrArn()
The Amazon Resource Name (ARN) of the policy.
|
String |
getAttrId()
The ID of the policy.
|
protected Map<String,Object> |
getCfnProperties() |
Object |
getDeleteAllPolicyResources()
Used when deleting a policy.
|
Object |
getExcludeMap()
Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to exclude from the policy.
|
Object |
getExcludeResourceTags()
Used only when tags are specified in the `ResourceTags` property.
|
Object |
getIncludeMap()
Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to include in the policy.
|
String |
getPolicyName()
The name of the AWS Firewall Manager policy.
|
Object |
getRemediationEnabled()
Indicates if the policy should be automatically applied to new resources.
|
Object |
getResourcesCleanUp()
Indicates whether AWS Firewall Manager should automatically remove protections from resources that leave the policy scope and clean up resources that Firewall Manager is managing for accounts when those accounts leave policy scope.
|
Object |
getResourceTags()
An array of `ResourceTag` objects, used to explicitly include resources in the policy scope or explicitly exclude them.
|
String |
getResourceType()
The type of resource protected by or in scope of the policy.
|
List<String> |
getResourceTypeList()
An array of `ResourceType` objects.
|
Object |
getSecurityServicePolicyData()
Details about the security service that is being used to protect the resources.
|
List<CfnPolicy.PolicyTagProperty> |
getTags()
A collection of key:value pairs associated with an AWS resource.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setDeleteAllPolicyResources(Boolean value)
Used when deleting a policy.
|
void |
setDeleteAllPolicyResources(IResolvable value)
Used when deleting a policy.
|
void |
setExcludeMap(CfnPolicy.IEMapProperty value)
Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to exclude from the policy.
|
void |
setExcludeMap(IResolvable value)
Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to exclude from the policy.
|
void |
setExcludeResourceTags(Boolean value)
Used only when tags are specified in the `ResourceTags` property.
|
void |
setExcludeResourceTags(IResolvable value)
Used only when tags are specified in the `ResourceTags` property.
|
void |
setIncludeMap(CfnPolicy.IEMapProperty value)
Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to include in the policy.
|
void |
setIncludeMap(IResolvable value)
Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to include in the policy.
|
void |
setPolicyName(String value)
The name of the AWS Firewall Manager policy.
|
void |
setRemediationEnabled(Boolean value)
Indicates if the policy should be automatically applied to new resources.
|
void |
setRemediationEnabled(IResolvable value)
Indicates if the policy should be automatically applied to new resources.
|
void |
setResourcesCleanUp(Boolean value)
Indicates whether AWS Firewall Manager should automatically remove protections from resources that leave the policy scope and clean up resources that Firewall Manager is managing for accounts when those accounts leave policy scope.
|
void |
setResourcesCleanUp(IResolvable value)
Indicates whether AWS Firewall Manager should automatically remove protections from resources that leave the policy scope and clean up resources that Firewall Manager is managing for accounts when those accounts leave policy scope.
|
void |
setResourceTags(IResolvable value)
An array of `ResourceTag` objects, used to explicitly include resources in the policy scope or explicitly exclude them.
|
void |
setResourceTags(List<Object> value)
An array of `ResourceTag` objects, used to explicitly include resources in the policy scope or explicitly exclude them.
|
void |
setResourceType(String value)
The type of resource protected by or in scope of the policy.
|
void |
setResourceTypeList(List<String> value)
An array of `ResourceType` objects.
|
void |
setSecurityServicePolicyData(CfnPolicy.SecurityServicePolicyDataProperty value)
Details about the security service that is being used to protect the resources.
|
void |
setSecurityServicePolicyData(IResolvable value)
Details about the security service that is being used to protect the resources.
|
void |
setTags(List<CfnPolicy.PolicyTagProperty> value)
A collection of key:value pairs associated with an AWS resource.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnPolicy(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnPolicy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnPolicy(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
CfnPolicyProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull public String getAttrArn()
@Stability(value=Stable) @NotNull public String getAttrId()
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public Object getExcludeResourceTags()
If this property is True , resources with the specified tags are not in scope of the policy. If it's False , only resources with the specified tags are in scope of the policy.
@Stability(value=Stable)
public void setExcludeResourceTags(@NotNull
Boolean value)
If this property is True , resources with the specified tags are not in scope of the policy. If it's False , only resources with the specified tags are in scope of the policy.
@Stability(value=Stable)
public void setExcludeResourceTags(@NotNull
IResolvable value)
If this property is True , resources with the specified tags are not in scope of the policy. If it's False , only resources with the specified tags are in scope of the policy.
@Stability(value=Stable) @NotNull public String getPolicyName()
@Stability(value=Stable)
public void setPolicyName(@NotNull
String value)
@Stability(value=Stable) @NotNull public Object getRemediationEnabled()
@Stability(value=Stable)
public void setRemediationEnabled(@NotNull
Boolean value)
@Stability(value=Stable)
public void setRemediationEnabled(@NotNull
IResolvable value)
@Stability(value=Stable) @NotNull public String getResourceType()
This is in the format shown in the AWS Resource Types Reference . To apply this policy to multiple resource types, specify a resource type of ResourceTypeList and then specify the resource types in a ResourceTypeList .
For AWS WAF and Shield Advanced, example resource types 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 or DNS Firewall policy, the value is AWS::EC2::VPC .
@Stability(value=Stable)
public void setResourceType(@NotNull
String value)
This is in the format shown in the AWS Resource Types Reference . To apply this policy to multiple resource types, specify a resource type of ResourceTypeList and then specify the resource types in a ResourceTypeList .
For AWS WAF and Shield Advanced, example resource types 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 or DNS Firewall policy, the value is AWS::EC2::VPC .
@Stability(value=Stable) @NotNull public Object getSecurityServicePolicyData()
This contains the following settings:
Valid values: DNS_FIREWALL | NETWORK_FIREWALL | SECURITY_GROUPS_COMMON | SECURITY_GROUPS_CONTENT_AUDIT | SECURITY_GROUPS_USAGE_AUDIT | SHIELD_ADVANCED | WAFV2 | WAF
DNS_FIREWALL
"ManagedServiceData": "{ \"type\": \"DNS_FIREWALL\", \"preProcessRuleGroups\": [{\"ruleGroupId\": \"rslvr-frg-123456\", \"priority\": 11}], \"postProcessRuleGroups\": [{\"ruleGroupId\": \"rslvr-frg-123456\", \"priority\": 9902}]}"
NETWORK_FIREWALL
"ManagedServiceData":"{\"type\":\"NETWORK_FIREWALL\",\"networkFirewallStatelessRuleGroupReferences\":[{\"resourceARN\":\"arn:aws:network-firewall:us-east-1:000000000000:stateless-rulegroup\/example\",\"priority\":1}],\"networkFirewallStatelessDefaultActions\":[\"aws:drop\",\"example\"],\"networkFirewallStatelessFragmentDefaultActions\":[\"aws:drop\",\"example\"],\"networkFirewallStatelessCustomActions\":[{\"actionName\":\"example\",\"actionDefinition\":{\"publishMetricAction\":{\"dimensions\":[{\"value\":\"example\"}]}}}],\"networkFirewallStatefulRuleGroupReferences\":[{\"resourceARN\":\"arn:aws:network-firewall:us-east-1:000000000000:stateful-rulegroup\/example\"}],\"networkFirewallOrchestrationConfig\":{\"singleFirewallEndpointPerVPC\":false,\"allowedIPV4CidrList\":[]}}"
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"}
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.
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"}
SHIELD_ADVANCED for Amazon CloudFront distributions
"ManagedServiceData": "{\"type\": \"SHIELD_ADVANCED\", \"automaticResponseConfiguration\": {\"automaticResponseStatus\":\"ENABLED|IGNORED|DISABLED\", \"automaticResponseAction\":\"BLOCK|COUNT\"}, \"overrideCustomerWebaclClassic\":true|false}"
For example: "ManagedServiceData": "{\"type\":\"SHIELD_ADVANCED\",\"automaticResponseConfiguration\": {\"automaticResponseStatus\":\"ENABLED\", \"automaticResponseAction\":\"COUNT\"}}"
The default value for automaticResponseStatus is IGNORED . The value for automaticResponseAction is only required when automaticResponseStatus is set to ENABLED . The default value for overrideCustomerWebaclClassic is false .
For other resource types that you can protect with a Shield Advanced policy, this ManagedServiceData configuration is an empty string.
WAFV2
"ManagedServiceData": "{\"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 .
WAF Classic
"ManagedServiceData": "{\"type\": \"WAF\", \"ruleGroups\": [{\"id\":\"12345678-1bcd-9012-efga-0987654321ab\", \"overrideAction\" : {\"type\": \"COUNT\"}}],\"defaultAction\": {\"type\": \"BLOCK\"}}
AWS WAF Classic doesn't support rule groups in CloudFront . To create a WAF Classic policy through CloudFormation, create your rule groups outside of CloudFront , then provide the rule group IDs in the WAF managed service data specification.
@Stability(value=Stable)
public void setSecurityServicePolicyData(@NotNull
CfnPolicy.SecurityServicePolicyDataProperty value)
This contains the following settings:
Valid values: DNS_FIREWALL | NETWORK_FIREWALL | SECURITY_GROUPS_COMMON | SECURITY_GROUPS_CONTENT_AUDIT | SECURITY_GROUPS_USAGE_AUDIT | SHIELD_ADVANCED | WAFV2 | WAF
DNS_FIREWALL
"ManagedServiceData": "{ \"type\": \"DNS_FIREWALL\", \"preProcessRuleGroups\": [{\"ruleGroupId\": \"rslvr-frg-123456\", \"priority\": 11}], \"postProcessRuleGroups\": [{\"ruleGroupId\": \"rslvr-frg-123456\", \"priority\": 9902}]}"
NETWORK_FIREWALL
"ManagedServiceData":"{\"type\":\"NETWORK_FIREWALL\",\"networkFirewallStatelessRuleGroupReferences\":[{\"resourceARN\":\"arn:aws:network-firewall:us-east-1:000000000000:stateless-rulegroup\/example\",\"priority\":1}],\"networkFirewallStatelessDefaultActions\":[\"aws:drop\",\"example\"],\"networkFirewallStatelessFragmentDefaultActions\":[\"aws:drop\",\"example\"],\"networkFirewallStatelessCustomActions\":[{\"actionName\":\"example\",\"actionDefinition\":{\"publishMetricAction\":{\"dimensions\":[{\"value\":\"example\"}]}}}],\"networkFirewallStatefulRuleGroupReferences\":[{\"resourceARN\":\"arn:aws:network-firewall:us-east-1:000000000000:stateful-rulegroup\/example\"}],\"networkFirewallOrchestrationConfig\":{\"singleFirewallEndpointPerVPC\":false,\"allowedIPV4CidrList\":[]}}"
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"}
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.
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"}
SHIELD_ADVANCED for Amazon CloudFront distributions
"ManagedServiceData": "{\"type\": \"SHIELD_ADVANCED\", \"automaticResponseConfiguration\": {\"automaticResponseStatus\":\"ENABLED|IGNORED|DISABLED\", \"automaticResponseAction\":\"BLOCK|COUNT\"}, \"overrideCustomerWebaclClassic\":true|false}"
For example: "ManagedServiceData": "{\"type\":\"SHIELD_ADVANCED\",\"automaticResponseConfiguration\": {\"automaticResponseStatus\":\"ENABLED\", \"automaticResponseAction\":\"COUNT\"}}"
The default value for automaticResponseStatus is IGNORED . The value for automaticResponseAction is only required when automaticResponseStatus is set to ENABLED . The default value for overrideCustomerWebaclClassic is false .
For other resource types that you can protect with a Shield Advanced policy, this ManagedServiceData configuration is an empty string.
WAFV2
"ManagedServiceData": "{\"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 .
WAF Classic
"ManagedServiceData": "{\"type\": \"WAF\", \"ruleGroups\": [{\"id\":\"12345678-1bcd-9012-efga-0987654321ab\", \"overrideAction\" : {\"type\": \"COUNT\"}}],\"defaultAction\": {\"type\": \"BLOCK\"}}
AWS WAF Classic doesn't support rule groups in CloudFront . To create a WAF Classic policy through CloudFormation, create your rule groups outside of CloudFront , then provide the rule group IDs in the WAF managed service data specification.
@Stability(value=Stable)
public void setSecurityServicePolicyData(@NotNull
IResolvable value)
This contains the following settings:
Valid values: DNS_FIREWALL | NETWORK_FIREWALL | SECURITY_GROUPS_COMMON | SECURITY_GROUPS_CONTENT_AUDIT | SECURITY_GROUPS_USAGE_AUDIT | SHIELD_ADVANCED | WAFV2 | WAF
DNS_FIREWALL
"ManagedServiceData": "{ \"type\": \"DNS_FIREWALL\", \"preProcessRuleGroups\": [{\"ruleGroupId\": \"rslvr-frg-123456\", \"priority\": 11}], \"postProcessRuleGroups\": [{\"ruleGroupId\": \"rslvr-frg-123456\", \"priority\": 9902}]}"
NETWORK_FIREWALL
"ManagedServiceData":"{\"type\":\"NETWORK_FIREWALL\",\"networkFirewallStatelessRuleGroupReferences\":[{\"resourceARN\":\"arn:aws:network-firewall:us-east-1:000000000000:stateless-rulegroup\/example\",\"priority\":1}],\"networkFirewallStatelessDefaultActions\":[\"aws:drop\",\"example\"],\"networkFirewallStatelessFragmentDefaultActions\":[\"aws:drop\",\"example\"],\"networkFirewallStatelessCustomActions\":[{\"actionName\":\"example\",\"actionDefinition\":{\"publishMetricAction\":{\"dimensions\":[{\"value\":\"example\"}]}}}],\"networkFirewallStatefulRuleGroupReferences\":[{\"resourceARN\":\"arn:aws:network-firewall:us-east-1:000000000000:stateful-rulegroup\/example\"}],\"networkFirewallOrchestrationConfig\":{\"singleFirewallEndpointPerVPC\":false,\"allowedIPV4CidrList\":[]}}"
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"}
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.
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"}
SHIELD_ADVANCED for Amazon CloudFront distributions
"ManagedServiceData": "{\"type\": \"SHIELD_ADVANCED\", \"automaticResponseConfiguration\": {\"automaticResponseStatus\":\"ENABLED|IGNORED|DISABLED\", \"automaticResponseAction\":\"BLOCK|COUNT\"}, \"overrideCustomerWebaclClassic\":true|false}"
For example: "ManagedServiceData": "{\"type\":\"SHIELD_ADVANCED\",\"automaticResponseConfiguration\": {\"automaticResponseStatus\":\"ENABLED\", \"automaticResponseAction\":\"COUNT\"}}"
The default value for automaticResponseStatus is IGNORED . The value for automaticResponseAction is only required when automaticResponseStatus is set to ENABLED . The default value for overrideCustomerWebaclClassic is false .
For other resource types that you can protect with a Shield Advanced policy, this ManagedServiceData configuration is an empty string.
WAFV2
"ManagedServiceData": "{\"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 .
WAF Classic
"ManagedServiceData": "{\"type\": \"WAF\", \"ruleGroups\": [{\"id\":\"12345678-1bcd-9012-efga-0987654321ab\", \"overrideAction\" : {\"type\": \"COUNT\"}}],\"defaultAction\": {\"type\": \"BLOCK\"}}
AWS WAF Classic doesn't support rule groups in CloudFront . To create a WAF Classic policy through CloudFormation, create your rule groups outside of CloudFront , then provide the rule group IDs in the WAF managed service data specification.
@Stability(value=Stable) @Nullable public Object getDeleteAllPolicyResources()
For AWS WAF and Shield Advanced policies, Firewall Manager does the following:
For security group policies, Firewall Manager does the following for each security group in the policy:
After the cleanup, in-scope resources are no longer protected by web ACLs in this policy. Protection of out-of-scope resources remains unchanged. Scope is determined by tags that you create and accounts that you associate with the policy. When creating the policy, if you specify that only resources in specific accounts or with specific tags are in scope of the policy, those accounts and resources are handled by the policy. All others are out of scope. If you don't specify tags or accounts, all resources are in scope.
@Stability(value=Stable)
public void setDeleteAllPolicyResources(@Nullable
Boolean value)
For AWS WAF and Shield Advanced policies, Firewall Manager does the following:
For security group policies, Firewall Manager does the following for each security group in the policy:
After the cleanup, in-scope resources are no longer protected by web ACLs in this policy. Protection of out-of-scope resources remains unchanged. Scope is determined by tags that you create and accounts that you associate with the policy. When creating the policy, if you specify that only resources in specific accounts or with specific tags are in scope of the policy, those accounts and resources are handled by the policy. All others are out of scope. If you don't specify tags or accounts, all resources are in scope.
@Stability(value=Stable)
public void setDeleteAllPolicyResources(@Nullable
IResolvable value)
For AWS WAF and Shield Advanced policies, Firewall Manager does the following:
For security group policies, Firewall Manager does the following for each security group in the policy:
After the cleanup, in-scope resources are no longer protected by web ACLs in this policy. Protection of out-of-scope resources remains unchanged. Scope is determined by tags that you create and accounts that you associate with the policy. When creating the policy, if you specify that only resources in specific accounts or with specific tags are in scope of the policy, those accounts and resources are handled by the policy. All others are out of scope. If you don't specify tags or accounts, all resources are in scope.
@Stability(value=Stable) @Nullable public Object getExcludeMap()
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:
ACCOUNT . For example, the following is a valid map: {“ACCOUNT” : [“accountID1”, “accountID2”]} .ORGUNIT . For example, the following is a valid map: {“ORGUNIT” : [“ouid111”, “ouid112”]} .{“ACCOUNT” : [“accountID1”, “accountID2”], “ORGUNIT” : [“ouid111”, “ouid112”]} .@Stability(value=Stable)
public void setExcludeMap(@Nullable
CfnPolicy.IEMapProperty value)
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:
ACCOUNT . For example, the following is a valid map: {“ACCOUNT” : [“accountID1”, “accountID2”]} .ORGUNIT . For example, the following is a valid map: {“ORGUNIT” : [“ouid111”, “ouid112”]} .{“ACCOUNT” : [“accountID1”, “accountID2”], “ORGUNIT” : [“ouid111”, “ouid112”]} .@Stability(value=Stable)
public void setExcludeMap(@Nullable
IResolvable value)
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:
ACCOUNT . For example, the following is a valid map: {“ACCOUNT” : [“accountID1”, “accountID2”]} .ORGUNIT . For example, the following is a valid map: {“ORGUNIT” : [“ouid111”, “ouid112”]} .{“ACCOUNT” : [“accountID1”, “accountID2”], “ORGUNIT” : [“ouid111”, “ouid112”]} .@Stability(value=Stable) @Nullable public Object getIncludeMap()
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:
ACCOUNT . For example, the following is a valid map: {“ACCOUNT” : [“accountID1”, “accountID2”]} .ORGUNIT . For example, the following is a valid map: {“ORGUNIT” : [“ouid111”, “ouid112”]} .{“ACCOUNT” : [“accountID1”, “accountID2”], “ORGUNIT” : [“ouid111”, “ouid112”]} .@Stability(value=Stable)
public void setIncludeMap(@Nullable
CfnPolicy.IEMapProperty value)
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:
ACCOUNT . For example, the following is a valid map: {“ACCOUNT” : [“accountID1”, “accountID2”]} .ORGUNIT . For example, the following is a valid map: {“ORGUNIT” : [“ouid111”, “ouid112”]} .{“ACCOUNT” : [“accountID1”, “accountID2”], “ORGUNIT” : [“ouid111”, “ouid112”]} .@Stability(value=Stable)
public void setIncludeMap(@Nullable
IResolvable value)
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:
ACCOUNT . For example, the following is a valid map: {“ACCOUNT” : [“accountID1”, “accountID2”]} .ORGUNIT . For example, the following is a valid map: {“ORGUNIT” : [“ouid111”, “ouid112”]} .{“ACCOUNT” : [“accountID1”, “accountID2”], “ORGUNIT” : [“ouid111”, “ouid112”]} .@Stability(value=Stable) @Nullable public Object getResourcesCleanUp()
For example, Firewall Manager will disassociate a Firewall Manager managed web ACL from a protected customer resource when the customer resource leaves policy scope.
By default, Firewall Manager doesn't remove protections or delete Firewall Manager managed resources.
This option is not available for Shield Advanced or AWS WAF Classic policies.
@Stability(value=Stable)
public void setResourcesCleanUp(@Nullable
Boolean value)
For example, Firewall Manager will disassociate a Firewall Manager managed web ACL from a protected customer resource when the customer resource leaves policy scope.
By default, Firewall Manager doesn't remove protections or delete Firewall Manager managed resources.
This option is not available for Shield Advanced or AWS WAF Classic policies.
@Stability(value=Stable)
public void setResourcesCleanUp(@Nullable
IResolvable value)
For example, Firewall Manager will disassociate a Firewall Manager managed web ACL from a protected customer resource when the customer resource leaves policy scope.
By default, Firewall Manager doesn't remove protections or delete Firewall Manager managed resources.
This option is not available for Shield Advanced or AWS WAF Classic policies.
@Stability(value=Stable) @Nullable public Object getResourceTags()
If this isn't set, then tags aren't used to modify policy scope. See also ExcludeResourceTags .
@Stability(value=Stable)
public void setResourceTags(@Nullable
IResolvable value)
If this isn't set, then tags aren't used to modify policy scope. See also ExcludeResourceTags .
@Stability(value=Stable)
public void setResourceTags(@Nullable
List<Object> value)
If this isn't set, then tags aren't used to modify policy scope. See also ExcludeResourceTags .
@Stability(value=Stable) @Nullable public List<String> getResourceTypeList()
Use this only to specify multiple resource types. To specify a single resource type, use ResourceType .
@Stability(value=Stable)
public void setResourceTypeList(@Nullable
List<String> value)
Use this only to specify multiple resource types. To specify a single resource type, use ResourceType .
@Stability(value=Stable) @Nullable public List<CfnPolicy.PolicyTagProperty> getTags()
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.
@Stability(value=Stable)
public void setTags(@Nullable
List<CfnPolicy.PolicyTagProperty> value)
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.
Copyright © 2022. All rights reserved.