-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdra.tf
75 lines (74 loc) · 2.55 KB
/
dra.tf
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
locals {
dra_action_set = "Send to DRA Behavior Analytics"
dra_all_events_audit_policy = "CounterBreach for Database - All Events"
dra_all_logins_audit_policy = "CounterBreach for Database - Logins Logouts"
dra_configuration = var.dra_details == null ? [] : [
{
name = "send_to_dra_action_set"
method = "POST"
url_path = "SecureSphere/api/v1/conf/actionSets/${local.dra_action_set}"
payload = jsonencode({ "type" : "archiving" })
},
{
name = "send_to_dra_action_set_action"
method = "POST"
url_path = "SecureSphere/api/v1/conf/actionSets/${local.dra_action_set}/scp"
payload = jsonencode({
"type" : "ScpArchive",
"host" : try(var.dra_details.address, null),
"port" : try(var.dra_details.port, null),
"password" : try(var.dra_details.password, null),
"username" : try(var.dra_details.username, null),
"remoteDirectory" : try(var.dra_details.remoteDirectory, null),
"useAuthenticationKey" : false,
"authenticationKeyPath" : " ",
"authenticationKeyPassphrase" : " "
}
)
},
{
name = "dra_all_events_audit_policy"
method = "PUT"
url_path = "SecureSphere/api/v1/conf/auditPolicies/${local.dra_all_events_audit_policy}"
payload = jsonencode({
"counterbreach-policy-enabled" : true,
"archiving-action-set" : local.dra_action_set,
"archiving-settings" : "Default Archiving Settings"
"archive-scheduling" : {
"occurs" : "recurring",
"recurring" : {
"frequency" : "daily",
"daily" : {
"every-number-of-days" : 1
},
"starting-from" : formatdate("YYYY-MM-DD", timestamp()),
"at-time" : "03:00:00"
}
}
}
)
},
{
name = "dra_all_logins_audit_policy"
method = "PUT"
url_path = "SecureSphere/SecureSphere/api/v1/conf/auditPolicies/${local.dra_all_logins_audit_policy}"
payload = jsonencode({
"counterbreach-policy-enabled" : true,
"archiving-action-set" : local.dra_action_set,
"archiving-settings" : "Default Archiving Settings"
"archive-scheduling" : {
"occurs" : "recurring",
"recurring" : {
"frequency" : "daily",
"daily" : {
"every-number-of-days" : 1
},
"starting-from" : formatdate("YYYY-MM-DD", timestamp()),
"at-time" : "02:30:00"
}
}
}
)
}
]
}