Class Policy
- All Implemented Interfaces:
Serializable,SdkPojo,ToCopyableBuilder<Policy.Builder,Policy>
An Firewall Manager policy.
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Policy.Builderbuilder()final BooleanIndicates whether 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.final booleanfinal booleanequalsBySdkFields(Object obj) Indicates whether some other object is "equal to" this one by SDK fields.final Map<CustomerPolicyScopeIdType, List<String>> Specifies the Amazon Web Services account IDs and Organizations organizational units (OUs) to exclude from the policy.Specifies the Amazon Web Services account IDs and Organizations organizational units (OUs) to exclude from the policy.final BooleanIf set toTrue, resources with the tags that are specified in theResourceTagarray are not in scope of the policy.final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) final booleanFor responses, this returns true if the service returned a value for the ExcludeMap property.final inthashCode()final booleanFor responses, this returns true if the service returned a value for the IncludeMap property.final booleanFor responses, this returns true if the service returned a value for the ResourceSetIds property.final booleanFor responses, this returns true if the service returned a value for the ResourceTags property.final booleanFor responses, this returns true if the service returned a value for the ResourceTypeList property.final Map<CustomerPolicyScopeIdType, List<String>> Specifies the Amazon Web Services account IDs and Organizations organizational units (OUs) to include in the policy.Specifies the Amazon Web Services account IDs and Organizations organizational units (OUs) to include in the policy.final StringYour description of the Firewall Manager policy.final StringpolicyId()The ID of the Firewall Manager policy.final StringThe name of the Firewall Manager policy.final CustomerPolicyStatusIndicates whether the policy is in or out of an admin's policy or Region scope.final StringIndicates whether the policy is in or out of an admin's policy or Region scope.final StringA unique identifier for each update to the policy.final BooleanIndicates if the policy should be automatically applied to new resources.The unique identifiers of the resource sets used by the policy.final List<ResourceTag> An array ofResourceTagobjects.final StringThe type of resource protected by or in scope of the policy.An array ofResourceTypeobjects.Details about the security service that is being used to protect the resources.static Class<? extends Policy.Builder> Take this object and create a builder that contains all of the current property values of this object.final StringtoString()Returns a string representation of this object.Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
policyId
The ID of the Firewall Manager policy.
- Returns:
- The ID of the Firewall Manager policy.
-
policyName
The name of the Firewall Manager policy.
- Returns:
- The name of the Firewall Manager policy.
-
policyUpdateToken
A unique identifier for each update to the policy. When issuing a
PutPolicyrequest, thePolicyUpdateTokenin the request must match thePolicyUpdateTokenof the current policy version. To get thePolicyUpdateTokenof the current policy version, use aGetPolicyrequest.- Returns:
- A unique identifier for each update to the policy. When issuing a
PutPolicyrequest, thePolicyUpdateTokenin the request must match thePolicyUpdateTokenof the current policy version. To get thePolicyUpdateTokenof the current policy version, use aGetPolicyrequest.
-
securityServicePolicyData
Details about the security service that is being used to protect the resources.
- Returns:
- Details about the security service that is being used to protect the resources.
-
resourceType
The type of resource protected by or in scope of the policy. This is in the format shown in the Amazon Web Services Resource Types Reference. To apply this policy to multiple resource types, specify a resource type of
ResourceTypeListand then specify the resource types in aResourceTypeList.The following are valid resource types for each Firewall Manager policy type:
-
Amazon Web Services WAF Classic -
AWS::ApiGateway::Stage,AWS::CloudFront::Distribution, andAWS::ElasticLoadBalancingV2::LoadBalancer. -
WAF -
AWS::ApiGateway::Stage,AWS::ElasticLoadBalancingV2::LoadBalancer, andAWS::CloudFront::Distribution. -
Shield Advanced -
AWS::ElasticLoadBalancingV2::LoadBalancer,AWS::ElasticLoadBalancing::LoadBalancer,AWS::EC2::EIP, andAWS::CloudFront::Distribution. -
Network ACL -
AWS::EC2::Subnet. -
Security group usage audit -
AWS::EC2::SecurityGroup. -
Security group content audit -
AWS::EC2::SecurityGroup,AWS::EC2::NetworkInterface, andAWS::EC2::Instance. -
DNS Firewall, Network Firewall, and third-party firewall -
AWS::EC2::VPC.
- Returns:
- The type of resource protected by or in scope of the policy. This is in the format shown in the Amazon Web Services Resource Types Reference. To apply this policy to multiple resource types,
specify a resource type of
ResourceTypeListand then specify the resource types in aResourceTypeList.The following are valid resource types for each Firewall Manager policy type:
-
Amazon Web Services WAF Classic -
AWS::ApiGateway::Stage,AWS::CloudFront::Distribution, andAWS::ElasticLoadBalancingV2::LoadBalancer. -
WAF -
AWS::ApiGateway::Stage,AWS::ElasticLoadBalancingV2::LoadBalancer, andAWS::CloudFront::Distribution. -
Shield Advanced -
AWS::ElasticLoadBalancingV2::LoadBalancer,AWS::ElasticLoadBalancing::LoadBalancer,AWS::EC2::EIP, andAWS::CloudFront::Distribution. -
Network ACL -
AWS::EC2::Subnet. -
Security group usage audit -
AWS::EC2::SecurityGroup. -
Security group content audit -
AWS::EC2::SecurityGroup,AWS::EC2::NetworkInterface, andAWS::EC2::Instance. -
DNS Firewall, Network Firewall, and third-party firewall -
AWS::EC2::VPC.
-
-
-
hasResourceTypeList
public final boolean hasResourceTypeList()For responses, this returns true if the service returned a value for the ResourceTypeList property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified. -
resourceTypeList
An array of
ResourceTypeobjects. Use this only to specify multiple resource types. To specify a single resource type, useResourceType.Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasResourceTypeList()method.- Returns:
- An array of
ResourceTypeobjects. Use this only to specify multiple resource types. To specify a single resource type, useResourceType.
-
hasResourceTags
public final boolean hasResourceTags()For responses, this returns true if the service returned a value for the ResourceTags property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified. -
resourceTags
An array of
ResourceTagobjects.Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasResourceTags()method.- Returns:
- An array of
ResourceTagobjects.
-
excludeResourceTags
If set to
True, resources with the tags that are specified in theResourceTagarray are not in scope of the policy. If set toFalse, and theResourceTagarray is not null, only resources with the specified tags are in scope of the policy.- Returns:
- If set to
True, resources with the tags that are specified in theResourceTagarray are not in scope of the policy. If set toFalse, and theResourceTagarray is not null, only resources with the specified tags are in scope of the policy.
-
remediationEnabled
Indicates if the policy should be automatically applied to new resources.
- Returns:
- Indicates if the policy should be automatically applied to new resources.
-
deleteUnusedFMManagedResources
Indicates whether 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. 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 WAF Classic policies.
- Returns:
- Indicates whether 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. 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 WAF Classic policies.
-
includeMap
Specifies the Amazon Web Services account IDs and 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, Firewall Manager applies the policy to all accounts specified by theIncludeMap, and does not evaluate anyExcludeMapspecifications. If you do not specify anIncludeMap, then Firewall Manager applies the policy to all accounts except for those specified by theExcludeMap.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”]}.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasIncludeMap()method.- Returns:
- Specifies the Amazon Web Services account IDs and 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, Firewall Manager applies the policy to all accounts specified by theIncludeMap, and does not evaluate anyExcludeMapspecifications. If you do not specify anIncludeMap, then Firewall Manager applies the policy to all accounts except for those specified by theExcludeMap.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”]}.
-
-
-
hasIncludeMap
public final boolean hasIncludeMap()For responses, this returns true if the service returned a value for the IncludeMap property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified. -
includeMapAsStrings
Specifies the Amazon Web Services account IDs and 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, Firewall Manager applies the policy to all accounts specified by theIncludeMap, and does not evaluate anyExcludeMapspecifications. If you do not specify anIncludeMap, then Firewall Manager applies the policy to all accounts except for those specified by theExcludeMap.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”]}.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasIncludeMap()method.- Returns:
- Specifies the Amazon Web Services account IDs and 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, Firewall Manager applies the policy to all accounts specified by theIncludeMap, and does not evaluate anyExcludeMapspecifications. If you do not specify anIncludeMap, then Firewall Manager applies the policy to all accounts except for those specified by theExcludeMap.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”]}.
-
-
-
excludeMap
Specifies the Amazon Web Services account IDs and 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, Firewall Manager applies the policy to all accounts specified by theIncludeMap, and does not evaluate anyExcludeMapspecifications. If you do not specify anIncludeMap, then Firewall Manager applies the policy to all accounts except for those specified by theExcludeMap.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”]}.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasExcludeMap()method.- Returns:
- Specifies the Amazon Web Services account IDs and 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, Firewall Manager applies the policy to all accounts specified by theIncludeMap, and does not evaluate anyExcludeMapspecifications. If you do not specify anIncludeMap, then Firewall Manager applies the policy to all accounts except for those specified by theExcludeMap.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”]}.
-
-
-
hasExcludeMap
public final boolean hasExcludeMap()For responses, this returns true if the service returned a value for the ExcludeMap property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified. -
excludeMapAsStrings
Specifies the Amazon Web Services account IDs and 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, Firewall Manager applies the policy to all accounts specified by theIncludeMap, and does not evaluate anyExcludeMapspecifications. If you do not specify anIncludeMap, then Firewall Manager applies the policy to all accounts except for those specified by theExcludeMap.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”]}.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasExcludeMap()method.- Returns:
- Specifies the Amazon Web Services account IDs and 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, Firewall Manager applies the policy to all accounts specified by theIncludeMap, and does not evaluate anyExcludeMapspecifications. If you do not specify anIncludeMap, then Firewall Manager applies the policy to all accounts except for those specified by theExcludeMap.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”]}.
-
-
-
hasResourceSetIds
public final boolean hasResourceSetIds()For responses, this returns true if the service returned a value for the ResourceSetIds property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified. -
resourceSetIds
The unique identifiers of the resource sets used by the policy.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasResourceSetIds()method.- Returns:
- The unique identifiers of the resource sets used by the policy.
-
policyDescription
Your description of the Firewall Manager policy.
- Returns:
- Your description of the Firewall Manager policy.
-
policyStatus
Indicates whether the policy is in or out of an admin's policy or Region scope.
-
ACTIVE- The administrator can manage and delete the policy. -
OUT_OF_ADMIN_SCOPE- The administrator can view the policy, but they can't edit or delete the policy. Existing policy protections stay in place. Any new resources that come into scope of the policy won't be protected.
If the service returns an enum value that is not available in the current SDK version,
policyStatuswill returnCustomerPolicyStatus.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available frompolicyStatusAsString().- Returns:
- Indicates whether the policy is in or out of an admin's policy or Region scope.
-
ACTIVE- The administrator can manage and delete the policy. -
OUT_OF_ADMIN_SCOPE- The administrator can view the policy, but they can't edit or delete the policy. Existing policy protections stay in place. Any new resources that come into scope of the policy won't be protected.
-
- See Also:
-
-
policyStatusAsString
Indicates whether the policy is in or out of an admin's policy or Region scope.
-
ACTIVE- The administrator can manage and delete the policy. -
OUT_OF_ADMIN_SCOPE- The administrator can view the policy, but they can't edit or delete the policy. Existing policy protections stay in place. Any new resources that come into scope of the policy won't be protected.
If the service returns an enum value that is not available in the current SDK version,
policyStatuswill returnCustomerPolicyStatus.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available frompolicyStatusAsString().- Returns:
- Indicates whether the policy is in or out of an admin's policy or Region scope.
-
ACTIVE- The administrator can manage and delete the policy. -
OUT_OF_ADMIN_SCOPE- The administrator can view the policy, but they can't edit or delete the policy. Existing policy protections stay in place. Any new resources that come into scope of the policy won't be protected.
-
- See Also:
-
-
toBuilder
Description copied from interface:ToCopyableBuilderTake this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilderin interfaceToCopyableBuilder<Policy.Builder,Policy> - Returns:
- a builder for type T
-
builder
-
serializableBuilderClass
-
hashCode
-
equals
-
equalsBySdkFields
Description copied from interface:SdkPojoIndicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in anSdkPojoclass, and is generated based on a service model.If an
SdkPojoclass does not have any inherited fields,equalsBySdkFieldsandequalsare essentially the same.- Specified by:
equalsBySdkFieldsin interfaceSdkPojo- Parameters:
obj- the object to be compared with- Returns:
- true if the other object equals to this object by sdk fields, false otherwise.
-
toString
-
getValueForField
-
sdkFields
-
sdkFieldNameToField
- Specified by:
sdkFieldNameToFieldin interfaceSdkPojo- Returns:
- The mapping between the field name and its corresponding field.
-