akamai.AppSecEvalRule
Scopes: Evaluation rule
Creates or modifies an evaluation rule’s action, conditions, and exceptions. Evaluation rules are Kona Rule Set rules used when running a security configuration in evaluation mode. Changes to these rules do not affect the rules used on your production network.
Related API Endpoints: /appsec/v1/configs/{configId}/versions/{versionNumber}/security-policies/{policyId}/eval-rules/{ruleId} and /appsec/v1/configs/{configId}/versions/{versionNumber}/security-policies/{policyId}/eval-rules/{ruleId}/condition-exception
Example Usage
Basic usage
using System.Collections.Generic;
using System.IO;
using Pulumi;
using Akamai = Pulumi.Akamai;
return await Deployment.RunAsync(() =>
{
var configuration = Akamai.GetAppSecConfiguration.Invoke(new()
{
Name = "Documentation",
});
var evalRule = new Akamai.AppSecEvalRule("evalRule", new()
{
ConfigId = configuration.Apply(getAppSecConfigurationResult => getAppSecConfigurationResult.ConfigId),
SecurityPolicyId = "gms1_134637",
RuleId = 60029316,
RuleAction = "deny",
ConditionException = File.ReadAllText($"{path.Module}/condition_exception.json"),
});
});
package main
import (
"fmt"
"io/ioutil"
"github.com/pulumi/pulumi-akamai/sdk/v4/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, &akamai.LookupAppSecConfigurationArgs{
Name: pulumi.StringRef("Documentation"),
}, nil)
if err != nil {
return err
}
_, err = akamai.NewAppSecEvalRule(ctx, "evalRule", &akamai.AppSecEvalRuleArgs{
ConfigId: *pulumi.Int(configuration.ConfigId),
SecurityPolicyId: pulumi.String("gms1_134637"),
RuleId: pulumi.Int(60029316),
RuleAction: pulumi.String("deny"),
ConditionException: readFileOrPanic(fmt.Sprintf("%v/condition_exception.json", path.Module)),
})
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.AppSecEvalRule;
import com.pulumi.akamai.AppSecEvalRuleArgs;
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 evalRule = new AppSecEvalRule("evalRule", AppSecEvalRuleArgs.builder()
.configId(configuration.applyValue(getAppSecConfigurationResult -> getAppSecConfigurationResult.configId()))
.securityPolicyId("gms1_134637")
.ruleId(60029316)
.ruleAction("deny")
.conditionException(Files.readString(Paths.get(String.format("%s/condition_exception.json", path.module()))))
.build());
}
}
import pulumi
import pulumi_akamai as akamai
configuration = akamai.get_app_sec_configuration(name="Documentation")
eval_rule = akamai.AppSecEvalRule("evalRule",
config_id=configuration.config_id,
security_policy_id="gms1_134637",
rule_id=60029316,
rule_action="deny",
condition_exception=(lambda path: open(path).read())(f"{path['module']}/condition_exception.json"))
import * as pulumi from "@pulumi/pulumi";
import * as akamai from "@pulumi/akamai";
import * as fs from "fs";
const configuration = akamai.getAppSecConfiguration({
name: "Documentation",
});
const evalRule = new akamai.AppSecEvalRule("evalRule", {
configId: configuration.then(configuration => configuration.configId),
securityPolicyId: "gms1_134637",
ruleId: 60029316,
ruleAction: "deny",
conditionException: fs.readFileSync(`${path.module}/condition_exception.json`),
});
resources:
evalRule:
type: akamai:AppSecEvalRule
properties:
configId: ${configuration.configId}
securityPolicyId: gms1_134637
ruleId: 6.0029316e+07
ruleAction: deny
conditionException:
fn::readFile: ${path.module}/condition_exception.json
variables:
configuration:
fn::invoke:
Function: akamai:getAppSecConfiguration
Arguments:
name: Documentation
Create AppSecEvalRule Resource
new AppSecEvalRule(name: string, args: AppSecEvalRuleArgs, opts?: CustomResourceOptions);
@overload
def AppSecEvalRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
condition_exception: Optional[str] = None,
config_id: Optional[int] = None,
rule_action: Optional[str] = None,
rule_id: Optional[int] = None,
security_policy_id: Optional[str] = None)
@overload
def AppSecEvalRule(resource_name: str,
args: AppSecEvalRuleArgs,
opts: Optional[ResourceOptions] = None)
func NewAppSecEvalRule(ctx *Context, name string, args AppSecEvalRuleArgs, opts ...ResourceOption) (*AppSecEvalRule, error)
public AppSecEvalRule(string name, AppSecEvalRuleArgs args, CustomResourceOptions? opts = null)
public AppSecEvalRule(String name, AppSecEvalRuleArgs args)
public AppSecEvalRule(String name, AppSecEvalRuleArgs args, CustomResourceOptions options)
type: akamai:AppSecEvalRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AppSecEvalRuleArgs
- 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 AppSecEvalRuleArgs
- 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 AppSecEvalRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AppSecEvalRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AppSecEvalRuleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
AppSecEvalRule 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 AppSecEvalRule resource accepts the following input properties:
- Config
Id int . Unique identifier of the security configuration in evaluation mode.
- Rule
Action string . Action to be taken any time the evaluation rule is triggered, 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.
- Rule
Id int . Unique identifier of the evaluation rule being modified.
- Security
Policy stringId . Unique identifier of the security policy associated with the evaluation process.
- Condition
Exception string . Path to a JSON file containing the conditions and exceptions to be applied to the evaluation rule.
- Config
Id int . Unique identifier of the security configuration in evaluation mode.
- Rule
Action string . Action to be taken any time the evaluation rule is triggered, 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.
- Rule
Id int . Unique identifier of the evaluation rule being modified.
- Security
Policy stringId . Unique identifier of the security policy associated with the evaluation process.
- Condition
Exception string . Path to a JSON file containing the conditions and exceptions to be applied to the evaluation rule.
- config
Id Integer . Unique identifier of the security configuration in evaluation mode.
- rule
Action String . Action to be taken any time the evaluation rule is triggered, 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.
- rule
Id Integer . Unique identifier of the evaluation rule being modified.
- security
Policy StringId . Unique identifier of the security policy associated with the evaluation process.
- condition
Exception String . Path to a JSON file containing the conditions and exceptions to be applied to the evaluation rule.
- config
Id number . Unique identifier of the security configuration in evaluation mode.
- rule
Action string . Action to be taken any time the evaluation rule is triggered, 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.
- rule
Id number . Unique identifier of the evaluation rule being modified.
- security
Policy stringId . Unique identifier of the security policy associated with the evaluation process.
- condition
Exception string . Path to a JSON file containing the conditions and exceptions to be applied to the evaluation rule.
- config_
id int . Unique identifier of the security configuration in evaluation mode.
- rule_
action str . Action to be taken any time the evaluation rule is triggered, 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.
- rule_
id int . Unique identifier of the evaluation rule being modified.
- security_
policy_ strid . Unique identifier of the security policy associated with the evaluation process.
- condition_
exception str . Path to a JSON file containing the conditions and exceptions to be applied to the evaluation rule.
- config
Id Number . Unique identifier of the security configuration in evaluation mode.
- rule
Action String . Action to be taken any time the evaluation rule is triggered, 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.
- rule
Id Number . Unique identifier of the evaluation rule being modified.
- security
Policy StringId . Unique identifier of the security policy associated with the evaluation process.
- condition
Exception String . Path to a JSON file containing the conditions and exceptions to be applied to the evaluation rule.
Outputs
All input properties are implicitly available as output properties. Additionally, the AppSecEvalRule 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 AppSecEvalRule Resource
Get an existing AppSecEvalRule 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?: AppSecEvalRuleState, opts?: CustomResourceOptions): AppSecEvalRule
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
condition_exception: Optional[str] = None,
config_id: Optional[int] = None,
rule_action: Optional[str] = None,
rule_id: Optional[int] = None,
security_policy_id: Optional[str] = None) -> AppSecEvalRule
func GetAppSecEvalRule(ctx *Context, name string, id IDInput, state *AppSecEvalRuleState, opts ...ResourceOption) (*AppSecEvalRule, error)
public static AppSecEvalRule Get(string name, Input<string> id, AppSecEvalRuleState? state, CustomResourceOptions? opts = null)
public static AppSecEvalRule get(String name, Output<String> id, AppSecEvalRuleState 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.
- Condition
Exception string . Path to a JSON file containing the conditions and exceptions to be applied to the evaluation rule.
- Config
Id int . Unique identifier of the security configuration in evaluation mode.
- Rule
Action string . Action to be taken any time the evaluation rule is triggered, 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.
- Rule
Id int . Unique identifier of the evaluation rule being modified.
- Security
Policy stringId . Unique identifier of the security policy associated with the evaluation process.
- Condition
Exception string . Path to a JSON file containing the conditions and exceptions to be applied to the evaluation rule.
- Config
Id int . Unique identifier of the security configuration in evaluation mode.
- Rule
Action string . Action to be taken any time the evaluation rule is triggered, 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.
- Rule
Id int . Unique identifier of the evaluation rule being modified.
- Security
Policy stringId . Unique identifier of the security policy associated with the evaluation process.
- condition
Exception String . Path to a JSON file containing the conditions and exceptions to be applied to the evaluation rule.
- config
Id Integer . Unique identifier of the security configuration in evaluation mode.
- rule
Action String . Action to be taken any time the evaluation rule is triggered, 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.
- rule
Id Integer . Unique identifier of the evaluation rule being modified.
- security
Policy StringId . Unique identifier of the security policy associated with the evaluation process.
- condition
Exception string . Path to a JSON file containing the conditions and exceptions to be applied to the evaluation rule.
- config
Id number . Unique identifier of the security configuration in evaluation mode.
- rule
Action string . Action to be taken any time the evaluation rule is triggered, 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.
- rule
Id number . Unique identifier of the evaluation rule being modified.
- security
Policy stringId . Unique identifier of the security policy associated with the evaluation process.
- condition_
exception str . Path to a JSON file containing the conditions and exceptions to be applied to the evaluation rule.
- config_
id int . Unique identifier of the security configuration in evaluation mode.
- rule_
action str . Action to be taken any time the evaluation rule is triggered, 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.
- rule_
id int . Unique identifier of the evaluation rule being modified.
- security_
policy_ strid . Unique identifier of the security policy associated with the evaluation process.
- condition
Exception String . Path to a JSON file containing the conditions and exceptions to be applied to the evaluation rule.
- config
Id Number . Unique identifier of the security configuration in evaluation mode.
- rule
Action String . Action to be taken any time the evaluation rule is triggered, 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.
- rule
Id Number . Unique identifier of the evaluation rule being modified.
- security
Policy StringId . Unique identifier of the security policy associated with the evaluation process.
Package Details
- Repository
- Akamai pulumi/pulumi-akamai
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
akamai
Terraform Provider.