Skip to content

Commit de908d0

Browse files
authored
Merge pull request #309 from aquasecurity/SLK-94730-schema-fix-host-runtime-policy
Fix host runtime policy schema
2 parents 3c099e0 + 7cb7263 commit de908d0

File tree

11 files changed

+68
-41
lines changed

11 files changed

+68
-41
lines changed

DEVELOPMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ git clone https://github.com/aquasecurity/terraform-provider-aquasec.git
3232
3333
cd terraform-provider-aquasec
3434
35-
git checkout v0.8.37
35+
git checkout v0.8.38
3636
```
3737

3838
**Build and install the provider**

GNUmakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ HOSTNAME := github.com
66
NAMESPACE := aquasec
77
NAME := aquasec
88
BINARY := terraform-provider-${NAME}
9-
VERSION := 0.8.37
9+
VERSION := 0.8.38
1010
OS_ARCH := $(shell go env GOOS)_$(shell go env GOARCH)
1111

1212
default: build

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ To quickly get started using the Aquasec provider for Terraform, configure the p
4343
terraform {
4444
required_providers {
4545
aquasec = {
46-
version = "0.8.37"
46+
version = "0.8.38"
4747
source = "aquasecurity/aquasec"
4848
}
4949
}

aquasec/resource_host_assurance_policy_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ resource "aquasec_host_assurance_policy" "terraformiap" {
141141
}
142142
143143
vulnerability_exploitability = true
144-
disallow_exploit_types = ["remote_exploit", "local_exploit"]
144+
disallow_exploit_types = ["remote", "local"]
145145
ignore_base_image_vln = false
146146
ignored_sensitive_resources = ["/etc/passwd", "/etc/shadow"]
147147

aquasec/resource_host_runtime_policy.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ package aquasec
33
import (
44
"context"
55
"fmt"
6+
"strings"
7+
68
"github.com/aquasecurity/terraform-provider-aquasec/client"
79
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
810
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
9-
"strings"
1011
)
1112

1213
func resourceHostRuntimePolicy() *schema.Resource {
@@ -1268,6 +1269,10 @@ func resourceHostRuntimePolicy() *schema.Resource {
12681269
Description: "Variable value.",
12691270
Required: true,
12701271
},
1272+
"name": {
1273+
Type: schema.TypeString,
1274+
Optional: true,
1275+
},
12711276
},
12721277
},
12731278
},
@@ -3007,7 +3012,7 @@ func flattenVariables(variables []interface{}) []client.Variable {
30073012
val := v.(map[string]interface{})
30083013
result = append(result, client.Variable{
30093014
Attribute: val["attribute"].(string),
3010-
Name: val["name"].(string),
3015+
Name: val["name"].(string),
30113016
Value: val["value"].(string),
30123017
})
30133018
}

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Use the navigation to the left to read about the available resources and data so
2121
terraform {
2222
required_providers {
2323
aquasec = {
24-
version = "0.8.37"
24+
version = "0.8.38"
2525
source = "aquasecurity/aquasec"
2626
}
2727
}

docs/resources/host_runtime_policy.md

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,25 @@ description: |-
1616
resource "aquasec_host_runtime_policy" "host_runtime_policy" {
1717
name = "host_runtime_policy"
1818
description = "host_runtime_policy"
19-
scope_variables {
20-
attribute = "kubernetes.cluster"
21-
value = "default"
22-
}
23-
scope_variables {
24-
attribute = "kubernetes.label"
25-
name = "app"
26-
value = "aqua"
19+
20+
scope {
21+
expression = "v1 && v2 || v3"
22+
23+
variables {
24+
attribute = "aqua.hostgroup"
25+
value = "production"
26+
}
27+
variables {
28+
attribute = "cloud.awsaccount"
29+
value = "xxxxxxxxx"
30+
}
31+
variables {
32+
attribute = "os.hostname"
33+
name = "name"
34+
value = "10.0.0.1"
35+
}
2736
}
37+
2838
2939
application_scopes = [
3040
"Global",
@@ -37,19 +47,19 @@ resource "aquasec_host_runtime_policy" "host_runtime_policy" {
3747
"blocked",
3848
]
3949
file_integrity_monitoring {
40-
monitor_create = true
41-
monitor_read = true
42-
monitor_modify = true
43-
monitor_delete = true
44-
monitor_attributes = true
45-
monitored_paths = ["paths"]
46-
excluded_paths = ["expaths"]
47-
monitored_processes = ["process"]
48-
excluded_processes = ["exprocess"]
49-
monitored_users = ["user"]
50-
excluded_users = ["expuser"]
50+
enabled = true
51+
monitored_files_read = true
52+
monitored_files_modify = true
53+
monitored_files_delete = true
54+
monitored_files_attributes = false
55+
monitored_files = ["paths"]
56+
exceptional_monitored_files = ["expaths"]
57+
monitored_files_processes = ["process"]
58+
exceptional_monitored_files_processes = ["exprocess"]
59+
monitored_files_users = ["user"]
60+
exceptional_monitored_files_users = ["expuser"]
5161
}
52-
audit_all_os_user_activity = true
62+
5363
audit_full_command_arguments = true
5464
audit_host_successful_login_events = true
5565
audit_host_failed_login_events = true
@@ -66,9 +76,7 @@ resource "aquasec_host_runtime_policy" "host_runtime_policy" {
6676
os_groups_blocked = [
6777
"group2",
6878
]
69-
package_block = [
70-
"package1"
71-
]
79+
7280
monitor_system_time_changes = true
7381
monitor_windows_services = true
7482
monitor_system_log_integrity = true
@@ -461,6 +469,10 @@ Required:
461469
- `attribute` (String) Variable attribute.
462470
- `value` (String) Variable value.
463471

472+
Optional:
473+
474+
- `name` (String)
475+
464476

465477

466478
<a id="nestedblock--scope_variables"></a>

examples/data-sources/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
terraform {
22
required_providers {
33
aquasec = {
4-
// version = "0.8.37"
4+
// version = "0.8.38"
55
source = "aquasecurity/aquasec"
66
}
77
}

examples/provider/provider.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
terraform {
22
required_providers {
33
aquasec = {
4-
version = "0.8.37"
4+
version = "0.8.38"
55
source = "aquasecurity/aquasec"
66
}
77
}

examples/resources/aquasec_host_runtime_policy/resource.tf

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
resource "aquasec_host_runtime_policy" "host_runtime_policy" {
22
name = "host_runtime_policy"
33
description = "host_runtime_policy"
4-
scope_variables {
5-
attribute = "kubernetes.cluster"
6-
value = "default"
7-
}
8-
scope_variables {
9-
attribute = "kubernetes.label"
10-
name = "app"
11-
value = "aqua"
4+
5+
scope {
6+
expression = "v1 && v2 || v3"
7+
8+
variables {
9+
attribute = "aqua.hostgroup"
10+
value = "production"
11+
}
12+
variables {
13+
attribute = "cloud.awsaccount"
14+
value = "xxxxxxxxx"
15+
}
16+
variables {
17+
attribute = "os.hostname"
18+
name = "name"
19+
value = "10.0.0.1"
20+
}
1221
}
22+
1323

1424
application_scopes = [
1525
"Global",

0 commit comments

Comments
 (0)