Akamai

v3.1.1 published on Tuesday, Nov 1, 2022 by Pulumi

AppSecMalwarePolicyAction

Scopes: Malware protection

Creates, modifies, or deletes the actions associated with a malware policy. By default, malware policies take no action when triggered. Note that you must set separate actions for requests that are scanned according to the specified malware policy and those that are unscanned.

Example Usage

Basic usage

using System.IO;
using Pulumi;
using Akamai = Pulumi.Akamai;

class MyStack : Stack
{
    public MyStack()
    {
        var configuration = Output.Create(Akamai.GetAppSecConfiguration.InvokeAsync(new Akamai.GetAppSecConfigurationArgs
        {
            Name = "Documentation",
        }));
        var appsecMalwarePolicy = new Akamai.AppSecMalwarePolicy("appsecMalwarePolicy", new Akamai.AppSecMalwarePolicyArgs
        {
            ConfigId = configuration.Apply(configuration => configuration.ConfigId),
            MalwarePolicy = File.ReadAllText($"{path.Module}/malware_policy.json"),
        });
        var appsecMalwarePolicyAction = new Akamai.AppSecMalwarePolicyAction("appsecMalwarePolicyAction", new Akamai.AppSecMalwarePolicyActionArgs
        {
            ConfigId = configuration.Apply(configuration => configuration.ConfigId),
            SecurityPolicyId = "gms1_134637",
            MalwarePolicyId = appsecMalwarePolicy.MalwarePolicyId,
            Action = "deny",
            UnscannedAction = "deny",
        });
    }

}
package main

import (
	"fmt"
	"io/ioutil"

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

func readFileOrPanic(path string) pulumi.StringPtrInput {
	data, err := ioutil.ReadFile(path)
	if err != nil {
		panic(err.Error())
	}
	return pulumi.String(string(data))
}

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
		}
		appsecMalwarePolicy, err := akamai.NewAppSecMalwarePolicy(ctx, "appsecMalwarePolicy", &akamai.AppSecMalwarePolicyArgs{
			ConfigId:      pulumi.Int(configuration.ConfigId),
			MalwarePolicy: readFileOrPanic(fmt.Sprintf("%v/malware_policy.json", path.Module)),
		})
		if err != nil {
			return err
		}
		_, err = akamai.NewAppSecMalwarePolicyAction(ctx, "appsecMalwarePolicyAction", &akamai.AppSecMalwarePolicyActionArgs{
			ConfigId:         pulumi.Int(configuration.ConfigId),
			SecurityPolicyId: pulumi.String("gms1_134637"),
			MalwarePolicyId:  appsecMalwarePolicy.MalwarePolicyId,
			Action:           pulumi.String("deny"),
			UnscannedAction:  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.AppSecMalwarePolicy;
import com.pulumi.akamai.AppSecMalwarePolicyArgs;
import com.pulumi.akamai.AppSecMalwarePolicyAction;
import com.pulumi.akamai.AppSecMalwarePolicyActionArgs;
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 appsecMalwarePolicy = new AppSecMalwarePolicy("appsecMalwarePolicy", AppSecMalwarePolicyArgs.builder()        
            .configId(configuration.applyValue(getAppSecConfigurationResult -> getAppSecConfigurationResult.configId()))
            .malwarePolicy(Files.readString(Paths.get(String.format("%s/malware_policy.json", path.module()))))
            .build());

        var appsecMalwarePolicyAction = new AppSecMalwarePolicyAction("appsecMalwarePolicyAction", AppSecMalwarePolicyActionArgs.builder()        
            .configId(configuration.applyValue(getAppSecConfigurationResult -> getAppSecConfigurationResult.configId()))
            .securityPolicyId("gms1_134637")
            .malwarePolicyId(appsecMalwarePolicy.malwarePolicyId())
            .action("deny")
            .unscannedAction("deny")
            .build());

    }
}
import pulumi
import pulumi_akamai as akamai

configuration = akamai.get_app_sec_configuration(name="Documentation")
appsec_malware_policy = akamai.AppSecMalwarePolicy("appsecMalwarePolicy",
    config_id=configuration.config_id,
    malware_policy=(lambda path: open(path).read())(f"{path['module']}/malware_policy.json"))
appsec_malware_policy_action = akamai.AppSecMalwarePolicyAction("appsecMalwarePolicyAction",
    config_id=configuration.config_id,
    security_policy_id="gms1_134637",
    malware_policy_id=appsec_malware_policy.malware_policy_id,
    action="deny",
    unscanned_action="deny")
import * as pulumi from "@pulumi/pulumi";
import * as akamai from "@pulumi/akamai";
import * as fs from "fs";

const configuration = akamai.getAppSecConfiguration({
    name: "Documentation",
});
const appsecMalwarePolicy = new akamai.AppSecMalwarePolicy("appsecMalwarePolicy", {
    configId: configuration.then(configuration => configuration.configId),
    malwarePolicy: fs.readFileSync(`${path.module}/malware_policy.json`),
});
const appsecMalwarePolicyAction = new akamai.AppSecMalwarePolicyAction("appsecMalwarePolicyAction", {
    configId: configuration.then(configuration => configuration.configId),
    securityPolicyId: "gms1_134637",
    malwarePolicyId: appsecMalwarePolicy.malwarePolicyId,
    action: "deny",
    unscannedAction: "deny",
});

Coming soon!

Create AppSecMalwarePolicyAction Resource

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

name string
The unique name of the resource.
args AppSecMalwarePolicyActionArgs
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 AppSecMalwarePolicyActionArgs
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 AppSecMalwarePolicyActionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args AppSecMalwarePolicyActionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args AppSecMalwarePolicyActionArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

AppSecMalwarePolicyAction 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 AppSecMalwarePolicyAction resource accepts the following input properties:

Action string

. Action to be taken for requests scanned according to the given malware policy. Allowed actions 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.
ConfigId int

. Unique identifier of the security configuration associated with the malware policy action being modified.

MalwarePolicyId int

. Unique identifier of the malware policy whose action is being modified.

SecurityPolicyId string

. Unique identifier of the security policy associated with the malware policy whose action is being modified.

UnscannedAction string

. Action to be taken for requests not scanned according to the given malware policy. Allowed actions are:

  • alert. Record the event.
  • deny. Block the request.
  • deny_custom{custom_deny_id}. Take the action specified by the custom deny.
Action string

. Action to be taken for requests scanned according to the given malware policy. Allowed actions 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.
ConfigId int

. Unique identifier of the security configuration associated with the malware policy action being modified.

MalwarePolicyId int

. Unique identifier of the malware policy whose action is being modified.

SecurityPolicyId string

. Unique identifier of the security policy associated with the malware policy whose action is being modified.

UnscannedAction string

. Action to be taken for requests not scanned according to the given malware policy. Allowed actions are:

  • alert. Record the event.
  • deny. Block the request.
  • deny_custom{custom_deny_id}. Take the action specified by the custom deny.
action String

. Action to be taken for requests scanned according to the given malware policy. Allowed actions 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.
configId Integer

. Unique identifier of the security configuration associated with the malware policy action being modified.

malwarePolicyId Integer

. Unique identifier of the malware policy whose action is being modified.

securityPolicyId String

. Unique identifier of the security policy associated with the malware policy whose action is being modified.

unscannedAction String

. Action to be taken for requests not scanned according to the given malware policy. Allowed actions are:

  • alert. Record the event.
  • deny. Block the request.
  • deny_custom{custom_deny_id}. Take the action specified by the custom deny.
action string

. Action to be taken for requests scanned according to the given malware policy. Allowed actions 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.
configId number

. Unique identifier of the security configuration associated with the malware policy action being modified.

malwarePolicyId number

. Unique identifier of the malware policy whose action is being modified.

securityPolicyId string

. Unique identifier of the security policy associated with the malware policy whose action is being modified.

unscannedAction string

. Action to be taken for requests not scanned according to the given malware policy. Allowed actions are:

  • alert. Record the event.
  • deny. Block the request.
  • deny_custom{custom_deny_id}. Take the action specified by the custom deny.
action str

. Action to be taken for requests scanned according to the given malware policy. Allowed actions 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.
config_id int

. Unique identifier of the security configuration associated with the malware policy action being modified.

malware_policy_id int

. Unique identifier of the malware policy whose action is being modified.

security_policy_id str

. Unique identifier of the security policy associated with the malware policy whose action is being modified.

unscanned_action str

. Action to be taken for requests not scanned according to the given malware policy. Allowed actions are:

  • alert. Record the event.
  • deny. Block the request.
  • deny_custom{custom_deny_id}. Take the action specified by the custom deny.
action String

. Action to be taken for requests scanned according to the given malware policy. Allowed actions 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.
configId Number

. Unique identifier of the security configuration associated with the malware policy action being modified.

malwarePolicyId Number

. Unique identifier of the malware policy whose action is being modified.

securityPolicyId String

. Unique identifier of the security policy associated with the malware policy whose action is being modified.

unscannedAction String

. Action to be taken for requests not scanned according to the given malware policy. Allowed actions are:

  • alert. Record the event.
  • deny. Block the request.
  • deny_custom{custom_deny_id}. Take the action specified by the custom deny.

Outputs

All input properties are implicitly available as output properties. Additionally, the AppSecMalwarePolicyAction 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 Existing AppSecMalwarePolicyAction Resource

Get an existing AppSecMalwarePolicyAction 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?: AppSecMalwarePolicyActionState, opts?: CustomResourceOptions): AppSecMalwarePolicyAction
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        action: Optional[str] = None,
        config_id: Optional[int] = None,
        malware_policy_id: Optional[int] = None,
        security_policy_id: Optional[str] = None,
        unscanned_action: Optional[str] = None) -> AppSecMalwarePolicyAction
func GetAppSecMalwarePolicyAction(ctx *Context, name string, id IDInput, state *AppSecMalwarePolicyActionState, opts ...ResourceOption) (*AppSecMalwarePolicyAction, error)
public static AppSecMalwarePolicyAction Get(string name, Input<string> id, AppSecMalwarePolicyActionState? state, CustomResourceOptions? opts = null)
public static AppSecMalwarePolicyAction get(String name, Output<String> id, AppSecMalwarePolicyActionState 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:
Action string

. Action to be taken for requests scanned according to the given malware policy. Allowed actions 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.
ConfigId int

. Unique identifier of the security configuration associated with the malware policy action being modified.

MalwarePolicyId int

. Unique identifier of the malware policy whose action is being modified.

SecurityPolicyId string

. Unique identifier of the security policy associated with the malware policy whose action is being modified.

UnscannedAction string

. Action to be taken for requests not scanned according to the given malware policy. Allowed actions are:

  • alert. Record the event.
  • deny. Block the request.
  • deny_custom{custom_deny_id}. Take the action specified by the custom deny.
Action string

. Action to be taken for requests scanned according to the given malware policy. Allowed actions 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.
ConfigId int

. Unique identifier of the security configuration associated with the malware policy action being modified.

MalwarePolicyId int

. Unique identifier of the malware policy whose action is being modified.

SecurityPolicyId string

. Unique identifier of the security policy associated with the malware policy whose action is being modified.

UnscannedAction string

. Action to be taken for requests not scanned according to the given malware policy. Allowed actions are:

  • alert. Record the event.
  • deny. Block the request.
  • deny_custom{custom_deny_id}. Take the action specified by the custom deny.
action String

. Action to be taken for requests scanned according to the given malware policy. Allowed actions 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.
configId Integer

. Unique identifier of the security configuration associated with the malware policy action being modified.

malwarePolicyId Integer

. Unique identifier of the malware policy whose action is being modified.

securityPolicyId String

. Unique identifier of the security policy associated with the malware policy whose action is being modified.

unscannedAction String

. Action to be taken for requests not scanned according to the given malware policy. Allowed actions are:

  • alert. Record the event.
  • deny. Block the request.
  • deny_custom{custom_deny_id}. Take the action specified by the custom deny.
action string

. Action to be taken for requests scanned according to the given malware policy. Allowed actions 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.
configId number

. Unique identifier of the security configuration associated with the malware policy action being modified.

malwarePolicyId number

. Unique identifier of the malware policy whose action is being modified.

securityPolicyId string

. Unique identifier of the security policy associated with the malware policy whose action is being modified.

unscannedAction string

. Action to be taken for requests not scanned according to the given malware policy. Allowed actions are:

  • alert. Record the event.
  • deny. Block the request.
  • deny_custom{custom_deny_id}. Take the action specified by the custom deny.
action str

. Action to be taken for requests scanned according to the given malware policy. Allowed actions 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.
config_id int

. Unique identifier of the security configuration associated with the malware policy action being modified.

malware_policy_id int

. Unique identifier of the malware policy whose action is being modified.

security_policy_id str

. Unique identifier of the security policy associated with the malware policy whose action is being modified.

unscanned_action str

. Action to be taken for requests not scanned according to the given malware policy. Allowed actions are:

  • alert. Record the event.
  • deny. Block the request.
  • deny_custom{custom_deny_id}. Take the action specified by the custom deny.
action String

. Action to be taken for requests scanned according to the given malware policy. Allowed actions 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.
configId Number

. Unique identifier of the security configuration associated with the malware policy action being modified.

malwarePolicyId Number

. Unique identifier of the malware policy whose action is being modified.

securityPolicyId String

. Unique identifier of the security policy associated with the malware policy whose action is being modified.

unscannedAction String

. Action to be taken for requests not scanned according to the given malware policy. Allowed actions are:

  • alert. Record the event.
  • deny. Block the request.
  • deny_custom{custom_deny_id}. Take the action specified by the custom deny.

Package Details

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

This Pulumi package is based on the akamai Terraform Provider.