akamai.AppsecAdvancedSettingsAttackPayloadLogging
Scopes: Security configuration; security policy
Enables, disables, or updates Attack Payload Logging settings.
By default, this operation is applied at the configuration level, which means that it is applied to all the security policies within that configuration.
However, by using the security_policy_id
parameter you can specify custom settings for an individual security policy.
Related API Endpoint: [/appsec/v1/configs/{configId}/versions/{versionNumber}/advanced-settings/logging/attack-payload]
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 attackPayloadLogging = new Akamai.AppsecAdvancedSettingsAttackPayloadLogging("attackPayloadLogging", new()
{
ConfigId = configuration.Apply(getAppSecConfigurationResult => getAppSecConfigurationResult.ConfigId),
AttackPayloadLogging = File.ReadAllText($"{path.Module}/attack-payload-logging.json"),
});
// USE CASE: User wants to configure Attack Payload Logging settings for a security policy.
var policyLogging = new Akamai.AppsecAdvancedSettingsAttackPayloadLogging("policyLogging", new()
{
ConfigId = configuration.Apply(getAppSecConfigurationResult => getAppSecConfigurationResult.ConfigId),
SecurityPolicyId = "gms1_134637",
AttackPayloadLogging = File.ReadAllText($"{path.Module}/attack-payload-logging.json"),
});
});
package main
import (
"fmt"
"os"
"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 := os.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.NewAppsecAdvancedSettingsAttackPayloadLogging(ctx, "attackPayloadLogging", &akamai.AppsecAdvancedSettingsAttackPayloadLoggingArgs{
ConfigId: *pulumi.Int(configuration.ConfigId),
AttackPayloadLogging: readFileOrPanic(fmt.Sprintf("%v/attack-payload-logging.json", path.Module)),
})
if err != nil {
return err
}
_, err = akamai.NewAppsecAdvancedSettingsAttackPayloadLogging(ctx, "policyLogging", &akamai.AppsecAdvancedSettingsAttackPayloadLoggingArgs{
ConfigId: *pulumi.Int(configuration.ConfigId),
SecurityPolicyId: pulumi.String("gms1_134637"),
AttackPayloadLogging: readFileOrPanic(fmt.Sprintf("%v/attack-payload-logging.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.AppsecAdvancedSettingsAttackPayloadLogging;
import com.pulumi.akamai.AppsecAdvancedSettingsAttackPayloadLoggingArgs;
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 attackPayloadLogging = new AppsecAdvancedSettingsAttackPayloadLogging("attackPayloadLogging", AppsecAdvancedSettingsAttackPayloadLoggingArgs.builder()
.configId(configuration.applyValue(getAppSecConfigurationResult -> getAppSecConfigurationResult.configId()))
.attackPayloadLogging(Files.readString(Paths.get(String.format("%s/attack-payload-logging.json", path.module()))))
.build());
var policyLogging = new AppsecAdvancedSettingsAttackPayloadLogging("policyLogging", AppsecAdvancedSettingsAttackPayloadLoggingArgs.builder()
.configId(configuration.applyValue(getAppSecConfigurationResult -> getAppSecConfigurationResult.configId()))
.securityPolicyId("gms1_134637")
.attackPayloadLogging(Files.readString(Paths.get(String.format("%s/attack-payload-logging.json", path.module()))))
.build());
}
}
import pulumi
import pulumi_akamai as akamai
configuration = akamai.get_app_sec_configuration(name="Documentation")
attack_payload_logging = akamai.AppsecAdvancedSettingsAttackPayloadLogging("attackPayloadLogging",
config_id=configuration.config_id,
attack_payload_logging=(lambda path: open(path).read())(f"{path['module']}/attack-payload-logging.json"))
# USE CASE: User wants to configure Attack Payload Logging settings for a security policy.
policy_logging = akamai.AppsecAdvancedSettingsAttackPayloadLogging("policyLogging",
config_id=configuration.config_id,
security_policy_id="gms1_134637",
attack_payload_logging=(lambda path: open(path).read())(f"{path['module']}/attack-payload-logging.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 attackPayloadLogging = new akamai.AppsecAdvancedSettingsAttackPayloadLogging("attackPayloadLogging", {
configId: configuration.then(configuration => configuration.configId),
attackPayloadLogging: fs.readFileSync(`${path.module}/attack-payload-logging.json`),
});
// USE CASE: User wants to configure Attack Payload Logging settings for a security policy.
const policyLogging = new akamai.AppsecAdvancedSettingsAttackPayloadLogging("policyLogging", {
configId: configuration.then(configuration => configuration.configId),
securityPolicyId: "gms1_134637",
attackPayloadLogging: fs.readFileSync(`${path.module}/attack-payload-logging.json`),
});
resources:
attackPayloadLogging: # USE CASE: User wants to configure Attack Payload Logging settings for a security policy.
type: akamai:AppsecAdvancedSettingsAttackPayloadLogging
properties:
configId: ${configuration.configId}
attackPayloadLogging:
fn::readFile: ${path.module}/attack-payload-logging.json
policyLogging:
type: akamai:AppsecAdvancedSettingsAttackPayloadLogging
properties:
configId: ${configuration.configId}
securityPolicyId: gms1_134637
attackPayloadLogging:
fn::readFile: ${path.module}/attack-payload-logging.json
variables:
configuration:
fn::invoke:
Function: akamai:getAppSecConfiguration
Arguments:
name: Documentation
Create AppsecAdvancedSettingsAttackPayloadLogging Resource
new AppsecAdvancedSettingsAttackPayloadLogging(name: string, args: AppsecAdvancedSettingsAttackPayloadLoggingArgs, opts?: CustomResourceOptions);
@overload
def AppsecAdvancedSettingsAttackPayloadLogging(resource_name: str,
opts: Optional[ResourceOptions] = None,
attack_payload_logging: Optional[str] = None,
config_id: Optional[int] = None,
security_policy_id: Optional[str] = None)
@overload
def AppsecAdvancedSettingsAttackPayloadLogging(resource_name: str,
args: AppsecAdvancedSettingsAttackPayloadLoggingArgs,
opts: Optional[ResourceOptions] = None)
func NewAppsecAdvancedSettingsAttackPayloadLogging(ctx *Context, name string, args AppsecAdvancedSettingsAttackPayloadLoggingArgs, opts ...ResourceOption) (*AppsecAdvancedSettingsAttackPayloadLogging, error)
public AppsecAdvancedSettingsAttackPayloadLogging(string name, AppsecAdvancedSettingsAttackPayloadLoggingArgs args, CustomResourceOptions? opts = null)
public AppsecAdvancedSettingsAttackPayloadLogging(String name, AppsecAdvancedSettingsAttackPayloadLoggingArgs args)
public AppsecAdvancedSettingsAttackPayloadLogging(String name, AppsecAdvancedSettingsAttackPayloadLoggingArgs args, CustomResourceOptions options)
type: akamai:AppsecAdvancedSettingsAttackPayloadLogging
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AppsecAdvancedSettingsAttackPayloadLoggingArgs
- 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 AppsecAdvancedSettingsAttackPayloadLoggingArgs
- 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 AppsecAdvancedSettingsAttackPayloadLoggingArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AppsecAdvancedSettingsAttackPayloadLoggingArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AppsecAdvancedSettingsAttackPayloadLoggingArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
AppsecAdvancedSettingsAttackPayloadLogging 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 AppsecAdvancedSettingsAttackPayloadLogging resource accepts the following input properties:
- Attack
Payload stringLogging . JSON representation of the Attack Payload Logging settings to be configured.
- Config
Id int . Unique identifier of the security configuration containing the Attack Payload Logging settings being modified.
- Security
Policy stringId . Unique identifier of the security policies whose settings are being modified. If not included, the Attack Payload Logging settings are modified at the configuration scope and, as a result, apply to all the security policies associated with the configuration.
- Attack
Payload stringLogging . JSON representation of the Attack Payload Logging settings to be configured.
- Config
Id int . Unique identifier of the security configuration containing the Attack Payload Logging settings being modified.
- Security
Policy stringId . Unique identifier of the security policies whose settings are being modified. If not included, the Attack Payload Logging settings are modified at the configuration scope and, as a result, apply to all the security policies associated with the configuration.
- attack
Payload StringLogging . JSON representation of the Attack Payload Logging settings to be configured.
- config
Id Integer . Unique identifier of the security configuration containing the Attack Payload Logging settings being modified.
- security
Policy StringId . Unique identifier of the security policies whose settings are being modified. If not included, the Attack Payload Logging settings are modified at the configuration scope and, as a result, apply to all the security policies associated with the configuration.
- attack
Payload stringLogging . JSON representation of the Attack Payload Logging settings to be configured.
- config
Id number . Unique identifier of the security configuration containing the Attack Payload Logging settings being modified.
- security
Policy stringId . Unique identifier of the security policies whose settings are being modified. If not included, the Attack Payload Logging settings are modified at the configuration scope and, as a result, apply to all the security policies associated with the configuration.
- attack_
payload_ strlogging . JSON representation of the Attack Payload Logging settings to be configured.
- config_
id int . Unique identifier of the security configuration containing the Attack Payload Logging settings being modified.
- security_
policy_ strid . Unique identifier of the security policies whose settings are being modified. If not included, the Attack Payload Logging settings are modified at the configuration scope and, as a result, apply to all the security policies associated with the configuration.
- attack
Payload StringLogging . JSON representation of the Attack Payload Logging settings to be configured.
- config
Id Number . Unique identifier of the security configuration containing the Attack Payload Logging settings being modified.
- security
Policy StringId . Unique identifier of the security policies whose settings are being modified. If not included, the Attack Payload Logging settings are modified at the configuration scope and, as a result, apply to all the security policies associated with the configuration.
Outputs
All input properties are implicitly available as output properties. Additionally, the AppsecAdvancedSettingsAttackPayloadLogging 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 AppsecAdvancedSettingsAttackPayloadLogging Resource
Get an existing AppsecAdvancedSettingsAttackPayloadLogging 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?: AppsecAdvancedSettingsAttackPayloadLoggingState, opts?: CustomResourceOptions): AppsecAdvancedSettingsAttackPayloadLogging
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
attack_payload_logging: Optional[str] = None,
config_id: Optional[int] = None,
security_policy_id: Optional[str] = None) -> AppsecAdvancedSettingsAttackPayloadLogging
func GetAppsecAdvancedSettingsAttackPayloadLogging(ctx *Context, name string, id IDInput, state *AppsecAdvancedSettingsAttackPayloadLoggingState, opts ...ResourceOption) (*AppsecAdvancedSettingsAttackPayloadLogging, error)
public static AppsecAdvancedSettingsAttackPayloadLogging Get(string name, Input<string> id, AppsecAdvancedSettingsAttackPayloadLoggingState? state, CustomResourceOptions? opts = null)
public static AppsecAdvancedSettingsAttackPayloadLogging get(String name, Output<String> id, AppsecAdvancedSettingsAttackPayloadLoggingState 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.
- Attack
Payload stringLogging . JSON representation of the Attack Payload Logging settings to be configured.
- Config
Id int . Unique identifier of the security configuration containing the Attack Payload Logging settings being modified.
- Security
Policy stringId . Unique identifier of the security policies whose settings are being modified. If not included, the Attack Payload Logging settings are modified at the configuration scope and, as a result, apply to all the security policies associated with the configuration.
- Attack
Payload stringLogging . JSON representation of the Attack Payload Logging settings to be configured.
- Config
Id int . Unique identifier of the security configuration containing the Attack Payload Logging settings being modified.
- Security
Policy stringId . Unique identifier of the security policies whose settings are being modified. If not included, the Attack Payload Logging settings are modified at the configuration scope and, as a result, apply to all the security policies associated with the configuration.
- attack
Payload StringLogging . JSON representation of the Attack Payload Logging settings to be configured.
- config
Id Integer . Unique identifier of the security configuration containing the Attack Payload Logging settings being modified.
- security
Policy StringId . Unique identifier of the security policies whose settings are being modified. If not included, the Attack Payload Logging settings are modified at the configuration scope and, as a result, apply to all the security policies associated with the configuration.
- attack
Payload stringLogging . JSON representation of the Attack Payload Logging settings to be configured.
- config
Id number . Unique identifier of the security configuration containing the Attack Payload Logging settings being modified.
- security
Policy stringId . Unique identifier of the security policies whose settings are being modified. If not included, the Attack Payload Logging settings are modified at the configuration scope and, as a result, apply to all the security policies associated with the configuration.
- attack_
payload_ strlogging . JSON representation of the Attack Payload Logging settings to be configured.
- config_
id int . Unique identifier of the security configuration containing the Attack Payload Logging settings being modified.
- security_
policy_ strid . Unique identifier of the security policies whose settings are being modified. If not included, the Attack Payload Logging settings are modified at the configuration scope and, as a result, apply to all the security policies associated with the configuration.
- attack
Payload StringLogging . JSON representation of the Attack Payload Logging settings to be configured.
- config
Id Number . Unique identifier of the security configuration containing the Attack Payload Logging settings being modified.
- security
Policy StringId . Unique identifier of the security policies whose settings are being modified. If not included, the Attack Payload Logging settings are modified at the configuration scope and, as a result, apply to all the security policies associated with the configuration.
Package Details
- Repository
- Akamai pulumi/pulumi-akamai
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
akamai
Terraform Provider.