Oracle Cloud Infrastructure v2.31.0 published on Thursday, Apr 17, 2025 by Pulumi
oci.Waas.getProtectionRule
Explore with Pulumi AI
This data source provides details about a specific Protection Rule resource in Oracle Cloud Infrastructure Web Application Acceleration and Security service.
Gets the details of a protection rule in the Web Application Firewall configuration for a WAAS policy.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testProtectionRule = oci.Waas.getProtectionRule({
    protectionRuleKey: protectionRuleProtectionRuleKey,
    waasPolicyId: testWaasPolicy.id,
});
import pulumi
import pulumi_oci as oci
test_protection_rule = oci.Waas.get_protection_rule(protection_rule_key=protection_rule_protection_rule_key,
    waas_policy_id=test_waas_policy["id"])
package main
import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/waas"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := waas.GetProtectionRule(ctx, &waas.GetProtectionRuleArgs{
			ProtectionRuleKey: protectionRuleProtectionRuleKey,
			WaasPolicyId:      testWaasPolicy.Id,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() => 
{
    var testProtectionRule = Oci.Waas.GetProtectionRule.Invoke(new()
    {
        ProtectionRuleKey = protectionRuleProtectionRuleKey,
        WaasPolicyId = testWaasPolicy.Id,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Waas.WaasFunctions;
import com.pulumi.oci.Waas.inputs.GetProtectionRuleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        final var testProtectionRule = WaasFunctions.getProtectionRule(GetProtectionRuleArgs.builder()
            .protectionRuleKey(protectionRuleProtectionRuleKey)
            .waasPolicyId(testWaasPolicy.id())
            .build());
    }
}
variables:
  testProtectionRule:
    fn::invoke:
      function: oci:Waas:getProtectionRule
      arguments:
        protectionRuleKey: ${protectionRuleProtectionRuleKey}
        waasPolicyId: ${testWaasPolicy.id}
Using getProtectionRule
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getProtectionRule(args: GetProtectionRuleArgs, opts?: InvokeOptions): Promise<GetProtectionRuleResult>
function getProtectionRuleOutput(args: GetProtectionRuleOutputArgs, opts?: InvokeOptions): Output<GetProtectionRuleResult>def get_protection_rule(protection_rule_key: Optional[str] = None,
                        waas_policy_id: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetProtectionRuleResult
def get_protection_rule_output(protection_rule_key: Optional[pulumi.Input[str]] = None,
                        waas_policy_id: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetProtectionRuleResult]func GetProtectionRule(ctx *Context, args *GetProtectionRuleArgs, opts ...InvokeOption) (*GetProtectionRuleResult, error)
func GetProtectionRuleOutput(ctx *Context, args *GetProtectionRuleOutputArgs, opts ...InvokeOption) GetProtectionRuleResultOutput> Note: This function is named GetProtectionRule in the Go SDK.
public static class GetProtectionRule 
{
    public static Task<GetProtectionRuleResult> InvokeAsync(GetProtectionRuleArgs args, InvokeOptions? opts = null)
    public static Output<GetProtectionRuleResult> Invoke(GetProtectionRuleInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetProtectionRuleResult> getProtectionRule(GetProtectionRuleArgs args, InvokeOptions options)
public static Output<GetProtectionRuleResult> getProtectionRule(GetProtectionRuleArgs args, InvokeOptions options)
fn::invoke:
  function: oci:Waas/getProtectionRule:getProtectionRule
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Protection
Rule stringKey  - The protection rule key.
 - Waas
Policy stringId  - The OCID of the WAAS policy.
 
- Protection
Rule stringKey  - The protection rule key.
 - Waas
Policy stringId  - The OCID of the WAAS policy.
 
- protection
Rule StringKey  - The protection rule key.
 - waas
Policy StringId  - The OCID of the WAAS policy.
 
- protection
Rule stringKey  - The protection rule key.
 - waas
Policy stringId  - The OCID of the WAAS policy.
 
- protection_
rule_ strkey  - The protection rule key.
 - waas_
policy_ strid  - The OCID of the WAAS policy.
 
- protection
Rule StringKey  - The protection rule key.
 - waas
Policy StringId  - The OCID of the WAAS policy.
 
getProtectionRule Result
The following output properties are available:
- Action string
 - The action to take when the traffic is detected as malicious. If unspecified, defaults to 
OFF. - Description string
 - The description of the protection rule.
 - Exclusions
List<Get
Protection Rule Exclusion>  - An array of The target property of a request that would allow it to bypass the protection rule. For example, when 
targetisREQUEST_COOKIE_NAMES, the list may include names of cookies to exclude from the protection rule. When the target isARGS, the list may include strings of URL query parameters and values from form-urlencoded XML, JSON, AMP, or POST payloads to exclude from the protection rule.Exclusionsproperties must not contain whitespace, comma or |. Note: If protection rules have been enabled that utilize themaxArgumentCountormaxTotalNameLengthOfArgumentsproperties, and thetargetproperty has been set toARGS, it is important that theexclusionsproperties be defined to honor those protection rule settings in a consistent manner. - Id string
 - The provider-assigned unique ID for this managed resource.
 - Key string
 - The unique key of the protection rule.
 - Labels List<string>
 - The list of labels for the protection rule.
 - Mod
Security List<string>Rule Ids  - The list of the ModSecurity rule IDs that apply to this protection rule. For more information about ModSecurity's open source WAF rules, see Mod Security's documentation.
 - Name string
 - The name of the protection rule.
 - Protection
Rule stringKey  - Waas
Policy stringId  
- Action string
 - The action to take when the traffic is detected as malicious. If unspecified, defaults to 
OFF. - Description string
 - The description of the protection rule.
 - Exclusions
[]Get
Protection Rule Exclusion  - An array of The target property of a request that would allow it to bypass the protection rule. For example, when 
targetisREQUEST_COOKIE_NAMES, the list may include names of cookies to exclude from the protection rule. When the target isARGS, the list may include strings of URL query parameters and values from form-urlencoded XML, JSON, AMP, or POST payloads to exclude from the protection rule.Exclusionsproperties must not contain whitespace, comma or |. Note: If protection rules have been enabled that utilize themaxArgumentCountormaxTotalNameLengthOfArgumentsproperties, and thetargetproperty has been set toARGS, it is important that theexclusionsproperties be defined to honor those protection rule settings in a consistent manner. - Id string
 - The provider-assigned unique ID for this managed resource.
 - Key string
 - The unique key of the protection rule.
 - Labels []string
 - The list of labels for the protection rule.
 - Mod
Security []stringRule Ids  - The list of the ModSecurity rule IDs that apply to this protection rule. For more information about ModSecurity's open source WAF rules, see Mod Security's documentation.
 - Name string
 - The name of the protection rule.
 - Protection
Rule stringKey  - Waas
Policy stringId  
- action String
 - The action to take when the traffic is detected as malicious. If unspecified, defaults to 
OFF. - description String
 - The description of the protection rule.
 - exclusions
List<Get
Protection Rule Exclusion>  - An array of The target property of a request that would allow it to bypass the protection rule. For example, when 
targetisREQUEST_COOKIE_NAMES, the list may include names of cookies to exclude from the protection rule. When the target isARGS, the list may include strings of URL query parameters and values from form-urlencoded XML, JSON, AMP, or POST payloads to exclude from the protection rule.Exclusionsproperties must not contain whitespace, comma or |. Note: If protection rules have been enabled that utilize themaxArgumentCountormaxTotalNameLengthOfArgumentsproperties, and thetargetproperty has been set toARGS, it is important that theexclusionsproperties be defined to honor those protection rule settings in a consistent manner. - id String
 - The provider-assigned unique ID for this managed resource.
 - key String
 - The unique key of the protection rule.
 - labels List<String>
 - The list of labels for the protection rule.
 - mod
Security List<String>Rule Ids  - The list of the ModSecurity rule IDs that apply to this protection rule. For more information about ModSecurity's open source WAF rules, see Mod Security's documentation.
 - name String
 - The name of the protection rule.
 - protection
Rule StringKey  - waas
Policy StringId  
- action string
 - The action to take when the traffic is detected as malicious. If unspecified, defaults to 
OFF. - description string
 - The description of the protection rule.
 - exclusions
Get
Protection Rule Exclusion[]  - An array of The target property of a request that would allow it to bypass the protection rule. For example, when 
targetisREQUEST_COOKIE_NAMES, the list may include names of cookies to exclude from the protection rule. When the target isARGS, the list may include strings of URL query parameters and values from form-urlencoded XML, JSON, AMP, or POST payloads to exclude from the protection rule.Exclusionsproperties must not contain whitespace, comma or |. Note: If protection rules have been enabled that utilize themaxArgumentCountormaxTotalNameLengthOfArgumentsproperties, and thetargetproperty has been set toARGS, it is important that theexclusionsproperties be defined to honor those protection rule settings in a consistent manner. - id string
 - The provider-assigned unique ID for this managed resource.
 - key string
 - The unique key of the protection rule.
 - labels string[]
 - The list of labels for the protection rule.
 - mod
Security string[]Rule Ids  - The list of the ModSecurity rule IDs that apply to this protection rule. For more information about ModSecurity's open source WAF rules, see Mod Security's documentation.
 - name string
 - The name of the protection rule.
 - protection
Rule stringKey  - waas
Policy stringId  
- action str
 - The action to take when the traffic is detected as malicious. If unspecified, defaults to 
OFF. - description str
 - The description of the protection rule.
 - exclusions
Sequence[waas.
Get Protection Rule Exclusion]  - An array of The target property of a request that would allow it to bypass the protection rule. For example, when 
targetisREQUEST_COOKIE_NAMES, the list may include names of cookies to exclude from the protection rule. When the target isARGS, the list may include strings of URL query parameters and values from form-urlencoded XML, JSON, AMP, or POST payloads to exclude from the protection rule.Exclusionsproperties must not contain whitespace, comma or |. Note: If protection rules have been enabled that utilize themaxArgumentCountormaxTotalNameLengthOfArgumentsproperties, and thetargetproperty has been set toARGS, it is important that theexclusionsproperties be defined to honor those protection rule settings in a consistent manner. - id str
 - The provider-assigned unique ID for this managed resource.
 - key str
 - The unique key of the protection rule.
 - labels Sequence[str]
 - The list of labels for the protection rule.
 - mod_
security_ Sequence[str]rule_ ids  - The list of the ModSecurity rule IDs that apply to this protection rule. For more information about ModSecurity's open source WAF rules, see Mod Security's documentation.
 - name str
 - The name of the protection rule.
 - protection_
rule_ strkey  - waas_
policy_ strid  
- action String
 - The action to take when the traffic is detected as malicious. If unspecified, defaults to 
OFF. - description String
 - The description of the protection rule.
 - exclusions List<Property Map>
 - An array of The target property of a request that would allow it to bypass the protection rule. For example, when 
targetisREQUEST_COOKIE_NAMES, the list may include names of cookies to exclude from the protection rule. When the target isARGS, the list may include strings of URL query parameters and values from form-urlencoded XML, JSON, AMP, or POST payloads to exclude from the protection rule.Exclusionsproperties must not contain whitespace, comma or |. Note: If protection rules have been enabled that utilize themaxArgumentCountormaxTotalNameLengthOfArgumentsproperties, and thetargetproperty has been set toARGS, it is important that theexclusionsproperties be defined to honor those protection rule settings in a consistent manner. - id String
 - The provider-assigned unique ID for this managed resource.
 - key String
 - The unique key of the protection rule.
 - labels List<String>
 - The list of labels for the protection rule.
 - mod
Security List<String>Rule Ids  - The list of the ModSecurity rule IDs that apply to this protection rule. For more information about ModSecurity's open source WAF rules, see Mod Security's documentation.
 - name String
 - The name of the protection rule.
 - protection
Rule StringKey  - waas
Policy StringId  
Supporting Types
GetProtectionRuleExclusion   
- Exclusions List<string>
 - An array of The target property of a request that would allow it to bypass the protection rule. For example, when 
targetisREQUEST_COOKIE_NAMES, the list may include names of cookies to exclude from the protection rule. When the target isARGS, the list may include strings of URL query parameters and values from form-urlencoded XML, JSON, AMP, or POST payloads to exclude from the protection rule.Exclusionsproperties must not contain whitespace, comma or |. Note: If protection rules have been enabled that utilize themaxArgumentCountormaxTotalNameLengthOfArgumentsproperties, and thetargetproperty has been set toARGS, it is important that theexclusionsproperties be defined to honor those protection rule settings in a consistent manner. - Target string
 - The target of the exclusion.
 
- Exclusions []string
 - An array of The target property of a request that would allow it to bypass the protection rule. For example, when 
targetisREQUEST_COOKIE_NAMES, the list may include names of cookies to exclude from the protection rule. When the target isARGS, the list may include strings of URL query parameters and values from form-urlencoded XML, JSON, AMP, or POST payloads to exclude from the protection rule.Exclusionsproperties must not contain whitespace, comma or |. Note: If protection rules have been enabled that utilize themaxArgumentCountormaxTotalNameLengthOfArgumentsproperties, and thetargetproperty has been set toARGS, it is important that theexclusionsproperties be defined to honor those protection rule settings in a consistent manner. - Target string
 - The target of the exclusion.
 
- exclusions List<String>
 - An array of The target property of a request that would allow it to bypass the protection rule. For example, when 
targetisREQUEST_COOKIE_NAMES, the list may include names of cookies to exclude from the protection rule. When the target isARGS, the list may include strings of URL query parameters and values from form-urlencoded XML, JSON, AMP, or POST payloads to exclude from the protection rule.Exclusionsproperties must not contain whitespace, comma or |. Note: If protection rules have been enabled that utilize themaxArgumentCountormaxTotalNameLengthOfArgumentsproperties, and thetargetproperty has been set toARGS, it is important that theexclusionsproperties be defined to honor those protection rule settings in a consistent manner. - target String
 - The target of the exclusion.
 
- exclusions string[]
 - An array of The target property of a request that would allow it to bypass the protection rule. For example, when 
targetisREQUEST_COOKIE_NAMES, the list may include names of cookies to exclude from the protection rule. When the target isARGS, the list may include strings of URL query parameters and values from form-urlencoded XML, JSON, AMP, or POST payloads to exclude from the protection rule.Exclusionsproperties must not contain whitespace, comma or |. Note: If protection rules have been enabled that utilize themaxArgumentCountormaxTotalNameLengthOfArgumentsproperties, and thetargetproperty has been set toARGS, it is important that theexclusionsproperties be defined to honor those protection rule settings in a consistent manner. - target string
 - The target of the exclusion.
 
- exclusions Sequence[str]
 - An array of The target property of a request that would allow it to bypass the protection rule. For example, when 
targetisREQUEST_COOKIE_NAMES, the list may include names of cookies to exclude from the protection rule. When the target isARGS, the list may include strings of URL query parameters and values from form-urlencoded XML, JSON, AMP, or POST payloads to exclude from the protection rule.Exclusionsproperties must not contain whitespace, comma or |. Note: If protection rules have been enabled that utilize themaxArgumentCountormaxTotalNameLengthOfArgumentsproperties, and thetargetproperty has been set toARGS, it is important that theexclusionsproperties be defined to honor those protection rule settings in a consistent manner. - target str
 - The target of the exclusion.
 
- exclusions List<String>
 - An array of The target property of a request that would allow it to bypass the protection rule. For example, when 
targetisREQUEST_COOKIE_NAMES, the list may include names of cookies to exclude from the protection rule. When the target isARGS, the list may include strings of URL query parameters and values from form-urlencoded XML, JSON, AMP, or POST payloads to exclude from the protection rule.Exclusionsproperties must not contain whitespace, comma or |. Note: If protection rules have been enabled that utilize themaxArgumentCountormaxTotalNameLengthOfArgumentsproperties, and thetargetproperty has been set toARGS, it is important that theexclusionsproperties be defined to honor those protection rule settings in a consistent manner. - target String
 - The target of the exclusion.
 
Package Details
- Repository
 - oci pulumi/pulumi-oci
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
ociTerraform Provider.