Skip to content

Commit 999639c

Browse files
committed
format: Formatted examples with Terraform fmt
Signed-off-by: Federico Barcelona <[email protected]>
1 parent bc346fe commit 999639c

File tree

4 files changed

+76
-76
lines changed

4 files changed

+76
-76
lines changed

examples/alert.tf

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
resource "sysdig_monitor_alert_anomaly" "sample" {
3-
name = "[Kubernetes] Anomaly Detection Alert"
3+
name = "[Kubernetes] Anomaly Detection Alert"
44
description = "Detects an anomaly in the cluster"
5-
severity = 6
5+
severity = 6
66

77
monitor = ["cpu.used.percent", "memory.bytes.used"]
88

@@ -11,28 +11,28 @@ resource "sysdig_monitor_alert_anomaly" "sample" {
1111
multiple_alerts_by = ["kubernetes.cluster.name",
1212
"kubernetes.namespace.name",
1313
"kubernetes.deployment.name",
14-
"kubernetes.pod.name"]
14+
"kubernetes.pod.name"]
1515
}
1616

1717
resource "sysdig_monitor_alert_downtime" "sample" {
18-
name = "[Kubernetes] Downtime Alert"
18+
name = "[Kubernetes] Downtime Alert"
1919
description = "Detects a downtime in the Kubernetes cluster"
20-
severity = 2
20+
severity = 2
2121

2222
entities_to_monitor = ["kubernetes.namespace.name"]
2323

2424
trigger_after_minutes = 10
25-
trigger_after_pct = 100
25+
trigger_after_pct = 100
2626
}
2727

2828
resource "sysdig_monitor_alert_event" "sample" {
29-
name = "[Kubernetes] Failed to pull image"
29+
name = "[Kubernetes] Failed to pull image"
3030
description = "A Kubernetes pod failed to pull an image from the registry"
31-
severity = 4
31+
severity = 4
3232

33-
event_name = "Failed to pull image"
34-
source = "kubernetes"
35-
event_rel = ">"
33+
event_name = "Failed to pull image"
34+
source = "kubernetes"
35+
event_rel = ">"
3636
event_count = 0
3737

3838
multiple_alerts_by = ["kubernetes.pod.name"]
@@ -41,9 +41,9 @@ resource "sysdig_monitor_alert_event" "sample" {
4141
}
4242

4343
resource "sysdig_monitor_alert_group_outlier" "sample" {
44-
name = "[Kubernetes] A node is using more CPU than the rest"
44+
name = "[Kubernetes] A node is using more CPU than the rest"
4545
description = "Monitors the cluster and checks when a node has more CPU usage than the others"
46-
severity = 6
46+
severity = 6
4747

4848
monitor = ["cpu.used.percent"]
4949

@@ -56,17 +56,17 @@ resource "sysdig_monitor_alert_group_outlier" "sample" {
5656
}
5757

5858
resource "sysdig_monitor_alert_metric" "sample" {
59-
name = "[Kubernetes] CrashLoopBackOff"
59+
name = "[Kubernetes] CrashLoopBackOff"
6060
description = "A Kubernetes pod failed to restart"
61-
severity = 6
61+
severity = 6
6262

63-
metric = "sum(timeAvg(kubernetes.pod.restart.count)) > 2"
63+
metric = "sum(timeAvg(kubernetes.pod.restart.count)) > 2"
6464
trigger_after_minutes = 1
6565

6666
multiple_alerts_by = ["kubernetes.cluster.name",
6767
"kubernetes.namespace.name",
6868
"kubernetes.deployment.name",
69-
"kubernetes.pod.name"]
69+
"kubernetes.pod.name"]
7070

7171
capture {
7272
filename = "CrashLoopBackOff"

examples/notification.tf

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,56 @@
11

22
resource "sysdig_secure_notification_channel" "sample-email" {
3-
name = "Example Channel - Email"
4-
enabled = true
5-
type = "EMAIL"
6-
recipients = "[email protected]"
7-
notify_when_ok = false
3+
name = "Example Channel - Email"
4+
enabled = true
5+
type = "EMAIL"
6+
recipients = "[email protected]"
7+
notify_when_ok = false
88
notify_when_resolved = false
99
}
1010

1111
resource "sysdig_secure_notification_channel" "sample-amazon-sns" {
12-
name = "Example Channel - Amazon SNS"
13-
enabled = true
14-
type = "SNS"
15-
topics = "arn:aws:sns:us-east-1:273107874544:my-alerts,arn:aws:sns:us-east-1:273107874544:my-alerts2"
16-
notify_when_ok = false
12+
name = "Example Channel - Amazon SNS"
13+
enabled = true
14+
type = "SNS"
15+
topics = "arn:aws:sns:us-east-1:273107874544:my-alerts,arn:aws:sns:us-east-1:273107874544:my-alerts2"
16+
notify_when_ok = false
1717
notify_when_resolved = false
1818
}
1919

2020
resource "sysdig_secure_notification_channel" "sample-victorops" {
21-
name = "Example Channel - VictorOps"
22-
enabled = true
23-
type = "VICTOROPS"
24-
api_key = "1234342-4234243-4234-2"
25-
routing_key = "My team"
26-
notify_when_ok = false
21+
name = "Example Channel - VictorOps"
22+
enabled = true
23+
type = "VICTOROPS"
24+
api_key = "1234342-4234243-4234-2"
25+
routing_key = "My team"
26+
notify_when_ok = false
2727
notify_when_resolved = false
2828
}
2929

3030
resource "sysdig_secure_notification_channel" "sample-opsgenie" {
31-
name = "Example Channel - OpsGenie"
32-
enabled = true
33-
type = "OPSGENIE"
34-
api_key = "2349324-342354353-5324-23"
35-
notify_when_ok = false
31+
name = "Example Channel - OpsGenie"
32+
enabled = true
33+
type = "OPSGENIE"
34+
api_key = "2349324-342354353-5324-23"
35+
notify_when_ok = false
3636
notify_when_resolved = false
3737
}
3838

3939
resource "sysdig_secure_notification_channel" "sample-webhook" {
40-
name = "Example Channel - Webhook"
41-
enabled = true
42-
type = "WEBHOOK"
43-
url = "localhost:8080"
44-
notify_when_ok = false
40+
name = "Example Channel - Webhook"
41+
enabled = true
42+
type = "WEBHOOK"
43+
url = "localhost:8080"
44+
notify_when_ok = false
4545
notify_when_resolved = false
4646
}
4747

4848
resource "sysdig_secure_notification_channel" "sample-slack" {
49-
name = "Example Channel - Slack"
50-
enabled = true
51-
type = "SLACK"
52-
url = "https://hooks.slack.cwom/services/XXXXXXXXX/XXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXX"
53-
channel = "#sysdig"
54-
notify_when_ok = true
49+
name = "Example Channel - Slack"
50+
enabled = true
51+
type = "SLACK"
52+
url = "https://hooks.slack.cwom/services/XXXXXXXXX/XXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXX"
53+
channel = "#sysdig"
54+
notify_when_ok = true
5555
notify_when_resolved = true
5656
}

examples/policy.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11

22
resource "sysdig_secure_policy" "sample" {
3-
name = "Other example of Policy"
3+
name = "Other example of Policy"
44
description = "this is other example of policy"
5-
enabled = true
6-
severity = 4
7-
scope = "container.id != \"\""
8-
rule_names = ["Terminal shell in container"]
5+
enabled = true
6+
severity = 4
7+
scope = "container.id != \"\""
8+
rule_names = ["Terminal shell in container"]
99

1010
actions {
1111
container = "stop"
1212
capture {
1313
seconds_before_event = 5
14-
seconds_after_event = 10
14+
seconds_after_event = 10
1515
}
1616
}
1717

examples/rules.tf

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,70 @@
11
resource "sysdig_secure_rule_container" "sample" {
2-
name = "Other example of Policy"
2+
name = "Other example of Policy"
33
description = "this is other example of policy"
4-
tags = ["container", "cis"]
4+
tags = ["container", "cis"]
55

6-
matching = true // default
6+
matching = true // default
77
containers = ["foo", "foo:bar"]
88
}
99

10-
resource "sysdig_secure_rule_filesystem" "foo" {
11-
name = "Other example of Policy"
10+
resource "sysdig_secure_rule_filesystem" "foo" {
11+
name = "Other example of Policy"
1212
description = "this is other example of policy"
13-
tags = ["filesystem", "cis"]
13+
tags = ["filesystem", "cis"]
1414

1515
read_only {
1616
matching = true // default
17-
paths = ["/etc"]
17+
paths = ["/etc"]
1818
}
1919

2020
read_write {
2121
matching = true // default
22-
paths = ["/tmp"]
22+
paths = ["/tmp"]
2323
}
2424
}
2525

2626
resource "sysdig_secure_rule_network" "foo" {
27-
name = "Other example of Policy" // ID
27+
name = "Other example of Policy" // ID
2828
description = "this is other example of policy"
29-
tags = ["network", "cis"]
29+
tags = ["network", "cis"]
3030

31-
block_inbound = true
31+
block_inbound = true
3232
block_outbound = true
3333

3434
tcp {
3535
matching = true // default
36-
ports = [80, 443]
36+
ports = [80, 443]
3737
}
3838

3939
udp {
4040
matching = true // default
41-
ports = [80, 443]
41+
ports = [80, 443]
4242
}
4343
}
4444

4545
resource "sysdig_secure_rule_process" "foo" {
46-
name = "Other example of Policy" // ID
46+
name = "Other example of Policy" // ID
4747
description = "this is other example of policy"
4848

49-
matching = true // default
49+
matching = true // default
5050
processes = ["bash"]
5151
}
5252

5353
resource "sysdig_secure_rule_syscall" "foo" {
54-
name = "Other example of Policy" // ID
54+
name = "Other example of Policy" // ID
5555
description = "this is other example of policy"
5656

5757
matching = true // default
5858
syscalls = ["open", "execve"]
5959
}
6060

6161
resource "sysdig_secure_rule_falco" "foo" {
62-
name = "Other example of Policy" // ID
62+
name = "Other example of Policy" // ID
6363
description = "this is other example of policy"
64-
tags = ["container", "shell", "mitre_execution"]
64+
tags = ["container", "shell", "mitre_execution"]
6565

6666
condition = "spawned_process and container and shell_procs and proc.tty != 0 and container_entrypoint"
67-
output = "A shell was spawned in a container with an attached terminal (user=%user.name %container.info shell=%proc.name parent=%proc.pname cmdline=%proc.cmdline terminal=%proc.tty container_id=%container.id image=%container.image.repository)"
68-
priority = "notice"
69-
source = "syscall" // syscall or k8s_audit
67+
output = "A shell was spawned in a container with an attached terminal (user=%user.name %container.info shell=%proc.name parent=%proc.pname cmdline=%proc.cmdline terminal=%proc.tty container_id=%container.id image=%container.image.repository)"
68+
priority = "notice"
69+
source = "syscall" // syscall or k8s_audit
7070
}

0 commit comments

Comments
 (0)