/
assessmentPolicy.go
374 lines (319 loc) · 17.8 KB
/
assessmentPolicy.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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
// 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 securitycenter
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages the Security Center Assessment Metadata for Azure Security Center.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/securitycenter"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := securitycenter.NewAssessmentPolicy(ctx, "example", &securitycenter.AssessmentPolicyArgs{
// DisplayName: pulumi.String("Test Display Name"),
// Severity: pulumi.String("Medium"),
// Description: pulumi.String("Test Description"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Security Assessments Policy can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:securitycenter/assessmentPolicy:AssessmentPolicy example /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Security/assessmentMetadata/metadata1
// ```
type AssessmentPolicy struct {
pulumi.CustomResourceState
// A list of the categories of resource that is at risk when the Security Center Assessment is unhealthy. Possible values are `Unknown`, `Compute`, `Data`, `IdentityAndAccess`, `IoT` and `Networking`.
Categories pulumi.StringArrayOutput `pulumi:"categories"`
// The description of the Security Center Assessment.
Description pulumi.StringOutput `pulumi:"description"`
// The user-friendly display name of the Security Center Assessment.
DisplayName pulumi.StringOutput `pulumi:"displayName"`
// The implementation effort which is used to remediate the Security Center Assessment. Possible values are `Low`, `Moderate` and `High`.
ImplementationEffort pulumi.StringPtrOutput `pulumi:"implementationEffort"`
// The GUID as the name of the Security Center Assessment Policy.
Name pulumi.StringOutput `pulumi:"name"`
// The description which is used to mitigate the security issue.
RemediationDescription pulumi.StringPtrOutput `pulumi:"remediationDescription"`
// The severity level of the Security Center Assessment. Possible values are `Low`, `Medium` and `High`. Defaults to `Medium`.
Severity pulumi.StringPtrOutput `pulumi:"severity"`
// A list of the threat impacts for the Security Center Assessment. Possible values are `AccountBreach`, `DataExfiltration`, `DataSpillage`, `DenialOfService`, `ElevationOfPrivilege`, `MaliciousInsider`, `MissingCoverage` and `ThreatResistance`.
Threats pulumi.StringArrayOutput `pulumi:"threats"`
// The user impact of the Security Center Assessment. Possible values are `Low`, `Moderate` and `High`.
UserImpact pulumi.StringPtrOutput `pulumi:"userImpact"`
}
// NewAssessmentPolicy registers a new resource with the given unique name, arguments, and options.
func NewAssessmentPolicy(ctx *pulumi.Context,
name string, args *AssessmentPolicyArgs, opts ...pulumi.ResourceOption) (*AssessmentPolicy, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Description == nil {
return nil, errors.New("invalid value for required argument 'Description'")
}
if args.DisplayName == nil {
return nil, errors.New("invalid value for required argument 'DisplayName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource AssessmentPolicy
err := ctx.RegisterResource("azure:securitycenter/assessmentPolicy:AssessmentPolicy", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAssessmentPolicy gets an existing AssessmentPolicy resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetAssessmentPolicy(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AssessmentPolicyState, opts ...pulumi.ResourceOption) (*AssessmentPolicy, error) {
var resource AssessmentPolicy
err := ctx.ReadResource("azure:securitycenter/assessmentPolicy:AssessmentPolicy", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering AssessmentPolicy resources.
type assessmentPolicyState struct {
// A list of the categories of resource that is at risk when the Security Center Assessment is unhealthy. Possible values are `Unknown`, `Compute`, `Data`, `IdentityAndAccess`, `IoT` and `Networking`.
Categories []string `pulumi:"categories"`
// The description of the Security Center Assessment.
Description *string `pulumi:"description"`
// The user-friendly display name of the Security Center Assessment.
DisplayName *string `pulumi:"displayName"`
// The implementation effort which is used to remediate the Security Center Assessment. Possible values are `Low`, `Moderate` and `High`.
ImplementationEffort *string `pulumi:"implementationEffort"`
// The GUID as the name of the Security Center Assessment Policy.
Name *string `pulumi:"name"`
// The description which is used to mitigate the security issue.
RemediationDescription *string `pulumi:"remediationDescription"`
// The severity level of the Security Center Assessment. Possible values are `Low`, `Medium` and `High`. Defaults to `Medium`.
Severity *string `pulumi:"severity"`
// A list of the threat impacts for the Security Center Assessment. Possible values are `AccountBreach`, `DataExfiltration`, `DataSpillage`, `DenialOfService`, `ElevationOfPrivilege`, `MaliciousInsider`, `MissingCoverage` and `ThreatResistance`.
Threats []string `pulumi:"threats"`
// The user impact of the Security Center Assessment. Possible values are `Low`, `Moderate` and `High`.
UserImpact *string `pulumi:"userImpact"`
}
type AssessmentPolicyState struct {
// A list of the categories of resource that is at risk when the Security Center Assessment is unhealthy. Possible values are `Unknown`, `Compute`, `Data`, `IdentityAndAccess`, `IoT` and `Networking`.
Categories pulumi.StringArrayInput
// The description of the Security Center Assessment.
Description pulumi.StringPtrInput
// The user-friendly display name of the Security Center Assessment.
DisplayName pulumi.StringPtrInput
// The implementation effort which is used to remediate the Security Center Assessment. Possible values are `Low`, `Moderate` and `High`.
ImplementationEffort pulumi.StringPtrInput
// The GUID as the name of the Security Center Assessment Policy.
Name pulumi.StringPtrInput
// The description which is used to mitigate the security issue.
RemediationDescription pulumi.StringPtrInput
// The severity level of the Security Center Assessment. Possible values are `Low`, `Medium` and `High`. Defaults to `Medium`.
Severity pulumi.StringPtrInput
// A list of the threat impacts for the Security Center Assessment. Possible values are `AccountBreach`, `DataExfiltration`, `DataSpillage`, `DenialOfService`, `ElevationOfPrivilege`, `MaliciousInsider`, `MissingCoverage` and `ThreatResistance`.
Threats pulumi.StringArrayInput
// The user impact of the Security Center Assessment. Possible values are `Low`, `Moderate` and `High`.
UserImpact pulumi.StringPtrInput
}
func (AssessmentPolicyState) ElementType() reflect.Type {
return reflect.TypeOf((*assessmentPolicyState)(nil)).Elem()
}
type assessmentPolicyArgs struct {
// A list of the categories of resource that is at risk when the Security Center Assessment is unhealthy. Possible values are `Unknown`, `Compute`, `Data`, `IdentityAndAccess`, `IoT` and `Networking`.
Categories []string `pulumi:"categories"`
// The description of the Security Center Assessment.
Description string `pulumi:"description"`
// The user-friendly display name of the Security Center Assessment.
DisplayName string `pulumi:"displayName"`
// The implementation effort which is used to remediate the Security Center Assessment. Possible values are `Low`, `Moderate` and `High`.
ImplementationEffort *string `pulumi:"implementationEffort"`
// The description which is used to mitigate the security issue.
RemediationDescription *string `pulumi:"remediationDescription"`
// The severity level of the Security Center Assessment. Possible values are `Low`, `Medium` and `High`. Defaults to `Medium`.
Severity *string `pulumi:"severity"`
// A list of the threat impacts for the Security Center Assessment. Possible values are `AccountBreach`, `DataExfiltration`, `DataSpillage`, `DenialOfService`, `ElevationOfPrivilege`, `MaliciousInsider`, `MissingCoverage` and `ThreatResistance`.
Threats []string `pulumi:"threats"`
// The user impact of the Security Center Assessment. Possible values are `Low`, `Moderate` and `High`.
UserImpact *string `pulumi:"userImpact"`
}
// The set of arguments for constructing a AssessmentPolicy resource.
type AssessmentPolicyArgs struct {
// A list of the categories of resource that is at risk when the Security Center Assessment is unhealthy. Possible values are `Unknown`, `Compute`, `Data`, `IdentityAndAccess`, `IoT` and `Networking`.
Categories pulumi.StringArrayInput
// The description of the Security Center Assessment.
Description pulumi.StringInput
// The user-friendly display name of the Security Center Assessment.
DisplayName pulumi.StringInput
// The implementation effort which is used to remediate the Security Center Assessment. Possible values are `Low`, `Moderate` and `High`.
ImplementationEffort pulumi.StringPtrInput
// The description which is used to mitigate the security issue.
RemediationDescription pulumi.StringPtrInput
// The severity level of the Security Center Assessment. Possible values are `Low`, `Medium` and `High`. Defaults to `Medium`.
Severity pulumi.StringPtrInput
// A list of the threat impacts for the Security Center Assessment. Possible values are `AccountBreach`, `DataExfiltration`, `DataSpillage`, `DenialOfService`, `ElevationOfPrivilege`, `MaliciousInsider`, `MissingCoverage` and `ThreatResistance`.
Threats pulumi.StringArrayInput
// The user impact of the Security Center Assessment. Possible values are `Low`, `Moderate` and `High`.
UserImpact pulumi.StringPtrInput
}
func (AssessmentPolicyArgs) ElementType() reflect.Type {
return reflect.TypeOf((*assessmentPolicyArgs)(nil)).Elem()
}
type AssessmentPolicyInput interface {
pulumi.Input
ToAssessmentPolicyOutput() AssessmentPolicyOutput
ToAssessmentPolicyOutputWithContext(ctx context.Context) AssessmentPolicyOutput
}
func (*AssessmentPolicy) ElementType() reflect.Type {
return reflect.TypeOf((**AssessmentPolicy)(nil)).Elem()
}
func (i *AssessmentPolicy) ToAssessmentPolicyOutput() AssessmentPolicyOutput {
return i.ToAssessmentPolicyOutputWithContext(context.Background())
}
func (i *AssessmentPolicy) ToAssessmentPolicyOutputWithContext(ctx context.Context) AssessmentPolicyOutput {
return pulumi.ToOutputWithContext(ctx, i).(AssessmentPolicyOutput)
}
// AssessmentPolicyArrayInput is an input type that accepts AssessmentPolicyArray and AssessmentPolicyArrayOutput values.
// You can construct a concrete instance of `AssessmentPolicyArrayInput` via:
//
// AssessmentPolicyArray{ AssessmentPolicyArgs{...} }
type AssessmentPolicyArrayInput interface {
pulumi.Input
ToAssessmentPolicyArrayOutput() AssessmentPolicyArrayOutput
ToAssessmentPolicyArrayOutputWithContext(context.Context) AssessmentPolicyArrayOutput
}
type AssessmentPolicyArray []AssessmentPolicyInput
func (AssessmentPolicyArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AssessmentPolicy)(nil)).Elem()
}
func (i AssessmentPolicyArray) ToAssessmentPolicyArrayOutput() AssessmentPolicyArrayOutput {
return i.ToAssessmentPolicyArrayOutputWithContext(context.Background())
}
func (i AssessmentPolicyArray) ToAssessmentPolicyArrayOutputWithContext(ctx context.Context) AssessmentPolicyArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(AssessmentPolicyArrayOutput)
}
// AssessmentPolicyMapInput is an input type that accepts AssessmentPolicyMap and AssessmentPolicyMapOutput values.
// You can construct a concrete instance of `AssessmentPolicyMapInput` via:
//
// AssessmentPolicyMap{ "key": AssessmentPolicyArgs{...} }
type AssessmentPolicyMapInput interface {
pulumi.Input
ToAssessmentPolicyMapOutput() AssessmentPolicyMapOutput
ToAssessmentPolicyMapOutputWithContext(context.Context) AssessmentPolicyMapOutput
}
type AssessmentPolicyMap map[string]AssessmentPolicyInput
func (AssessmentPolicyMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AssessmentPolicy)(nil)).Elem()
}
func (i AssessmentPolicyMap) ToAssessmentPolicyMapOutput() AssessmentPolicyMapOutput {
return i.ToAssessmentPolicyMapOutputWithContext(context.Background())
}
func (i AssessmentPolicyMap) ToAssessmentPolicyMapOutputWithContext(ctx context.Context) AssessmentPolicyMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(AssessmentPolicyMapOutput)
}
type AssessmentPolicyOutput struct{ *pulumi.OutputState }
func (AssessmentPolicyOutput) ElementType() reflect.Type {
return reflect.TypeOf((**AssessmentPolicy)(nil)).Elem()
}
func (o AssessmentPolicyOutput) ToAssessmentPolicyOutput() AssessmentPolicyOutput {
return o
}
func (o AssessmentPolicyOutput) ToAssessmentPolicyOutputWithContext(ctx context.Context) AssessmentPolicyOutput {
return o
}
// A list of the categories of resource that is at risk when the Security Center Assessment is unhealthy. Possible values are `Unknown`, `Compute`, `Data`, `IdentityAndAccess`, `IoT` and `Networking`.
func (o AssessmentPolicyOutput) Categories() pulumi.StringArrayOutput {
return o.ApplyT(func(v *AssessmentPolicy) pulumi.StringArrayOutput { return v.Categories }).(pulumi.StringArrayOutput)
}
// The description of the Security Center Assessment.
func (o AssessmentPolicyOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v *AssessmentPolicy) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput)
}
// The user-friendly display name of the Security Center Assessment.
func (o AssessmentPolicyOutput) DisplayName() pulumi.StringOutput {
return o.ApplyT(func(v *AssessmentPolicy) pulumi.StringOutput { return v.DisplayName }).(pulumi.StringOutput)
}
// The implementation effort which is used to remediate the Security Center Assessment. Possible values are `Low`, `Moderate` and `High`.
func (o AssessmentPolicyOutput) ImplementationEffort() pulumi.StringPtrOutput {
return o.ApplyT(func(v *AssessmentPolicy) pulumi.StringPtrOutput { return v.ImplementationEffort }).(pulumi.StringPtrOutput)
}
// The GUID as the name of the Security Center Assessment Policy.
func (o AssessmentPolicyOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *AssessmentPolicy) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The description which is used to mitigate the security issue.
func (o AssessmentPolicyOutput) RemediationDescription() pulumi.StringPtrOutput {
return o.ApplyT(func(v *AssessmentPolicy) pulumi.StringPtrOutput { return v.RemediationDescription }).(pulumi.StringPtrOutput)
}
// The severity level of the Security Center Assessment. Possible values are `Low`, `Medium` and `High`. Defaults to `Medium`.
func (o AssessmentPolicyOutput) Severity() pulumi.StringPtrOutput {
return o.ApplyT(func(v *AssessmentPolicy) pulumi.StringPtrOutput { return v.Severity }).(pulumi.StringPtrOutput)
}
// A list of the threat impacts for the Security Center Assessment. Possible values are `AccountBreach`, `DataExfiltration`, `DataSpillage`, `DenialOfService`, `ElevationOfPrivilege`, `MaliciousInsider`, `MissingCoverage` and `ThreatResistance`.
func (o AssessmentPolicyOutput) Threats() pulumi.StringArrayOutput {
return o.ApplyT(func(v *AssessmentPolicy) pulumi.StringArrayOutput { return v.Threats }).(pulumi.StringArrayOutput)
}
// The user impact of the Security Center Assessment. Possible values are `Low`, `Moderate` and `High`.
func (o AssessmentPolicyOutput) UserImpact() pulumi.StringPtrOutput {
return o.ApplyT(func(v *AssessmentPolicy) pulumi.StringPtrOutput { return v.UserImpact }).(pulumi.StringPtrOutput)
}
type AssessmentPolicyArrayOutput struct{ *pulumi.OutputState }
func (AssessmentPolicyArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AssessmentPolicy)(nil)).Elem()
}
func (o AssessmentPolicyArrayOutput) ToAssessmentPolicyArrayOutput() AssessmentPolicyArrayOutput {
return o
}
func (o AssessmentPolicyArrayOutput) ToAssessmentPolicyArrayOutputWithContext(ctx context.Context) AssessmentPolicyArrayOutput {
return o
}
func (o AssessmentPolicyArrayOutput) Index(i pulumi.IntInput) AssessmentPolicyOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AssessmentPolicy {
return vs[0].([]*AssessmentPolicy)[vs[1].(int)]
}).(AssessmentPolicyOutput)
}
type AssessmentPolicyMapOutput struct{ *pulumi.OutputState }
func (AssessmentPolicyMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AssessmentPolicy)(nil)).Elem()
}
func (o AssessmentPolicyMapOutput) ToAssessmentPolicyMapOutput() AssessmentPolicyMapOutput {
return o
}
func (o AssessmentPolicyMapOutput) ToAssessmentPolicyMapOutputWithContext(ctx context.Context) AssessmentPolicyMapOutput {
return o
}
func (o AssessmentPolicyMapOutput) MapIndex(k pulumi.StringInput) AssessmentPolicyOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AssessmentPolicy {
return vs[0].(map[string]*AssessmentPolicy)[vs[1].(string)]
}).(AssessmentPolicyOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*AssessmentPolicyInput)(nil)).Elem(), &AssessmentPolicy{})
pulumi.RegisterInputType(reflect.TypeOf((*AssessmentPolicyArrayInput)(nil)).Elem(), AssessmentPolicyArray{})
pulumi.RegisterInputType(reflect.TypeOf((*AssessmentPolicyMapInput)(nil)).Elem(), AssessmentPolicyMap{})
pulumi.RegisterOutputType(AssessmentPolicyOutput{})
pulumi.RegisterOutputType(AssessmentPolicyArrayOutput{})
pulumi.RegisterOutputType(AssessmentPolicyMapOutput{})
}