Oracle Cloud Infrastructure

Pulumi Official
Package maintained by Pulumi
v0.1.1 published on Tuesday, May 3, 2022 by Pulumi

getProtectionRule

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

using Pulumi;
using Oci = Pulumi.Oci;

class MyStack : Stack
{
    public MyStack()
    {
        var testProtectionRule = Output.Create(Oci.Waas.GetProtectionRule.InvokeAsync(new Oci.Waas.GetProtectionRuleArgs
        {
            ProtectionRuleKey = @var.Protection_rule_protection_rule_key,
            WaasPolicyId = 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
	})
}

Coming soon!

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"])
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,
});

Coming soon!

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 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
https://github.com/pulumi/pulumi-oci
License
Apache-2.0
Notes

This Pulumi package is based on the oci Terraform Provider.