1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Waas
  5. getProtectionRule
Oracle Cloud Infrastructure v1.32.0 published on Thursday, Apr 18, 2024 by Pulumi

oci.Waas.getProtectionRule

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v1.32.0 published on Thursday, Apr 18, 2024 by Pulumi

    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: _var.protection_rule_protection_rule_key,
        waasPolicyId: oci_waas_waas_policy.test_waas_policy.id,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_protection_rule = oci.Waas.get_protection_rule(protection_rule_key=var["protection_rule_protection_rule_key"],
        waas_policy_id=oci_waas_waas_policy["test_waas_policy"]["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/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: _var.Protection_rule_protection_rule_key,
    			WaasPolicyId:      oci_waas_waas_policy.Test_waas_policy.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 = @var.Protection_rule_protection_rule_key,
            WaasPolicyId = oci_waas_waas_policy.Test_waas_policy.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(var_.protection_rule_protection_rule_key())
                .waasPolicyId(oci_waas_waas_policy.test_waas_policy().id())
                .build());
    
        }
    }
    
    variables:
      testProtectionRule:
        fn::invoke:
          Function: oci:Waas:getProtectionRule
          Arguments:
            protectionRuleKey: ${var.protection_rule_protection_rule_key}
            waasPolicyId: ${oci_waas_waas_policy.test_waas_policy.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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:Waas/getProtectionRule:getProtectionRule
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ProtectionRuleKey string
    The protection rule key.
    WaasPolicyId string
    The OCID of the WAAS policy.
    ProtectionRuleKey string
    The protection rule key.
    WaasPolicyId string
    The OCID of the WAAS policy.
    protectionRuleKey String
    The protection rule key.
    waasPolicyId String
    The OCID of the WAAS policy.
    protectionRuleKey string
    The protection rule key.
    waasPolicyId string
    The OCID of the WAAS policy.
    protection_rule_key str
    The protection rule key.
    waas_policy_id str
    The OCID of the WAAS policy.
    protectionRuleKey String
    The protection rule key.
    waasPolicyId String
    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<GetProtectionRuleExclusion>
    An array of The target property of a request that would allow it to bypass the protection rule. For example, when target is REQUEST_COOKIE_NAMES, the list may include names of cookies to exclude from the protection rule. When the target is ARGS, 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. Exclusions properties must not contain whitespace, comma or |. Note: If protection rules have been enabled that utilize the maxArgumentCount or maxTotalNameLengthOfArguments properties, and the target property has been set to ARGS, it is important that the exclusions properties 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.
    ModSecurityRuleIds List<string>
    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.
    ProtectionRuleKey string
    WaasPolicyId string
    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 []GetProtectionRuleExclusion
    An array of The target property of a request that would allow it to bypass the protection rule. For example, when target is REQUEST_COOKIE_NAMES, the list may include names of cookies to exclude from the protection rule. When the target is ARGS, 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. Exclusions properties must not contain whitespace, comma or |. Note: If protection rules have been enabled that utilize the maxArgumentCount or maxTotalNameLengthOfArguments properties, and the target property has been set to ARGS, it is important that the exclusions properties 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.
    ModSecurityRuleIds []string
    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.
    ProtectionRuleKey string
    WaasPolicyId string
    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<GetProtectionRuleExclusion>
    An array of The target property of a request that would allow it to bypass the protection rule. For example, when target is REQUEST_COOKIE_NAMES, the list may include names of cookies to exclude from the protection rule. When the target is ARGS, 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. Exclusions properties must not contain whitespace, comma or |. Note: If protection rules have been enabled that utilize the maxArgumentCount or maxTotalNameLengthOfArguments properties, and the target property has been set to ARGS, it is important that the exclusions properties 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.
    modSecurityRuleIds List<String>
    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.
    protectionRuleKey String
    waasPolicyId String
    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 GetProtectionRuleExclusion[]
    An array of The target property of a request that would allow it to bypass the protection rule. For example, when target is REQUEST_COOKIE_NAMES, the list may include names of cookies to exclude from the protection rule. When the target is ARGS, 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. Exclusions properties must not contain whitespace, comma or |. Note: If protection rules have been enabled that utilize the maxArgumentCount or maxTotalNameLengthOfArguments properties, and the target property has been set to ARGS, it is important that the exclusions properties 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.
    modSecurityRuleIds string[]
    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.
    protectionRuleKey string
    waasPolicyId string
    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.GetProtectionRuleExclusion]
    An array of The target property of a request that would allow it to bypass the protection rule. For example, when target is REQUEST_COOKIE_NAMES, the list may include names of cookies to exclude from the protection rule. When the target is ARGS, 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. Exclusions properties must not contain whitespace, comma or |. Note: If protection rules have been enabled that utilize the maxArgumentCount or maxTotalNameLengthOfArguments properties, and the target property has been set to ARGS, it is important that the exclusions properties 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_rule_ids Sequence[str]
    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_key str
    waas_policy_id str
    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 target is REQUEST_COOKIE_NAMES, the list may include names of cookies to exclude from the protection rule. When the target is ARGS, 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. Exclusions properties must not contain whitespace, comma or |. Note: If protection rules have been enabled that utilize the maxArgumentCount or maxTotalNameLengthOfArguments properties, and the target property has been set to ARGS, it is important that the exclusions properties 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.
    modSecurityRuleIds List<String>
    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.
    protectionRuleKey String
    waasPolicyId String

    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 target is REQUEST_COOKIE_NAMES, the list may include names of cookies to exclude from the protection rule. When the target is ARGS, 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. Exclusions properties must not contain whitespace, comma or |. Note: If protection rules have been enabled that utilize the maxArgumentCount or maxTotalNameLengthOfArguments properties, and the target property has been set to ARGS, it is important that the exclusions properties 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 target is REQUEST_COOKIE_NAMES, the list may include names of cookies to exclude from the protection rule. When the target is ARGS, 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. Exclusions properties must not contain whitespace, comma or |. Note: If protection rules have been enabled that utilize the maxArgumentCount or maxTotalNameLengthOfArguments properties, and the target property has been set to ARGS, it is important that the exclusions properties 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 target is REQUEST_COOKIE_NAMES, the list may include names of cookies to exclude from the protection rule. When the target is ARGS, 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. Exclusions properties must not contain whitespace, comma or |. Note: If protection rules have been enabled that utilize the maxArgumentCount or maxTotalNameLengthOfArguments properties, and the target property has been set to ARGS, it is important that the exclusions properties 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 target is REQUEST_COOKIE_NAMES, the list may include names of cookies to exclude from the protection rule. When the target is ARGS, 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. Exclusions properties must not contain whitespace, comma or |. Note: If protection rules have been enabled that utilize the maxArgumentCount or maxTotalNameLengthOfArguments properties, and the target property has been set to ARGS, it is important that the exclusions properties 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 target is REQUEST_COOKIE_NAMES, the list may include names of cookies to exclude from the protection rule. When the target is ARGS, 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. Exclusions properties must not contain whitespace, comma or |. Note: If protection rules have been enabled that utilize the maxArgumentCount or maxTotalNameLengthOfArguments properties, and the target property has been set to ARGS, it is important that the exclusions properties 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 target is REQUEST_COOKIE_NAMES, the list may include names of cookies to exclude from the protection rule. When the target is ARGS, 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. Exclusions properties must not contain whitespace, comma or |. Note: If protection rules have been enabled that utilize the maxArgumentCount or maxTotalNameLengthOfArguments properties, and the target property has been set to ARGS, it is important that the exclusions properties 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 oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v1.32.0 published on Thursday, Apr 18, 2024 by Pulumi