/
alertRuleScheduled.go
662 lines (593 loc) · 40.6 KB
/
alertRuleScheduled.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
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
// 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 sentinel
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Sentinel Scheduled Alert Rule.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights"
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "example", &operationalinsights.AnalyticsWorkspaceArgs{
// Name: pulumi.String("example-workspace"),
// Location: example.Location,
// ResourceGroupName: example.Name,
// Sku: pulumi.String("PerGB2018"),
// })
// if err != nil {
// return err
// }
// exampleLogAnalyticsWorkspaceOnboarding, err := sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "example", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{
// WorkspaceId: exampleAnalyticsWorkspace.ID(),
// })
// if err != nil {
// return err
// }
// _, err = sentinel.NewAlertRuleScheduled(ctx, "example", &sentinel.AlertRuleScheduledArgs{
// Name: pulumi.String("example"),
// LogAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId,
// DisplayName: pulumi.String("example"),
// Severity: pulumi.String("High"),
// Query: pulumi.String("AzureActivity |\n where OperationName == \"Create or Update Virtual Machine\" or OperationName ==\"Create Deployment\" |\n where ActivityStatus == \"Succeeded\" |\n make-series dcount(ResourceId) default=0 on EventSubmissionTimestamp in range(ago(7d), now(), 1d) by Caller\n"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Sentinel Scheduled Alert Rules can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:sentinel/alertRuleScheduled:AlertRuleScheduled example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/alertRules/rule1
// ```
type AlertRuleScheduled struct {
pulumi.CustomResourceState
// An `alertDetailsOverride` block as defined below.
AlertDetailsOverrides AlertRuleScheduledAlertDetailsOverrideArrayOutput `pulumi:"alertDetailsOverrides"`
// The GUID of the alert rule template which is used for this Sentinel Scheduled Alert Rule. Changing this forces a new Sentinel Scheduled Alert Rule to be created.
AlertRuleTemplateGuid pulumi.StringPtrOutput `pulumi:"alertRuleTemplateGuid"`
// The version of the alert rule template which is used for this Sentinel Scheduled Alert Rule. Changing this forces a new Sentinel Scheduled Alert Rule to be created.
AlertRuleTemplateVersion pulumi.StringPtrOutput `pulumi:"alertRuleTemplateVersion"`
// A map of string key-value pairs of columns to be attached to this Sentinel Scheduled Alert Rule. The key will appear as the field name in alerts and the value is the event parameter you wish to surface in the alerts.
CustomDetails pulumi.StringMapOutput `pulumi:"customDetails"`
// The description of this Sentinel Scheduled Alert Rule.
Description pulumi.StringPtrOutput `pulumi:"description"`
// The friendly name of this Sentinel Scheduled Alert Rule.
DisplayName pulumi.StringOutput `pulumi:"displayName"`
// Should the Sentinel Scheduled Alert Rule be enabled? Defaults to `true`.
Enabled pulumi.BoolPtrOutput `pulumi:"enabled"`
// A list of `entityMapping` blocks as defined below.
EntityMappings AlertRuleScheduledEntityMappingArrayOutput `pulumi:"entityMappings"`
// A `eventGrouping` block as defined below.
EventGrouping AlertRuleScheduledEventGroupingPtrOutput `pulumi:"eventGrouping"`
// A `incidentConfiguration` block as defined below.
IncidentConfiguration AlertRuleScheduledIncidentConfigurationOutput `pulumi:"incidentConfiguration"`
// The ID of the Log Analytics Workspace this Sentinel Scheduled Alert Rule belongs to. Changing this forces a new Sentinel Scheduled Alert Rule to be created.
LogAnalyticsWorkspaceId pulumi.StringOutput `pulumi:"logAnalyticsWorkspaceId"`
// The name which should be used for this Sentinel Scheduled Alert Rule. Changing this forces a new Sentinel Scheduled Alert Rule to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The query of this Sentinel Scheduled Alert Rule.
Query pulumi.StringOutput `pulumi:"query"`
// The ISO 8601 timespan duration between two consecutive queries. Defaults to `PT5H`.
QueryFrequency pulumi.StringPtrOutput `pulumi:"queryFrequency"`
// The ISO 8601 timespan duration, which determine the time period of the data covered by the query. For example, it can query the past 10 minutes of data, or the past 6 hours of data. Defaults to `PT5H`.
//
// > **NOTE** `queryPeriod` must larger than or equal to `queryFrequency`, which ensures there is no gaps in the overall query coverage.
QueryPeriod pulumi.StringPtrOutput `pulumi:"queryPeriod"`
// A list of `sentinelEntityMapping` blocks as defined below.
//
// > **NOTE:** `entityMapping` and `sentinelEntityMapping` together can't exceed 5.
SentinelEntityMappings AlertRuleScheduledSentinelEntityMappingArrayOutput `pulumi:"sentinelEntityMappings"`
// The alert severity of this Sentinel Scheduled Alert Rule. Possible values are `High`, `Medium`, `Low` and `Informational`.
Severity pulumi.StringOutput `pulumi:"severity"`
// If `suppressionEnabled` is `true`, this is ISO 8601 timespan duration, which specifies the amount of time the query should stop running after alert is generated. Defaults to `PT5H`.
//
// > **NOTE** `suppressionDuration` must larger than or equal to `queryFrequency`, otherwise the suppression has no actual effect since no query will happen during the suppression duration.
SuppressionDuration pulumi.StringPtrOutput `pulumi:"suppressionDuration"`
// Should the Sentinel Scheduled Alert Rulea stop running query after alert is generated? Defaults to `false`.
SuppressionEnabled pulumi.BoolPtrOutput `pulumi:"suppressionEnabled"`
// A list of categories of attacks by which to classify the rule. Possible values are `Collection`, `CommandAndControl`, `CredentialAccess`, `DefenseEvasion`, `Discovery`, `Execution`, `Exfiltration`, `ImpairProcessControl`, `InhibitResponseFunction`, `Impact`, `InitialAccess`, `LateralMovement`, `Persistence`, `PrivilegeEscalation`, `PreAttack`, `Reconnaissance` and `ResourceDevelopment`.
Tactics pulumi.StringArrayOutput `pulumi:"tactics"`
// A list of techniques of attacks by which to classify the rule.
Techniques pulumi.StringArrayOutput `pulumi:"techniques"`
// The alert trigger operator, combined with `triggerThreshold`, setting alert threshold of this Sentinel Scheduled Alert Rule. Possible values are `Equal`, `GreaterThan`, `LessThan`, `NotEqual`. Defaults to `GreaterThan`.
TriggerOperator pulumi.StringPtrOutput `pulumi:"triggerOperator"`
// The baseline number of query results generated, combined with `triggerOperator`, setting alert threshold of this Sentinel Scheduled Alert Rule. Defaults to `0`.
TriggerThreshold pulumi.IntPtrOutput `pulumi:"triggerThreshold"`
}
// NewAlertRuleScheduled registers a new resource with the given unique name, arguments, and options.
func NewAlertRuleScheduled(ctx *pulumi.Context,
name string, args *AlertRuleScheduledArgs, opts ...pulumi.ResourceOption) (*AlertRuleScheduled, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DisplayName == nil {
return nil, errors.New("invalid value for required argument 'DisplayName'")
}
if args.LogAnalyticsWorkspaceId == nil {
return nil, errors.New("invalid value for required argument 'LogAnalyticsWorkspaceId'")
}
if args.Query == nil {
return nil, errors.New("invalid value for required argument 'Query'")
}
if args.Severity == nil {
return nil, errors.New("invalid value for required argument 'Severity'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource AlertRuleScheduled
err := ctx.RegisterResource("azure:sentinel/alertRuleScheduled:AlertRuleScheduled", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAlertRuleScheduled gets an existing AlertRuleScheduled 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 GetAlertRuleScheduled(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AlertRuleScheduledState, opts ...pulumi.ResourceOption) (*AlertRuleScheduled, error) {
var resource AlertRuleScheduled
err := ctx.ReadResource("azure:sentinel/alertRuleScheduled:AlertRuleScheduled", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering AlertRuleScheduled resources.
type alertRuleScheduledState struct {
// An `alertDetailsOverride` block as defined below.
AlertDetailsOverrides []AlertRuleScheduledAlertDetailsOverride `pulumi:"alertDetailsOverrides"`
// The GUID of the alert rule template which is used for this Sentinel Scheduled Alert Rule. Changing this forces a new Sentinel Scheduled Alert Rule to be created.
AlertRuleTemplateGuid *string `pulumi:"alertRuleTemplateGuid"`
// The version of the alert rule template which is used for this Sentinel Scheduled Alert Rule. Changing this forces a new Sentinel Scheduled Alert Rule to be created.
AlertRuleTemplateVersion *string `pulumi:"alertRuleTemplateVersion"`
// A map of string key-value pairs of columns to be attached to this Sentinel Scheduled Alert Rule. The key will appear as the field name in alerts and the value is the event parameter you wish to surface in the alerts.
CustomDetails map[string]string `pulumi:"customDetails"`
// The description of this Sentinel Scheduled Alert Rule.
Description *string `pulumi:"description"`
// The friendly name of this Sentinel Scheduled Alert Rule.
DisplayName *string `pulumi:"displayName"`
// Should the Sentinel Scheduled Alert Rule be enabled? Defaults to `true`.
Enabled *bool `pulumi:"enabled"`
// A list of `entityMapping` blocks as defined below.
EntityMappings []AlertRuleScheduledEntityMapping `pulumi:"entityMappings"`
// A `eventGrouping` block as defined below.
EventGrouping *AlertRuleScheduledEventGrouping `pulumi:"eventGrouping"`
// A `incidentConfiguration` block as defined below.
IncidentConfiguration *AlertRuleScheduledIncidentConfiguration `pulumi:"incidentConfiguration"`
// The ID of the Log Analytics Workspace this Sentinel Scheduled Alert Rule belongs to. Changing this forces a new Sentinel Scheduled Alert Rule to be created.
LogAnalyticsWorkspaceId *string `pulumi:"logAnalyticsWorkspaceId"`
// The name which should be used for this Sentinel Scheduled Alert Rule. Changing this forces a new Sentinel Scheduled Alert Rule to be created.
Name *string `pulumi:"name"`
// The query of this Sentinel Scheduled Alert Rule.
Query *string `pulumi:"query"`
// The ISO 8601 timespan duration between two consecutive queries. Defaults to `PT5H`.
QueryFrequency *string `pulumi:"queryFrequency"`
// The ISO 8601 timespan duration, which determine the time period of the data covered by the query. For example, it can query the past 10 minutes of data, or the past 6 hours of data. Defaults to `PT5H`.
//
// > **NOTE** `queryPeriod` must larger than or equal to `queryFrequency`, which ensures there is no gaps in the overall query coverage.
QueryPeriod *string `pulumi:"queryPeriod"`
// A list of `sentinelEntityMapping` blocks as defined below.
//
// > **NOTE:** `entityMapping` and `sentinelEntityMapping` together can't exceed 5.
SentinelEntityMappings []AlertRuleScheduledSentinelEntityMapping `pulumi:"sentinelEntityMappings"`
// The alert severity of this Sentinel Scheduled Alert Rule. Possible values are `High`, `Medium`, `Low` and `Informational`.
Severity *string `pulumi:"severity"`
// If `suppressionEnabled` is `true`, this is ISO 8601 timespan duration, which specifies the amount of time the query should stop running after alert is generated. Defaults to `PT5H`.
//
// > **NOTE** `suppressionDuration` must larger than or equal to `queryFrequency`, otherwise the suppression has no actual effect since no query will happen during the suppression duration.
SuppressionDuration *string `pulumi:"suppressionDuration"`
// Should the Sentinel Scheduled Alert Rulea stop running query after alert is generated? Defaults to `false`.
SuppressionEnabled *bool `pulumi:"suppressionEnabled"`
// A list of categories of attacks by which to classify the rule. Possible values are `Collection`, `CommandAndControl`, `CredentialAccess`, `DefenseEvasion`, `Discovery`, `Execution`, `Exfiltration`, `ImpairProcessControl`, `InhibitResponseFunction`, `Impact`, `InitialAccess`, `LateralMovement`, `Persistence`, `PrivilegeEscalation`, `PreAttack`, `Reconnaissance` and `ResourceDevelopment`.
Tactics []string `pulumi:"tactics"`
// A list of techniques of attacks by which to classify the rule.
Techniques []string `pulumi:"techniques"`
// The alert trigger operator, combined with `triggerThreshold`, setting alert threshold of this Sentinel Scheduled Alert Rule. Possible values are `Equal`, `GreaterThan`, `LessThan`, `NotEqual`. Defaults to `GreaterThan`.
TriggerOperator *string `pulumi:"triggerOperator"`
// The baseline number of query results generated, combined with `triggerOperator`, setting alert threshold of this Sentinel Scheduled Alert Rule. Defaults to `0`.
TriggerThreshold *int `pulumi:"triggerThreshold"`
}
type AlertRuleScheduledState struct {
// An `alertDetailsOverride` block as defined below.
AlertDetailsOverrides AlertRuleScheduledAlertDetailsOverrideArrayInput
// The GUID of the alert rule template which is used for this Sentinel Scheduled Alert Rule. Changing this forces a new Sentinel Scheduled Alert Rule to be created.
AlertRuleTemplateGuid pulumi.StringPtrInput
// The version of the alert rule template which is used for this Sentinel Scheduled Alert Rule. Changing this forces a new Sentinel Scheduled Alert Rule to be created.
AlertRuleTemplateVersion pulumi.StringPtrInput
// A map of string key-value pairs of columns to be attached to this Sentinel Scheduled Alert Rule. The key will appear as the field name in alerts and the value is the event parameter you wish to surface in the alerts.
CustomDetails pulumi.StringMapInput
// The description of this Sentinel Scheduled Alert Rule.
Description pulumi.StringPtrInput
// The friendly name of this Sentinel Scheduled Alert Rule.
DisplayName pulumi.StringPtrInput
// Should the Sentinel Scheduled Alert Rule be enabled? Defaults to `true`.
Enabled pulumi.BoolPtrInput
// A list of `entityMapping` blocks as defined below.
EntityMappings AlertRuleScheduledEntityMappingArrayInput
// A `eventGrouping` block as defined below.
EventGrouping AlertRuleScheduledEventGroupingPtrInput
// A `incidentConfiguration` block as defined below.
IncidentConfiguration AlertRuleScheduledIncidentConfigurationPtrInput
// The ID of the Log Analytics Workspace this Sentinel Scheduled Alert Rule belongs to. Changing this forces a new Sentinel Scheduled Alert Rule to be created.
LogAnalyticsWorkspaceId pulumi.StringPtrInput
// The name which should be used for this Sentinel Scheduled Alert Rule. Changing this forces a new Sentinel Scheduled Alert Rule to be created.
Name pulumi.StringPtrInput
// The query of this Sentinel Scheduled Alert Rule.
Query pulumi.StringPtrInput
// The ISO 8601 timespan duration between two consecutive queries. Defaults to `PT5H`.
QueryFrequency pulumi.StringPtrInput
// The ISO 8601 timespan duration, which determine the time period of the data covered by the query. For example, it can query the past 10 minutes of data, or the past 6 hours of data. Defaults to `PT5H`.
//
// > **NOTE** `queryPeriod` must larger than or equal to `queryFrequency`, which ensures there is no gaps in the overall query coverage.
QueryPeriod pulumi.StringPtrInput
// A list of `sentinelEntityMapping` blocks as defined below.
//
// > **NOTE:** `entityMapping` and `sentinelEntityMapping` together can't exceed 5.
SentinelEntityMappings AlertRuleScheduledSentinelEntityMappingArrayInput
// The alert severity of this Sentinel Scheduled Alert Rule. Possible values are `High`, `Medium`, `Low` and `Informational`.
Severity pulumi.StringPtrInput
// If `suppressionEnabled` is `true`, this is ISO 8601 timespan duration, which specifies the amount of time the query should stop running after alert is generated. Defaults to `PT5H`.
//
// > **NOTE** `suppressionDuration` must larger than or equal to `queryFrequency`, otherwise the suppression has no actual effect since no query will happen during the suppression duration.
SuppressionDuration pulumi.StringPtrInput
// Should the Sentinel Scheduled Alert Rulea stop running query after alert is generated? Defaults to `false`.
SuppressionEnabled pulumi.BoolPtrInput
// A list of categories of attacks by which to classify the rule. Possible values are `Collection`, `CommandAndControl`, `CredentialAccess`, `DefenseEvasion`, `Discovery`, `Execution`, `Exfiltration`, `ImpairProcessControl`, `InhibitResponseFunction`, `Impact`, `InitialAccess`, `LateralMovement`, `Persistence`, `PrivilegeEscalation`, `PreAttack`, `Reconnaissance` and `ResourceDevelopment`.
Tactics pulumi.StringArrayInput
// A list of techniques of attacks by which to classify the rule.
Techniques pulumi.StringArrayInput
// The alert trigger operator, combined with `triggerThreshold`, setting alert threshold of this Sentinel Scheduled Alert Rule. Possible values are `Equal`, `GreaterThan`, `LessThan`, `NotEqual`. Defaults to `GreaterThan`.
TriggerOperator pulumi.StringPtrInput
// The baseline number of query results generated, combined with `triggerOperator`, setting alert threshold of this Sentinel Scheduled Alert Rule. Defaults to `0`.
TriggerThreshold pulumi.IntPtrInput
}
func (AlertRuleScheduledState) ElementType() reflect.Type {
return reflect.TypeOf((*alertRuleScheduledState)(nil)).Elem()
}
type alertRuleScheduledArgs struct {
// An `alertDetailsOverride` block as defined below.
AlertDetailsOverrides []AlertRuleScheduledAlertDetailsOverride `pulumi:"alertDetailsOverrides"`
// The GUID of the alert rule template which is used for this Sentinel Scheduled Alert Rule. Changing this forces a new Sentinel Scheduled Alert Rule to be created.
AlertRuleTemplateGuid *string `pulumi:"alertRuleTemplateGuid"`
// The version of the alert rule template which is used for this Sentinel Scheduled Alert Rule. Changing this forces a new Sentinel Scheduled Alert Rule to be created.
AlertRuleTemplateVersion *string `pulumi:"alertRuleTemplateVersion"`
// A map of string key-value pairs of columns to be attached to this Sentinel Scheduled Alert Rule. The key will appear as the field name in alerts and the value is the event parameter you wish to surface in the alerts.
CustomDetails map[string]string `pulumi:"customDetails"`
// The description of this Sentinel Scheduled Alert Rule.
Description *string `pulumi:"description"`
// The friendly name of this Sentinel Scheduled Alert Rule.
DisplayName string `pulumi:"displayName"`
// Should the Sentinel Scheduled Alert Rule be enabled? Defaults to `true`.
Enabled *bool `pulumi:"enabled"`
// A list of `entityMapping` blocks as defined below.
EntityMappings []AlertRuleScheduledEntityMapping `pulumi:"entityMappings"`
// A `eventGrouping` block as defined below.
EventGrouping *AlertRuleScheduledEventGrouping `pulumi:"eventGrouping"`
// A `incidentConfiguration` block as defined below.
IncidentConfiguration *AlertRuleScheduledIncidentConfiguration `pulumi:"incidentConfiguration"`
// The ID of the Log Analytics Workspace this Sentinel Scheduled Alert Rule belongs to. Changing this forces a new Sentinel Scheduled Alert Rule to be created.
LogAnalyticsWorkspaceId string `pulumi:"logAnalyticsWorkspaceId"`
// The name which should be used for this Sentinel Scheduled Alert Rule. Changing this forces a new Sentinel Scheduled Alert Rule to be created.
Name *string `pulumi:"name"`
// The query of this Sentinel Scheduled Alert Rule.
Query string `pulumi:"query"`
// The ISO 8601 timespan duration between two consecutive queries. Defaults to `PT5H`.
QueryFrequency *string `pulumi:"queryFrequency"`
// The ISO 8601 timespan duration, which determine the time period of the data covered by the query. For example, it can query the past 10 minutes of data, or the past 6 hours of data. Defaults to `PT5H`.
//
// > **NOTE** `queryPeriod` must larger than or equal to `queryFrequency`, which ensures there is no gaps in the overall query coverage.
QueryPeriod *string `pulumi:"queryPeriod"`
// A list of `sentinelEntityMapping` blocks as defined below.
//
// > **NOTE:** `entityMapping` and `sentinelEntityMapping` together can't exceed 5.
SentinelEntityMappings []AlertRuleScheduledSentinelEntityMapping `pulumi:"sentinelEntityMappings"`
// The alert severity of this Sentinel Scheduled Alert Rule. Possible values are `High`, `Medium`, `Low` and `Informational`.
Severity string `pulumi:"severity"`
// If `suppressionEnabled` is `true`, this is ISO 8601 timespan duration, which specifies the amount of time the query should stop running after alert is generated. Defaults to `PT5H`.
//
// > **NOTE** `suppressionDuration` must larger than or equal to `queryFrequency`, otherwise the suppression has no actual effect since no query will happen during the suppression duration.
SuppressionDuration *string `pulumi:"suppressionDuration"`
// Should the Sentinel Scheduled Alert Rulea stop running query after alert is generated? Defaults to `false`.
SuppressionEnabled *bool `pulumi:"suppressionEnabled"`
// A list of categories of attacks by which to classify the rule. Possible values are `Collection`, `CommandAndControl`, `CredentialAccess`, `DefenseEvasion`, `Discovery`, `Execution`, `Exfiltration`, `ImpairProcessControl`, `InhibitResponseFunction`, `Impact`, `InitialAccess`, `LateralMovement`, `Persistence`, `PrivilegeEscalation`, `PreAttack`, `Reconnaissance` and `ResourceDevelopment`.
Tactics []string `pulumi:"tactics"`
// A list of techniques of attacks by which to classify the rule.
Techniques []string `pulumi:"techniques"`
// The alert trigger operator, combined with `triggerThreshold`, setting alert threshold of this Sentinel Scheduled Alert Rule. Possible values are `Equal`, `GreaterThan`, `LessThan`, `NotEqual`. Defaults to `GreaterThan`.
TriggerOperator *string `pulumi:"triggerOperator"`
// The baseline number of query results generated, combined with `triggerOperator`, setting alert threshold of this Sentinel Scheduled Alert Rule. Defaults to `0`.
TriggerThreshold *int `pulumi:"triggerThreshold"`
}
// The set of arguments for constructing a AlertRuleScheduled resource.
type AlertRuleScheduledArgs struct {
// An `alertDetailsOverride` block as defined below.
AlertDetailsOverrides AlertRuleScheduledAlertDetailsOverrideArrayInput
// The GUID of the alert rule template which is used for this Sentinel Scheduled Alert Rule. Changing this forces a new Sentinel Scheduled Alert Rule to be created.
AlertRuleTemplateGuid pulumi.StringPtrInput
// The version of the alert rule template which is used for this Sentinel Scheduled Alert Rule. Changing this forces a new Sentinel Scheduled Alert Rule to be created.
AlertRuleTemplateVersion pulumi.StringPtrInput
// A map of string key-value pairs of columns to be attached to this Sentinel Scheduled Alert Rule. The key will appear as the field name in alerts and the value is the event parameter you wish to surface in the alerts.
CustomDetails pulumi.StringMapInput
// The description of this Sentinel Scheduled Alert Rule.
Description pulumi.StringPtrInput
// The friendly name of this Sentinel Scheduled Alert Rule.
DisplayName pulumi.StringInput
// Should the Sentinel Scheduled Alert Rule be enabled? Defaults to `true`.
Enabled pulumi.BoolPtrInput
// A list of `entityMapping` blocks as defined below.
EntityMappings AlertRuleScheduledEntityMappingArrayInput
// A `eventGrouping` block as defined below.
EventGrouping AlertRuleScheduledEventGroupingPtrInput
// A `incidentConfiguration` block as defined below.
IncidentConfiguration AlertRuleScheduledIncidentConfigurationPtrInput
// The ID of the Log Analytics Workspace this Sentinel Scheduled Alert Rule belongs to. Changing this forces a new Sentinel Scheduled Alert Rule to be created.
LogAnalyticsWorkspaceId pulumi.StringInput
// The name which should be used for this Sentinel Scheduled Alert Rule. Changing this forces a new Sentinel Scheduled Alert Rule to be created.
Name pulumi.StringPtrInput
// The query of this Sentinel Scheduled Alert Rule.
Query pulumi.StringInput
// The ISO 8601 timespan duration between two consecutive queries. Defaults to `PT5H`.
QueryFrequency pulumi.StringPtrInput
// The ISO 8601 timespan duration, which determine the time period of the data covered by the query. For example, it can query the past 10 minutes of data, or the past 6 hours of data. Defaults to `PT5H`.
//
// > **NOTE** `queryPeriod` must larger than or equal to `queryFrequency`, which ensures there is no gaps in the overall query coverage.
QueryPeriod pulumi.StringPtrInput
// A list of `sentinelEntityMapping` blocks as defined below.
//
// > **NOTE:** `entityMapping` and `sentinelEntityMapping` together can't exceed 5.
SentinelEntityMappings AlertRuleScheduledSentinelEntityMappingArrayInput
// The alert severity of this Sentinel Scheduled Alert Rule. Possible values are `High`, `Medium`, `Low` and `Informational`.
Severity pulumi.StringInput
// If `suppressionEnabled` is `true`, this is ISO 8601 timespan duration, which specifies the amount of time the query should stop running after alert is generated. Defaults to `PT5H`.
//
// > **NOTE** `suppressionDuration` must larger than or equal to `queryFrequency`, otherwise the suppression has no actual effect since no query will happen during the suppression duration.
SuppressionDuration pulumi.StringPtrInput
// Should the Sentinel Scheduled Alert Rulea stop running query after alert is generated? Defaults to `false`.
SuppressionEnabled pulumi.BoolPtrInput
// A list of categories of attacks by which to classify the rule. Possible values are `Collection`, `CommandAndControl`, `CredentialAccess`, `DefenseEvasion`, `Discovery`, `Execution`, `Exfiltration`, `ImpairProcessControl`, `InhibitResponseFunction`, `Impact`, `InitialAccess`, `LateralMovement`, `Persistence`, `PrivilegeEscalation`, `PreAttack`, `Reconnaissance` and `ResourceDevelopment`.
Tactics pulumi.StringArrayInput
// A list of techniques of attacks by which to classify the rule.
Techniques pulumi.StringArrayInput
// The alert trigger operator, combined with `triggerThreshold`, setting alert threshold of this Sentinel Scheduled Alert Rule. Possible values are `Equal`, `GreaterThan`, `LessThan`, `NotEqual`. Defaults to `GreaterThan`.
TriggerOperator pulumi.StringPtrInput
// The baseline number of query results generated, combined with `triggerOperator`, setting alert threshold of this Sentinel Scheduled Alert Rule. Defaults to `0`.
TriggerThreshold pulumi.IntPtrInput
}
func (AlertRuleScheduledArgs) ElementType() reflect.Type {
return reflect.TypeOf((*alertRuleScheduledArgs)(nil)).Elem()
}
type AlertRuleScheduledInput interface {
pulumi.Input
ToAlertRuleScheduledOutput() AlertRuleScheduledOutput
ToAlertRuleScheduledOutputWithContext(ctx context.Context) AlertRuleScheduledOutput
}
func (*AlertRuleScheduled) ElementType() reflect.Type {
return reflect.TypeOf((**AlertRuleScheduled)(nil)).Elem()
}
func (i *AlertRuleScheduled) ToAlertRuleScheduledOutput() AlertRuleScheduledOutput {
return i.ToAlertRuleScheduledOutputWithContext(context.Background())
}
func (i *AlertRuleScheduled) ToAlertRuleScheduledOutputWithContext(ctx context.Context) AlertRuleScheduledOutput {
return pulumi.ToOutputWithContext(ctx, i).(AlertRuleScheduledOutput)
}
// AlertRuleScheduledArrayInput is an input type that accepts AlertRuleScheduledArray and AlertRuleScheduledArrayOutput values.
// You can construct a concrete instance of `AlertRuleScheduledArrayInput` via:
//
// AlertRuleScheduledArray{ AlertRuleScheduledArgs{...} }
type AlertRuleScheduledArrayInput interface {
pulumi.Input
ToAlertRuleScheduledArrayOutput() AlertRuleScheduledArrayOutput
ToAlertRuleScheduledArrayOutputWithContext(context.Context) AlertRuleScheduledArrayOutput
}
type AlertRuleScheduledArray []AlertRuleScheduledInput
func (AlertRuleScheduledArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AlertRuleScheduled)(nil)).Elem()
}
func (i AlertRuleScheduledArray) ToAlertRuleScheduledArrayOutput() AlertRuleScheduledArrayOutput {
return i.ToAlertRuleScheduledArrayOutputWithContext(context.Background())
}
func (i AlertRuleScheduledArray) ToAlertRuleScheduledArrayOutputWithContext(ctx context.Context) AlertRuleScheduledArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(AlertRuleScheduledArrayOutput)
}
// AlertRuleScheduledMapInput is an input type that accepts AlertRuleScheduledMap and AlertRuleScheduledMapOutput values.
// You can construct a concrete instance of `AlertRuleScheduledMapInput` via:
//
// AlertRuleScheduledMap{ "key": AlertRuleScheduledArgs{...} }
type AlertRuleScheduledMapInput interface {
pulumi.Input
ToAlertRuleScheduledMapOutput() AlertRuleScheduledMapOutput
ToAlertRuleScheduledMapOutputWithContext(context.Context) AlertRuleScheduledMapOutput
}
type AlertRuleScheduledMap map[string]AlertRuleScheduledInput
func (AlertRuleScheduledMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AlertRuleScheduled)(nil)).Elem()
}
func (i AlertRuleScheduledMap) ToAlertRuleScheduledMapOutput() AlertRuleScheduledMapOutput {
return i.ToAlertRuleScheduledMapOutputWithContext(context.Background())
}
func (i AlertRuleScheduledMap) ToAlertRuleScheduledMapOutputWithContext(ctx context.Context) AlertRuleScheduledMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(AlertRuleScheduledMapOutput)
}
type AlertRuleScheduledOutput struct{ *pulumi.OutputState }
func (AlertRuleScheduledOutput) ElementType() reflect.Type {
return reflect.TypeOf((**AlertRuleScheduled)(nil)).Elem()
}
func (o AlertRuleScheduledOutput) ToAlertRuleScheduledOutput() AlertRuleScheduledOutput {
return o
}
func (o AlertRuleScheduledOutput) ToAlertRuleScheduledOutputWithContext(ctx context.Context) AlertRuleScheduledOutput {
return o
}
// An `alertDetailsOverride` block as defined below.
func (o AlertRuleScheduledOutput) AlertDetailsOverrides() AlertRuleScheduledAlertDetailsOverrideArrayOutput {
return o.ApplyT(func(v *AlertRuleScheduled) AlertRuleScheduledAlertDetailsOverrideArrayOutput {
return v.AlertDetailsOverrides
}).(AlertRuleScheduledAlertDetailsOverrideArrayOutput)
}
// The GUID of the alert rule template which is used for this Sentinel Scheduled Alert Rule. Changing this forces a new Sentinel Scheduled Alert Rule to be created.
func (o AlertRuleScheduledOutput) AlertRuleTemplateGuid() pulumi.StringPtrOutput {
return o.ApplyT(func(v *AlertRuleScheduled) pulumi.StringPtrOutput { return v.AlertRuleTemplateGuid }).(pulumi.StringPtrOutput)
}
// The version of the alert rule template which is used for this Sentinel Scheduled Alert Rule. Changing this forces a new Sentinel Scheduled Alert Rule to be created.
func (o AlertRuleScheduledOutput) AlertRuleTemplateVersion() pulumi.StringPtrOutput {
return o.ApplyT(func(v *AlertRuleScheduled) pulumi.StringPtrOutput { return v.AlertRuleTemplateVersion }).(pulumi.StringPtrOutput)
}
// A map of string key-value pairs of columns to be attached to this Sentinel Scheduled Alert Rule. The key will appear as the field name in alerts and the value is the event parameter you wish to surface in the alerts.
func (o AlertRuleScheduledOutput) CustomDetails() pulumi.StringMapOutput {
return o.ApplyT(func(v *AlertRuleScheduled) pulumi.StringMapOutput { return v.CustomDetails }).(pulumi.StringMapOutput)
}
// The description of this Sentinel Scheduled Alert Rule.
func (o AlertRuleScheduledOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *AlertRuleScheduled) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// The friendly name of this Sentinel Scheduled Alert Rule.
func (o AlertRuleScheduledOutput) DisplayName() pulumi.StringOutput {
return o.ApplyT(func(v *AlertRuleScheduled) pulumi.StringOutput { return v.DisplayName }).(pulumi.StringOutput)
}
// Should the Sentinel Scheduled Alert Rule be enabled? Defaults to `true`.
func (o AlertRuleScheduledOutput) Enabled() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *AlertRuleScheduled) pulumi.BoolPtrOutput { return v.Enabled }).(pulumi.BoolPtrOutput)
}
// A list of `entityMapping` blocks as defined below.
func (o AlertRuleScheduledOutput) EntityMappings() AlertRuleScheduledEntityMappingArrayOutput {
return o.ApplyT(func(v *AlertRuleScheduled) AlertRuleScheduledEntityMappingArrayOutput { return v.EntityMappings }).(AlertRuleScheduledEntityMappingArrayOutput)
}
// A `eventGrouping` block as defined below.
func (o AlertRuleScheduledOutput) EventGrouping() AlertRuleScheduledEventGroupingPtrOutput {
return o.ApplyT(func(v *AlertRuleScheduled) AlertRuleScheduledEventGroupingPtrOutput { return v.EventGrouping }).(AlertRuleScheduledEventGroupingPtrOutput)
}
// A `incidentConfiguration` block as defined below.
func (o AlertRuleScheduledOutput) IncidentConfiguration() AlertRuleScheduledIncidentConfigurationOutput {
return o.ApplyT(func(v *AlertRuleScheduled) AlertRuleScheduledIncidentConfigurationOutput {
return v.IncidentConfiguration
}).(AlertRuleScheduledIncidentConfigurationOutput)
}
// The ID of the Log Analytics Workspace this Sentinel Scheduled Alert Rule belongs to. Changing this forces a new Sentinel Scheduled Alert Rule to be created.
func (o AlertRuleScheduledOutput) LogAnalyticsWorkspaceId() pulumi.StringOutput {
return o.ApplyT(func(v *AlertRuleScheduled) pulumi.StringOutput { return v.LogAnalyticsWorkspaceId }).(pulumi.StringOutput)
}
// The name which should be used for this Sentinel Scheduled Alert Rule. Changing this forces a new Sentinel Scheduled Alert Rule to be created.
func (o AlertRuleScheduledOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *AlertRuleScheduled) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The query of this Sentinel Scheduled Alert Rule.
func (o AlertRuleScheduledOutput) Query() pulumi.StringOutput {
return o.ApplyT(func(v *AlertRuleScheduled) pulumi.StringOutput { return v.Query }).(pulumi.StringOutput)
}
// The ISO 8601 timespan duration between two consecutive queries. Defaults to `PT5H`.
func (o AlertRuleScheduledOutput) QueryFrequency() pulumi.StringPtrOutput {
return o.ApplyT(func(v *AlertRuleScheduled) pulumi.StringPtrOutput { return v.QueryFrequency }).(pulumi.StringPtrOutput)
}
// The ISO 8601 timespan duration, which determine the time period of the data covered by the query. For example, it can query the past 10 minutes of data, or the past 6 hours of data. Defaults to `PT5H`.
//
// > **NOTE** `queryPeriod` must larger than or equal to `queryFrequency`, which ensures there is no gaps in the overall query coverage.
func (o AlertRuleScheduledOutput) QueryPeriod() pulumi.StringPtrOutput {
return o.ApplyT(func(v *AlertRuleScheduled) pulumi.StringPtrOutput { return v.QueryPeriod }).(pulumi.StringPtrOutput)
}
// A list of `sentinelEntityMapping` blocks as defined below.
//
// > **NOTE:** `entityMapping` and `sentinelEntityMapping` together can't exceed 5.
func (o AlertRuleScheduledOutput) SentinelEntityMappings() AlertRuleScheduledSentinelEntityMappingArrayOutput {
return o.ApplyT(func(v *AlertRuleScheduled) AlertRuleScheduledSentinelEntityMappingArrayOutput {
return v.SentinelEntityMappings
}).(AlertRuleScheduledSentinelEntityMappingArrayOutput)
}
// The alert severity of this Sentinel Scheduled Alert Rule. Possible values are `High`, `Medium`, `Low` and `Informational`.
func (o AlertRuleScheduledOutput) Severity() pulumi.StringOutput {
return o.ApplyT(func(v *AlertRuleScheduled) pulumi.StringOutput { return v.Severity }).(pulumi.StringOutput)
}
// If `suppressionEnabled` is `true`, this is ISO 8601 timespan duration, which specifies the amount of time the query should stop running after alert is generated. Defaults to `PT5H`.
//
// > **NOTE** `suppressionDuration` must larger than or equal to `queryFrequency`, otherwise the suppression has no actual effect since no query will happen during the suppression duration.
func (o AlertRuleScheduledOutput) SuppressionDuration() pulumi.StringPtrOutput {
return o.ApplyT(func(v *AlertRuleScheduled) pulumi.StringPtrOutput { return v.SuppressionDuration }).(pulumi.StringPtrOutput)
}
// Should the Sentinel Scheduled Alert Rulea stop running query after alert is generated? Defaults to `false`.
func (o AlertRuleScheduledOutput) SuppressionEnabled() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *AlertRuleScheduled) pulumi.BoolPtrOutput { return v.SuppressionEnabled }).(pulumi.BoolPtrOutput)
}
// A list of categories of attacks by which to classify the rule. Possible values are `Collection`, `CommandAndControl`, `CredentialAccess`, `DefenseEvasion`, `Discovery`, `Execution`, `Exfiltration`, `ImpairProcessControl`, `InhibitResponseFunction`, `Impact`, `InitialAccess`, `LateralMovement`, `Persistence`, `PrivilegeEscalation`, `PreAttack`, `Reconnaissance` and `ResourceDevelopment`.
func (o AlertRuleScheduledOutput) Tactics() pulumi.StringArrayOutput {
return o.ApplyT(func(v *AlertRuleScheduled) pulumi.StringArrayOutput { return v.Tactics }).(pulumi.StringArrayOutput)
}
// A list of techniques of attacks by which to classify the rule.
func (o AlertRuleScheduledOutput) Techniques() pulumi.StringArrayOutput {
return o.ApplyT(func(v *AlertRuleScheduled) pulumi.StringArrayOutput { return v.Techniques }).(pulumi.StringArrayOutput)
}
// The alert trigger operator, combined with `triggerThreshold`, setting alert threshold of this Sentinel Scheduled Alert Rule. Possible values are `Equal`, `GreaterThan`, `LessThan`, `NotEqual`. Defaults to `GreaterThan`.
func (o AlertRuleScheduledOutput) TriggerOperator() pulumi.StringPtrOutput {
return o.ApplyT(func(v *AlertRuleScheduled) pulumi.StringPtrOutput { return v.TriggerOperator }).(pulumi.StringPtrOutput)
}
// The baseline number of query results generated, combined with `triggerOperator`, setting alert threshold of this Sentinel Scheduled Alert Rule. Defaults to `0`.
func (o AlertRuleScheduledOutput) TriggerThreshold() pulumi.IntPtrOutput {
return o.ApplyT(func(v *AlertRuleScheduled) pulumi.IntPtrOutput { return v.TriggerThreshold }).(pulumi.IntPtrOutput)
}
type AlertRuleScheduledArrayOutput struct{ *pulumi.OutputState }
func (AlertRuleScheduledArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AlertRuleScheduled)(nil)).Elem()
}
func (o AlertRuleScheduledArrayOutput) ToAlertRuleScheduledArrayOutput() AlertRuleScheduledArrayOutput {
return o
}
func (o AlertRuleScheduledArrayOutput) ToAlertRuleScheduledArrayOutputWithContext(ctx context.Context) AlertRuleScheduledArrayOutput {
return o
}
func (o AlertRuleScheduledArrayOutput) Index(i pulumi.IntInput) AlertRuleScheduledOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AlertRuleScheduled {
return vs[0].([]*AlertRuleScheduled)[vs[1].(int)]
}).(AlertRuleScheduledOutput)
}
type AlertRuleScheduledMapOutput struct{ *pulumi.OutputState }
func (AlertRuleScheduledMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AlertRuleScheduled)(nil)).Elem()
}
func (o AlertRuleScheduledMapOutput) ToAlertRuleScheduledMapOutput() AlertRuleScheduledMapOutput {
return o
}
func (o AlertRuleScheduledMapOutput) ToAlertRuleScheduledMapOutputWithContext(ctx context.Context) AlertRuleScheduledMapOutput {
return o
}
func (o AlertRuleScheduledMapOutput) MapIndex(k pulumi.StringInput) AlertRuleScheduledOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AlertRuleScheduled {
return vs[0].(map[string]*AlertRuleScheduled)[vs[1].(string)]
}).(AlertRuleScheduledOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*AlertRuleScheduledInput)(nil)).Elem(), &AlertRuleScheduled{})
pulumi.RegisterInputType(reflect.TypeOf((*AlertRuleScheduledArrayInput)(nil)).Elem(), AlertRuleScheduledArray{})
pulumi.RegisterInputType(reflect.TypeOf((*AlertRuleScheduledMapInput)(nil)).Elem(), AlertRuleScheduledMap{})
pulumi.RegisterOutputType(AlertRuleScheduledOutput{})
pulumi.RegisterOutputType(AlertRuleScheduledArrayOutput{})
pulumi.RegisterOutputType(AlertRuleScheduledMapOutput{})
}