/
getAppSecAttackGroups.go
180 lines (158 loc) · 7.55 KB
/
getAppSecAttackGroups.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package akamai
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// **Scopes**: Security policy; attack group
//
// Returns the action and the condition-exception information for an attack group or set of attack groups. Attack groups are collections of Kona Rule Set rules used to streamline the management of website protections.
//
// **Related API Endpoint**: [/appsec/v1/configs/{configId}/versions/{versionNumber}/security-policies/{policyId}/attack-groups](https://techdocs.akamai.com/application-security/reference/get-policy-attack-groups)
//
// ## Example Usage
//
// Basic usage:
//
// ```go
// 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
// }
// attackGroup, err := akamai.GetAppSecAttackGroups(ctx, &GetAppSecAttackGroupsArgs{
// ConfigId: configuration.ConfigId,
// SecurityPolicyId: "gms1_134637",
// AttackGroup: pulumi.StringRef("SQL"),
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("attackGroupAction", attackGroup.AttackGroupAction)
// ctx.Export("conditionException", attackGroup.ConditionException)
// ctx.Export("json", attackGroup.Json)
// ctx.Export("outputText", attackGroup.OutputText)
// return nil
// })
// }
//
// ```
// ## Output Options
//
// The following options can be used to determine the information returned, and how that returned information is formatted:
//
// - `attackGroupAction`. Action taken anytime the attack group is triggered. This information is returned only when a single attack group is retrieved. Valid values are:
// - **alert**. The event is recorded.
// - **deny**. The request is blocked.
// - **deny_custom_{custom_deny_id}**. The action defined by the custom deny is taken.
// - **none**. No action is taken.
//
// - `conditionException`. Conditions and exceptions assigned to the attack group. This information is returned only when a single attack group is retrieved.
// - `json`. JSON-formatted list of the action and the condition-exception information for the attack group. This information is returned only when a single attack group is retrieved.
// - `outputText`. Tabular report showing the attack group's action as well as Boolean values indicating whether conditions and exceptions have been configured for the group.
func GetAppSecAttackGroups(ctx *pulumi.Context, args *GetAppSecAttackGroupsArgs, opts ...pulumi.InvokeOption) (*GetAppSecAttackGroupsResult, error) {
var rv GetAppSecAttackGroupsResult
err := ctx.Invoke("akamai:index/getAppSecAttackGroups:getAppSecAttackGroups", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getAppSecAttackGroups.
type GetAppSecAttackGroupsArgs struct {
// . Unique name of the attack group you want to return information for. If not included, information is returned for all your attack groups.
AttackGroup *string `pulumi:"attackGroup"`
// . Unique identifier of the security configuration associated with the attack group.
ConfigId int `pulumi:"configId"`
// . Unique identifier of the security policy associated with the attack group.
SecurityPolicyId string `pulumi:"securityPolicyId"`
}
// A collection of values returned by getAppSecAttackGroups.
type GetAppSecAttackGroupsResult struct {
AttackGroup *string `pulumi:"attackGroup"`
AttackGroupAction string `pulumi:"attackGroupAction"`
ConditionException string `pulumi:"conditionException"`
ConfigId int `pulumi:"configId"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
Json string `pulumi:"json"`
OutputText string `pulumi:"outputText"`
SecurityPolicyId string `pulumi:"securityPolicyId"`
}
func GetAppSecAttackGroupsOutput(ctx *pulumi.Context, args GetAppSecAttackGroupsOutputArgs, opts ...pulumi.InvokeOption) GetAppSecAttackGroupsResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetAppSecAttackGroupsResult, error) {
args := v.(GetAppSecAttackGroupsArgs)
r, err := GetAppSecAttackGroups(ctx, &args, opts...)
var s GetAppSecAttackGroupsResult
if r != nil {
s = *r
}
return s, err
}).(GetAppSecAttackGroupsResultOutput)
}
// A collection of arguments for invoking getAppSecAttackGroups.
type GetAppSecAttackGroupsOutputArgs struct {
// . Unique name of the attack group you want to return information for. If not included, information is returned for all your attack groups.
AttackGroup pulumi.StringPtrInput `pulumi:"attackGroup"`
// . Unique identifier of the security configuration associated with the attack group.
ConfigId pulumi.IntInput `pulumi:"configId"`
// . Unique identifier of the security policy associated with the attack group.
SecurityPolicyId pulumi.StringInput `pulumi:"securityPolicyId"`
}
func (GetAppSecAttackGroupsOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetAppSecAttackGroupsArgs)(nil)).Elem()
}
// A collection of values returned by getAppSecAttackGroups.
type GetAppSecAttackGroupsResultOutput struct{ *pulumi.OutputState }
func (GetAppSecAttackGroupsResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetAppSecAttackGroupsResult)(nil)).Elem()
}
func (o GetAppSecAttackGroupsResultOutput) ToGetAppSecAttackGroupsResultOutput() GetAppSecAttackGroupsResultOutput {
return o
}
func (o GetAppSecAttackGroupsResultOutput) ToGetAppSecAttackGroupsResultOutputWithContext(ctx context.Context) GetAppSecAttackGroupsResultOutput {
return o
}
func (o GetAppSecAttackGroupsResultOutput) AttackGroup() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetAppSecAttackGroupsResult) *string { return v.AttackGroup }).(pulumi.StringPtrOutput)
}
func (o GetAppSecAttackGroupsResultOutput) AttackGroupAction() pulumi.StringOutput {
return o.ApplyT(func(v GetAppSecAttackGroupsResult) string { return v.AttackGroupAction }).(pulumi.StringOutput)
}
func (o GetAppSecAttackGroupsResultOutput) ConditionException() pulumi.StringOutput {
return o.ApplyT(func(v GetAppSecAttackGroupsResult) string { return v.ConditionException }).(pulumi.StringOutput)
}
func (o GetAppSecAttackGroupsResultOutput) ConfigId() pulumi.IntOutput {
return o.ApplyT(func(v GetAppSecAttackGroupsResult) int { return v.ConfigId }).(pulumi.IntOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetAppSecAttackGroupsResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetAppSecAttackGroupsResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o GetAppSecAttackGroupsResultOutput) Json() pulumi.StringOutput {
return o.ApplyT(func(v GetAppSecAttackGroupsResult) string { return v.Json }).(pulumi.StringOutput)
}
func (o GetAppSecAttackGroupsResultOutput) OutputText() pulumi.StringOutput {
return o.ApplyT(func(v GetAppSecAttackGroupsResult) string { return v.OutputText }).(pulumi.StringOutput)
}
func (o GetAppSecAttackGroupsResultOutput) SecurityPolicyId() pulumi.StringOutput {
return o.ApplyT(func(v GetAppSecAttackGroupsResult) string { return v.SecurityPolicyId }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(GetAppSecAttackGroupsResultOutput{})
}