Skip to content

Commit 65cb41d

Browse files
author
Shreyas Sreenivas
authored
Merge pull request #96 from vmware/vasundharas/rectify-security-policy-templates
Correct resource templates for security policy resource and format the examples and templates
2 parents 73d2724 + 98fb1f2 commit 65cb41d

20 files changed

+66
-48
lines changed

examples/resources/security_policy/resource_cluster_custom_security_policy.tf

+6-6
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ resource "tanzu-mission-control_security_policy" "cluster_scoped_custom_security
3030
max = 5000
3131
}
3232

33-
allowed_volumes = [
33+
allowed_volumes = [
3434
"configMap",
3535
"nfs",
3636
"vsphereVolume"
@@ -89,7 +89,7 @@ resource "tanzu-mission-control_security_policy" "cluster_scoped_custom_security
8989
}
9090

9191
linux_capabilities {
92-
allowed_capabilities = [
92+
allowed_capabilities = [
9393
"CHOWN",
9494
"IPC_LOCK"
9595
]
@@ -100,15 +100,15 @@ resource "tanzu-mission-control_security_policy" "cluster_scoped_custom_security
100100

101101
allowed_host_paths {
102102
path_prefix = "p1"
103-
read_only = true
103+
read_only = true
104104
}
105105
allowed_host_paths {
106106
path_prefix = "p2"
107-
read_only = false
107+
read_only = false
108108
}
109109
allowed_host_paths {
110110
path_prefix = "p3"
111-
read_only = true
111+
read_only = true
112112
}
113113

114114
allowed_se_linux_options {
@@ -126,7 +126,7 @@ resource "tanzu-mission-control_security_policy" "cluster_scoped_custom_security
126126
}
127127

128128
seccomp {
129-
allowed_profiles = [
129+
allowed_profiles = [
130130
"Localhost"
131131
]
132132
allowed_localhost_files = [

examples/resources/security_policy/resource_cluster_group_baseline_security_policy.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ resource "tanzu-mission-control_security_policy" "cluster_group_scoped_baseline_
2424
match_expressions {
2525
key = "component"
2626
operator = "In"
27-
values = [
27+
values = [
2828
"api-server",
2929
"agent-gateway"
3030
]

examples/resources/security_policy/resource_cluster_group_custom_security_policy.tf

+8-8
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ resource "tanzu-mission-control_security_policy" "cluster_group_scoped_custom_se
2828
max = 5000
2929
}
3030

31-
allowed_volumes = [
31+
allowed_volumes = [
3232
"configMap",
3333
"nfs",
3434
"vsphereVolume"
@@ -87,7 +87,7 @@ resource "tanzu-mission-control_security_policy" "cluster_group_scoped_custom_se
8787
}
8888

8989
linux_capabilities {
90-
allowed_capabilities = [
90+
allowed_capabilities = [
9191
"CHOWN",
9292
"IPC_LOCK"
9393
]
@@ -98,15 +98,15 @@ resource "tanzu-mission-control_security_policy" "cluster_group_scoped_custom_se
9898

9999
allowed_host_paths {
100100
path_prefix = "p1"
101-
read_only = true
101+
read_only = true
102102
}
103103
allowed_host_paths {
104104
path_prefix = "p2"
105-
read_only = false
105+
read_only = false
106106
}
107107
allowed_host_paths {
108108
path_prefix = "p3"
109-
read_only = true
109+
read_only = true
110110
}
111111

112112
allowed_se_linux_options {
@@ -124,8 +124,8 @@ resource "tanzu-mission-control_security_policy" "cluster_group_scoped_custom_se
124124
}
125125

126126
seccomp {
127-
allowed_profiles = [
128-
"Localhost"
127+
allowed_profiles = [
128+
"Localhost"
129129
]
130130
allowed_localhost_files = [
131131
"profiles/audit.json",
@@ -139,7 +139,7 @@ resource "tanzu-mission-control_security_policy" "cluster_group_scoped_custom_se
139139
match_expressions {
140140
key = "component"
141141
operator = "In"
142-
values = [
142+
values = [
143143
"api-server",
144144
"agent-gateway"
145145
]

examples/resources/security_policy/resource_cluster_strict_security_policy.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ resource "tanzu-mission-control_security_policy" "cluster_scoped_strict_security
2626
match_expressions {
2727
key = "component"
2828
operator = "NotIn"
29-
values = [
29+
values = [
3030
"api-server",
3131
"agent-gateway"
3232
]

examples/resources/security_policy/resource_organization_custom_security_policy.tf

+7-7
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ resource "tanzu-mission-control_security_policy" "organization_scoped_custom_sec
2828
max = 5000
2929
}
3030

31-
allowed_volumes = [
31+
allowed_volumes = [
3232
"configMap",
3333
"nfs",
3434
"vsphereVolume"
@@ -87,7 +87,7 @@ resource "tanzu-mission-control_security_policy" "organization_scoped_custom_sec
8787
}
8888

8989
linux_capabilities {
90-
allowed_capabilities = [
90+
allowed_capabilities = [
9191
"CHOWN",
9292
"IPC_LOCK"
9393
]
@@ -98,15 +98,15 @@ resource "tanzu-mission-control_security_policy" "organization_scoped_custom_sec
9898

9999
allowed_host_paths {
100100
path_prefix = "p1"
101-
read_only = true
101+
read_only = true
102102
}
103103
allowed_host_paths {
104104
path_prefix = "p2"
105-
read_only = false
105+
read_only = false
106106
}
107107
allowed_host_paths {
108108
path_prefix = "p3"
109-
read_only = true
109+
read_only = true
110110
}
111111

112112
allowed_se_linux_options {
@@ -124,7 +124,7 @@ resource "tanzu-mission-control_security_policy" "organization_scoped_custom_sec
124124
}
125125

126126
seccomp {
127-
allowed_profiles = [
127+
allowed_profiles = [
128128
"Localhost"
129129
]
130130
allowed_localhost_files = [
@@ -139,7 +139,7 @@ resource "tanzu-mission-control_security_policy" "organization_scoped_custom_sec
139139
match_expressions {
140140
key = "component"
141141
operator = "In"
142-
values = [
142+
values = [
143143
"api-server",
144144
"agent-gateway"
145145
]

examples/resources/security_policy/resource_organization_strict_security_policy.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ resource "tanzu-mission-control_security_policy" "organization_scoped_strict_sec
2424
match_expressions {
2525
key = "component"
2626
operator = "In"
27-
values = [
27+
values = [
2828
"api-server",
2929
"agent-gateway"
3030
]

resource_templates/cluster_group_scoped_baseline_security_policy.tf

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Create/ Delete/ Update Tanzu Mission Control cluster group scoped baseline security policy entry
22
resource "tanzu-mission-control_security_policy" "cluster_group_scoped_baseline_security_policy" {
3+
name = "<security-policy-name>"
4+
35
scope {
46
cluster_group {
57
cluster_group = "<cluster-group-name>" // Required

resource_templates/cluster_group_scoped_custom_security_policy.tf

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Create/ Delete/ Update Tanzu Mission Control cluster group scoped custom security policy entry
22
resource "tanzu-mission-control_security_policy" "cluster_group_scoped_custom_security_policy" {
3+
name = "<security-policy-name>"
4+
35
scope {
46
cluster_group {
57
cluster_group = "<cluster-group-name>" // Required

resource_templates/cluster_group_scoped_strict_security_policy.tf

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Create/ Delete/ Update Tanzu Mission Control cluster group scoped strict security policy entry
22
resource "tanzu-mission-control_security_policy" "cluster_group_scoped_strict_security_policy" {
3+
name = "<security-policy-name>"
4+
35
scope {
46
cluster_group {
57
cluster_group = "<cluster-group-name>" // Required

resource_templates/cluster_scoped_baseline_security_policy.tf

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Create/ Delete/ Update Tanzu Mission Control cluster scoped baseline security policy entry
22
resource "tanzu-mission-control_security_policy" "cluster_scoped_baseline_security_policy" {
3+
name = "<security-policy-name>"
4+
35
scope {
46
cluster {
57
management_cluster_name = "<management-cluster>" // Required

resource_templates/cluster_scoped_custom_security_policy.tf

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Create/ Delete/ Update Tanzu Mission Control cluster scoped custom security policy entry
22
resource "tanzu-mission-control_security_policy" "cluster_scoped_custom_security_policy" {
3+
name = "<security-policy-name>"
4+
35
scope {
46
cluster {
57
management_cluster_name = "<management-cluster>" // Required

resource_templates/cluster_scoped_strict_security_policy.tf

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Create/ Delete/ Update Tanzu Mission Control cluster scoped strict security policy entry
22
resource "tanzu-mission-control_security_policy" "cluster_scoped_strict_security_policy" {
3+
name = "<security-policy-name>"
4+
35
scope {
46
cluster {
57
management_cluster_name = "<management-cluster>" // Required

resource_templates/credential_aws_eks.tf

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ resource "tanzu-mission-control_credential" "aws_eks_cred" {
1010
meta {
1111
description = "<description of the credential>"
1212
labels = {
13-
"key" : "<value>" ,
13+
"key" : "<value>",
1414
}
1515
}
1616

1717
spec {
1818
capability = "<capability-type>"
19-
provider = "<provider>"
19+
provider = "<provider>"
2020
data {
2121
aws_credential {
2222
account_id = "<account-id>"
23-
iam_role{
24-
arn = "<IAM-role-ARN>"
25-
ext_id ="external-ID"
23+
iam_role {
24+
arn = "<IAM-role-ARN>"
25+
ext_id = "external-ID"
2626
}
2727
}
2828
}

resource_templates/credential_dataprotection.tf

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ resource "tanzu-mission-control_credential" "tmc_provisioned_aws_s3_cred" {
1010
meta {
1111
description = "<description of the credential>"
1212
labels = {
13-
"key" : "<value>" ,
13+
"key" : "<value>",
1414
}
1515
}
1616

1717
spec {
1818
capability = "<capability-type>"
19-
provider = "<provider>"
19+
provider = "<provider>"
2020
data {
2121
aws_credential {
22-
iam_role{
22+
iam_role {
2323
arn = "<IAM-role-ARN>"
2424
}
2525
}

resource_templates/credential_image_registry.tf

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ resource "tanzu-mission-control_credential" "img_reg_cred" {
1010
meta {
1111
description = "<description of the credential>"
1212
labels = {
13-
"key" : "<value>" ,
13+
"key" : "<value>",
1414
}
1515
annotations = {
1616
"repository-path" : "<path>"
@@ -19,12 +19,12 @@ resource "tanzu-mission-control_credential" "img_reg_cred" {
1919

2020
spec {
2121
capability = "<capability-type>"
22-
provider = "<provider>"
22+
provider = "<provider>"
2323
data {
24-
key_value{
25-
data = {
24+
key_value {
25+
data = {
2626
"registry-url" = "<url>"
27-
"ca-cert" = "<ca-cert>"
27+
"ca-cert" = "<ca-cert>"
2828
}
2929
}
3030
}

resource_templates/credential_proxy.tf

+7-7
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ resource "tanzu-mission-control_credential" "proxy_cred" {
1010
meta {
1111
description = "<description of the credential>"
1212
labels = {
13-
"key" : "<value>" ,
13+
"key" : "<value>",
1414
}
1515
annotations = {
16-
"httpProxy" :"<http-proxy-url>",
17-
"httpsProxy" :"<https-proxy-url>",
18-
"noProxyList":"<no-proxy-list>"
16+
"httpProxy" : "<http-proxy-url>",
17+
"httpsProxy" : "<https-proxy-url>",
18+
"noProxyList" : "<no-proxy-list>"
1919
}
2020
}
2121

2222
spec {
2323
capability = "<capability-type>"
24-
provider = "<provider>"
24+
provider = "<provider>"
2525
data {
26-
key_value{
27-
data = {
26+
key_value {
27+
data = {
2828
"httpUserName" = "<username>"
2929
"httpPassword" = "<password>"
3030
"httpsUserName" = "<username>"

resource_templates/credential_tanzu_observability.tf

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ resource "tanzu-mission-control_credential" "tanzu_observability_cred" {
1010
meta {
1111
description = "<description of the credential>"
1212
labels = {
13-
"key" : "<value>" ,
13+
"key" : "<value>",
1414
}
1515
annotations = {
1616
"wavefront.url" : "<url of wavefront instance>"
@@ -19,10 +19,10 @@ resource "tanzu-mission-control_credential" "tanzu_observability_cred" {
1919

2020
spec {
2121
capability = "<capability-type>"
22-
provider = "<provider>"
22+
provider = "<provider>"
2323
data {
24-
key_value{
25-
data = {
24+
key_value {
25+
data = {
2626
"wavefront.token" = "<wavefront api token>"
2727
}
2828
}

resource_templates/organization_scoped_baseline_security_policy.tf

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Create/ Delete/ Update Tanzu Mission Control organization scoped baseline security policy entry
22
resource "tanzu-mission-control_security_policy" "organization_scoped_baseline_security_policy" {
3+
name = "<security-policy-name>"
4+
35
scope {
46
organization {
57
organization = "<organization-id>" // Required

resource_templates/organization_scoped_custom_security_policy.tf

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Create/ Delete/ Update Tanzu Mission Control organization scoped custom security policy entry
22
resource "tanzu-mission-control_security_policy" "organization_scoped_custom_security_policy" {
3+
name = "<security-policy-name>"
4+
35
scope {
46
organization {
57
organization = "<organization-id>" // Required

resource_templates/organization_scoped_strict_security_policy.tf

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Create/ Delete/ Update Tanzu Mission Control organization scoped strict security policy entry
22
resource "tanzu-mission-control_security_policy" "organization_scoped_strict_security_policy" {
3+
name = "<security-policy-name>"
4+
35
scope {
46
organization {
57
organization = "<organization-id>" // Required

0 commit comments

Comments
 (0)