Akamai

v3.0.0 published on Monday, Jul 25, 2022 by Pulumi

AppSecPenaltyBox

Scopes: Security policy

Modifies the penalty box settings for a security policy. When the penalty box is enabled for a policy, clients that trigger a WAF Deny action are placed in the “penalty box”. There, the action you select for penalty box (either Alert or Deny ) continues to apply to any requests from that client for the next 10 minutes.

Related API Endpoint: /appsec/v1/configs/{configId}/versions/{versionNumber}/match-targets/sequence

Example Usage

using Pulumi;
using Akamai = Pulumi.Akamai;

class MyStack : Stack
{
    public MyStack()
    {
        var configuration = Output.Create(Akamai.GetAppSecConfiguration.InvokeAsync(new Akamai.GetAppSecConfigurationArgs
        {
            Name = "Documentation",
        }));
        var penaltyBox = new Akamai.AppSecPenaltyBox("penaltyBox", new Akamai.AppSecPenaltyBoxArgs
        {
            ConfigId = configuration.Apply(configuration => configuration.ConfigId),
            SecurityPolicyId = "gms1_134637",
            PenaltyBoxProtection = true,
            PenaltyBoxAction = "deny",
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-akamai/sdk/v3/go/akamai"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		configuration, err := akamai.LookupAppSecConfiguration(ctx, &GetAppSecConfigurationArgs{
			Name: pulumi.StringRef("Documentation"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = akamai.NewAppSecPenaltyBox(ctx, "penaltyBox", &akamai.AppSecPenaltyBoxArgs{
			ConfigId:             pulumi.Int(configuration.ConfigId),
			SecurityPolicyId:     pulumi.String("gms1_134637"),
			PenaltyBoxProtection: pulumi.Bool(true),
			PenaltyBoxAction:     pulumi.String("deny"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.akamai.AkamaiFunctions;
import com.pulumi.akamai.inputs.GetAppSecConfigurationArgs;
import com.pulumi.akamai.AppSecPenaltyBox;
import com.pulumi.akamai.AppSecPenaltyBoxArgs;
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 configuration = AkamaiFunctions.getAppSecConfiguration(GetAppSecConfigurationArgs.builder()
            .name("Documentation")
            .build());

        var penaltyBox = new AppSecPenaltyBox("penaltyBox", AppSecPenaltyBoxArgs.builder()        
            .configId(configuration.applyValue(getAppSecConfigurationResult -> getAppSecConfigurationResult.configId()))
            .securityPolicyId("gms1_134637")
            .penaltyBoxProtection(true)
            .penaltyBoxAction("deny")
            .build());

    }
}
import pulumi
import pulumi_akamai as akamai

configuration = akamai.get_app_sec_configuration(name="Documentation")
penalty_box = akamai.AppSecPenaltyBox("penaltyBox",
    config_id=configuration.config_id,
    security_policy_id="gms1_134637",
    penalty_box_protection=True,
    penalty_box_action="deny")
import * as pulumi from "@pulumi/pulumi";
import * as akamai from "@pulumi/akamai";

const configuration = akamai.getAppSecConfiguration({
    name: "Documentation",
});
const penaltyBox = new akamai.AppSecPenaltyBox("penaltyBox", {
    configId: configuration.then(configuration => configuration.configId),
    securityPolicyId: "gms1_134637",
    penaltyBoxProtection: true,
    penaltyBoxAction: "deny",
});
resources:
  penaltyBox:
    type: akamai:AppSecPenaltyBox
    properties:
      configId: ${configuration.configId}
      securityPolicyId: gms1_134637
      penaltyBoxProtection: true
      penaltyBoxAction: deny
variables:
  configuration:
    Fn::Invoke:
      Function: akamai:getAppSecConfiguration
      Arguments:
        name: Documentation

Create a AppSecPenaltyBox Resource

new AppSecPenaltyBox(name: string, args: AppSecPenaltyBoxArgs, opts?: CustomResourceOptions);
@overload
def AppSecPenaltyBox(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     config_id: Optional[int] = None,
                     penalty_box_action: Optional[str] = None,
                     penalty_box_protection: Optional[bool] = None,
                     security_policy_id: Optional[str] = None)
@overload
def AppSecPenaltyBox(resource_name: str,
                     args: AppSecPenaltyBoxArgs,
                     opts: Optional[ResourceOptions] = None)
func NewAppSecPenaltyBox(ctx *Context, name string, args AppSecPenaltyBoxArgs, opts ...ResourceOption) (*AppSecPenaltyBox, error)
public AppSecPenaltyBox(string name, AppSecPenaltyBoxArgs args, CustomResourceOptions? opts = null)
public AppSecPenaltyBox(String name, AppSecPenaltyBoxArgs args)
public AppSecPenaltyBox(String name, AppSecPenaltyBoxArgs args, CustomResourceOptions options)
type: akamai:AppSecPenaltyBox
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args AppSecPenaltyBoxArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args AppSecPenaltyBoxArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args AppSecPenaltyBoxArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args AppSecPenaltyBoxArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args AppSecPenaltyBoxArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

AppSecPenaltyBox Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The AppSecPenaltyBox resource accepts the following input properties:

ConfigId int

. Unique identifier of the security configuration associated with the penalty box settings being modified.

PenaltyBoxAction string

. Action taken any time penalty box protection is triggered. Allowed values are:

  • alert. Record the event.
  • deny. Block the request.
  • **deny_custom_{custom_deny_id}**. Take the action specified by the custom deny.
  • none. Take no action.
PenaltyBoxProtection bool

. Set to true to enable penalty box protection; set to false to disable penalty box protection.

SecurityPolicyId string

. Unique identifier of the security policy associated with the penalty box settings being modified.

ConfigId int

. Unique identifier of the security configuration associated with the penalty box settings being modified.

PenaltyBoxAction string

. Action taken any time penalty box protection is triggered. Allowed values are:

  • alert. Record the event.
  • deny. Block the request.
  • **deny_custom_{custom_deny_id}**. Take the action specified by the custom deny.
  • none. Take no action.
PenaltyBoxProtection bool

. Set to true to enable penalty box protection; set to false to disable penalty box protection.

SecurityPolicyId string

. Unique identifier of the security policy associated with the penalty box settings being modified.

configId Integer

. Unique identifier of the security configuration associated with the penalty box settings being modified.

penaltyBoxAction String

. Action taken any time penalty box protection is triggered. Allowed values are:

  • alert. Record the event.
  • deny. Block the request.
  • **deny_custom_{custom_deny_id}**. Take the action specified by the custom deny.
  • none. Take no action.
penaltyBoxProtection Boolean

. Set to true to enable penalty box protection; set to false to disable penalty box protection.

securityPolicyId String

. Unique identifier of the security policy associated with the penalty box settings being modified.

configId number

. Unique identifier of the security configuration associated with the penalty box settings being modified.

penaltyBoxAction string

. Action taken any time penalty box protection is triggered. Allowed values are:

  • alert. Record the event.
  • deny. Block the request.
  • **deny_custom_{custom_deny_id}**. Take the action specified by the custom deny.
  • none. Take no action.
penaltyBoxProtection boolean

. Set to true to enable penalty box protection; set to false to disable penalty box protection.

securityPolicyId string

. Unique identifier of the security policy associated with the penalty box settings being modified.

config_id int

. Unique identifier of the security configuration associated with the penalty box settings being modified.

penalty_box_action str

. Action taken any time penalty box protection is triggered. Allowed values are:

  • alert. Record the event.
  • deny. Block the request.
  • **deny_custom_{custom_deny_id}**. Take the action specified by the custom deny.
  • none. Take no action.
penalty_box_protection bool

. Set to true to enable penalty box protection; set to false to disable penalty box protection.

security_policy_id str

. Unique identifier of the security policy associated with the penalty box settings being modified.

configId Number

. Unique identifier of the security configuration associated with the penalty box settings being modified.

penaltyBoxAction String

. Action taken any time penalty box protection is triggered. Allowed values are:

  • alert. Record the event.
  • deny. Block the request.
  • **deny_custom_{custom_deny_id}**. Take the action specified by the custom deny.
  • none. Take no action.
penaltyBoxProtection Boolean

. Set to true to enable penalty box protection; set to false to disable penalty box protection.

securityPolicyId String

. Unique identifier of the security policy associated with the penalty box settings being modified.

Outputs

All input properties are implicitly available as output properties. Additionally, the AppSecPenaltyBox resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up an Existing AppSecPenaltyBox Resource

Get an existing AppSecPenaltyBox resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: AppSecPenaltyBoxState, opts?: CustomResourceOptions): AppSecPenaltyBox
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        config_id: Optional[int] = None,
        penalty_box_action: Optional[str] = None,
        penalty_box_protection: Optional[bool] = None,
        security_policy_id: Optional[str] = None) -> AppSecPenaltyBox
func GetAppSecPenaltyBox(ctx *Context, name string, id IDInput, state *AppSecPenaltyBoxState, opts ...ResourceOption) (*AppSecPenaltyBox, error)
public static AppSecPenaltyBox Get(string name, Input<string> id, AppSecPenaltyBoxState? state, CustomResourceOptions? opts = null)
public static AppSecPenaltyBox get(String name, Output<String> id, AppSecPenaltyBoxState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
ConfigId int

. Unique identifier of the security configuration associated with the penalty box settings being modified.

PenaltyBoxAction string

. Action taken any time penalty box protection is triggered. Allowed values are:

  • alert. Record the event.
  • deny. Block the request.
  • **deny_custom_{custom_deny_id}**. Take the action specified by the custom deny.
  • none. Take no action.
PenaltyBoxProtection bool

. Set to true to enable penalty box protection; set to false to disable penalty box protection.

SecurityPolicyId string

. Unique identifier of the security policy associated with the penalty box settings being modified.

ConfigId int

. Unique identifier of the security configuration associated with the penalty box settings being modified.

PenaltyBoxAction string

. Action taken any time penalty box protection is triggered. Allowed values are:

  • alert. Record the event.
  • deny. Block the request.
  • **deny_custom_{custom_deny_id}**. Take the action specified by the custom deny.
  • none. Take no action.
PenaltyBoxProtection bool

. Set to true to enable penalty box protection; set to false to disable penalty box protection.

SecurityPolicyId string

. Unique identifier of the security policy associated with the penalty box settings being modified.

configId Integer

. Unique identifier of the security configuration associated with the penalty box settings being modified.

penaltyBoxAction String

. Action taken any time penalty box protection is triggered. Allowed values are:

  • alert. Record the event.
  • deny. Block the request.
  • **deny_custom_{custom_deny_id}**. Take the action specified by the custom deny.
  • none. Take no action.
penaltyBoxProtection Boolean

. Set to true to enable penalty box protection; set to false to disable penalty box protection.

securityPolicyId String

. Unique identifier of the security policy associated with the penalty box settings being modified.

configId number

. Unique identifier of the security configuration associated with the penalty box settings being modified.

penaltyBoxAction string

. Action taken any time penalty box protection is triggered. Allowed values are:

  • alert. Record the event.
  • deny. Block the request.
  • **deny_custom_{custom_deny_id}**. Take the action specified by the custom deny.
  • none. Take no action.
penaltyBoxProtection boolean

. Set to true to enable penalty box protection; set to false to disable penalty box protection.

securityPolicyId string

. Unique identifier of the security policy associated with the penalty box settings being modified.

config_id int

. Unique identifier of the security configuration associated with the penalty box settings being modified.

penalty_box_action str

. Action taken any time penalty box protection is triggered. Allowed values are:

  • alert. Record the event.
  • deny. Block the request.
  • **deny_custom_{custom_deny_id}**. Take the action specified by the custom deny.
  • none. Take no action.
penalty_box_protection bool

. Set to true to enable penalty box protection; set to false to disable penalty box protection.

security_policy_id str

. Unique identifier of the security policy associated with the penalty box settings being modified.

configId Number

. Unique identifier of the security configuration associated with the penalty box settings being modified.

penaltyBoxAction String

. Action taken any time penalty box protection is triggered. Allowed values are:

  • alert. Record the event.
  • deny. Block the request.
  • **deny_custom_{custom_deny_id}**. Take the action specified by the custom deny.
  • none. Take no action.
penaltyBoxProtection Boolean

. Set to true to enable penalty box protection; set to false to disable penalty box protection.

securityPolicyId String

. Unique identifier of the security policy associated with the penalty box settings being modified.

Package Details

Repository
https://github.com/pulumi/pulumi-akamai
License
Apache-2.0
Notes

This Pulumi package is based on the akamai Terraform Provider.