Skip to content

Commit 64297a2

Browse files
andrecorreanetorrywhenHalimer
authored
Release 0.2.5 (#33)
* Release 0.2.1 * Release 0.2.2 * feat: TF < 1.3.0 restriction removed * feat: TF binary equal or greater than 1.3.0 requirement added * chore: release notes and version bump * chore: release notes, tag and SPECs updated * fix typo in dynamic groups that refered to domain groups * fix: version = "<= 5.16.0" removed * chore: release notes, version and spec updated * feat: OCI FW and ZPR IAM policies added * feat: examples updated * chore: release notes and version update * chore: release notes updated. --------- Signed-off-by: Andre Correa <andre.correa@oracle.com> Co-authored-by: Rory Nguyen <rory.nguyen@oracle.com> Co-authored-by: josh_hammer <josh.hammer@oracle.com>
1 parent 6a5a73b commit 64297a2

File tree

9 files changed

+87
-35
lines changed

9 files changed

+87
-35
lines changed

RELEASE-NOTES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# November 01, 2024 Release Notes - 0.2.5
2+
## Updates
3+
1. [Policies module](./policies/)
4+
- Added IAM policies for OCI Network Firewall and ZPR.
5+
- OCI Network Firewall granted manage permissions to Network admins.
6+
- ZPR granted manage permissions to Security admins.
7+
8+
19
# October 07, 2024 Release Notes - 0.2.4
210
## Updates
311
1. [Identity Domains module](./identity-domains/)

compartments/examples/vision/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# OCI Landing Zones IAM Compartments Module Example - Vision compartments
22

3-
This example shows how to deploy Identity and Access Management (IAM) compartments in Oracle Cloud Infrastructure (OCI) for a hypothetical Vision entity. The sample topology is the same one deployed by [OCI Base Landing Zone](https://github.com/oracle-quickstart/oci-cis-landingzone-quickstart).
3+
This example shows how to deploy Identity and Access Management (IAM) compartments in Oracle Cloud Infrastructure (OCI) for a hypothetical Vision entity. The sample topology is the same one deployed by [OCI Core Landing Zone](https://github.com/oci-landing-zones/terraform-oci-core-landingzone).
44

55
It creates the compartment topology as shown in the picture below:
66

@@ -23,6 +23,8 @@ Refer to [compartment's module README.md](../../README.md) for overall attribute
2323

2424
*TOP-CMP* defines two tag defaults. *COST-CENTER-TAG-DEFAULT* will automatically apply value "a1" to any resources created in *TOP-CMP* compartment and sub-compartments. *ENVIRONMENT-TAG-DEFAULT* will automatically require that users provide a value when creating resources in *TOP-CMP* compartment and sub-compartments.
2525

26+
The *cislz* and *cislz-cmp-type* freeform tags assigned to each compartment are used as lookups by [Template Policies Example](https://github.com/oci-landing-zones/terraform-oci-modules-iam/tree/main/policies/examples/template-policies).
27+
2628
**Note**: If the *automation_config* variable is provided, the example writes the compartments output to the specified OCI Object Storage bucket (write permissions are required on the bucket). The example can be easily changed to write the output to a local file instead. The output can be further used by another module that depends on these compartments.
2729

2830
3. In this folder, run the typical Terraform workflow:

compartments/examples/vision/input.auto.tfvars.template

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ compartments_configuration = {
3737
TOP-CMP = {
3838
name = "vision-top-cmp",
3939
description = "Vision Enclosing compartment",
40+
freeform_tags = {
41+
cislz = "template-policies-example",
42+
cislz-cmp-type = "enclosing"
43+
}
4044
#parent_id = null,
4145
tag_defaults = {
4246
COST-CENTER-TAG-DEFAULT = {
@@ -54,22 +58,42 @@ compartments_configuration = {
5458
NETWORK-CMP = {
5559
name = "vision-network-cmp",
5660
description = "Vision Network compartment",
61+
freeform_tags = {
62+
cislz = "template-policies-example",
63+
cislz-cmp-type = "network"
64+
}
5765
},
5866
SECURITY-CMP = {
5967
name = "vision-security-cmp",
60-
description = "Vision Security compartment",
68+
description = "Vision Security compartment",
69+
freeform_tags = {
70+
cislz = "template-policies-example",
71+
cislz-cmp-type = "security"
72+
}
6173
},
6274
APP-CMP = {
6375
name = "vision-application-cmp",
64-
description = "Vision Application compartment",
76+
description = "Vision Application compartment",
77+
freeform_tags = {
78+
cislz = "template-policies-example",
79+
cislz-cmp-type = "application"
80+
}
6581
},
6682
DB-CMP = {
6783
name = "vision-database-cmp",
68-
description = "Vision Database compartment",
84+
description = "Vision Database compartment",
85+
freeform_tags = {
86+
cislz = "template-policies-example",
87+
cislz-cmp-type = "database"
88+
}
6989
},
7090
EXACS-CMP = {
7191
name = "vision-exainfra-cmp",
72-
description = "Vision Exadata Cloud Service compartment",
92+
description = "Vision Exadata Cloud Service compartment",
93+
freeform_tags = {
94+
cislz = "template-policies-example",
95+
cislz-cmp-type = "exainfra"
96+
}
7397
}
7498
}
7599
}

identity-domains/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ This module requires Terraform binary version 1.3.0 or greater, as it relies on
2222
### IAM Permissions
2323

2424
This module requires the following OCI IAM permission:
25+
2526
```
2627
Allow group <group> to manage domains in tenancy
2728
```
29+
2830
## <a name="invoke">How to Invoke the Module</a>
2931

3032
Terraform modules can be invoked locally or remotely.

policies/examples/template-policies/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
## Introduction
44

5-
This example shows how to use [OCI Landing Zones IAM policy module](../..) to manage policies that are generated based on metadata that is associated to existing compartments. A matching compartments example is available at https://github.com/oracle-quickstart/terraform-oci-cis-landing-zone-iam-modules/compartments/examples/vision.
5+
This example shows how to use [OCI Landing Zones IAM policy module](../..) to manage policies that are generated based on metadata that is associated to existing compartments. A matching compartments example is available at https://github.com/oci-landing-zones/terraform-oci-modules-iam/tree/main/compartments/examples/vision.
66

7-
For compartment level policies (excluding Root compartment), the target compartments are obtained from a data source whose output is filtered based on freeform tag "cislz" with value "vision". The returned compartments are passed to the policy module via the *supplied_compartments* attribute. Each returned compartment is associated with metadata for appropriate policy generation based on the freeform tag "cislz-cmp-type" applied to each compartment.
7+
For compartment level policies (excluding Root compartment), the target compartments are obtained from a data source whose output is filtered based on freeform tag "cislz" with value "template-policies-example". The returned compartments are passed to the policy module via the *supplied_compartments* attribute. Each returned compartment is associated with metadata for appropriate policy generation based on the freeform tag "cislz-cmp-type" applied to each compartment.
88

99
For tenancy level policies (policies attached to Root compartment), a list of group names with their respective roles are passed to the module via the *groups_with_tenancy_level_roles* attribute.
1010

policies/examples/template-policies/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ locals {
7474
name : cmp.name,
7575
id : cmp.id,
7676
cislz_metadata : local.cislz_compartments_metadata[cmp.freeform_tags["cislz-cmp-type"]] #-- This example expects compartments to be freeform tagged with "cislz-cmp-type", so it can figure out the compartments intent and associate it with the appropriate metadata.
77-
}
78-
if lookup(cmp.freeform_tags, "cislz","") == "vision" #-- The compartments we are interested are freeform tagged as {"cislz" : "vision"} but you could identify the compartments through some other attributes that makes sense to your deployment.
77+
}
78+
if lookup(cmp.freeform_tags, "cislz","") == "template-policies-example" #-- The compartments we are interested are freeform tagged as {"cislz" : "template-policies-example"} but you could identify the compartments through some other attributes that makes sense to your deployment.
7979
}
8080

8181
policies_configuration = {

policies/network_cmp_policy.tf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ locals {
3939
"allow group ${values["net-group"]} to manage metrics in compartment ${values["name"]}",
4040
"allow group ${values["net-group"]} to manage keys in compartment ${values["name"]}",
4141
"allow group ${values["net-group"]} to use key-delegate in compartment ${values["name"]}",
42-
"allow group ${values["net-group"]} to manage secret-family in compartment ${values["name"]}"
42+
"allow group ${values["net-group"]} to manage secret-family in compartment ${values["name"]}",
43+
"allow group ${values["net-group"]} to manage network-firewall-family in compartment ${values["name"]}"
4344
#"allow group ${values["net-group"]} to read instance-agent-plugins in compartment ${values["name"]}"
4445
] : []
4546
}
@@ -61,7 +62,8 @@ locals {
6162
#-- Security admin grants on Network compartment
6263
security_admin_grants_on_network_cmp_map = {
6364
for k, values in local.cmp_name_to_cislz_tag_map : k => (contains(split(",",values["cmp-type"]),"network") && values["sec-group"] != null) ? [
64-
"allow group ${values["sec-group"]} to read keys in compartment ${values["name"]}"
65+
"allow group ${values["sec-group"]} to read keys in compartment ${values["name"]}",
66+
"allow group ${values["sec-group"]} to use network-firewall-family in compartment ${values["name"]}"
6567
] : []
6668
}
6769

policies/root_cmp_policy.tf

Lines changed: 37 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,19 @@ locals {
9494
security_admin_grants_on_root_cmp = contains(keys(local.group_name_map_transpose),local.security_role) ? [
9595
"allow group ${local.security_group_names} to manage cloudevents-rules in tenancy",
9696
"allow group ${local.security_group_names} to manage cloud-guard-family in tenancy",
97-
"allow group ${local.security_group_names} to read tenancies in tenancy"
97+
"allow group ${local.security_group_names} to read tenancies in tenancy",
98+
"allow group ${local.security_group_names} to manage zpr-configuration in tenancy",
99+
"allow group ${local.security_group_names} to manage zpr-policy in tenancy",
100+
"allow group ${local.security_group_names} to manage security-attribute-namespace in tenancy"
98101
#"allow group ${local.security_group_names} to read objectstorage-namespaces in tenancy"
99102
] : []
100103

104+
network_admin_grants_on_root_cmp = contains(keys(local.group_name_map_transpose),local.network_role) ? [
105+
"allow group ${local.network_group_names} to read zpr-configuration in tenancy",
106+
"allow group ${local.network_group_names} to read zpr-policy in tenancy",
107+
"allow group ${local.network_group_names} to read security-attribute-namespace in tenancy"
108+
] : []
109+
101110
objectstorage_read_grantees = compact(
102111
concat(contains(keys(local.group_name_map_transpose),local.network_role) ? [local.network_group_names] : [],
103112
contains(keys(local.group_name_map_transpose),local.security_role) ? [local.security_group_names] : [],
@@ -126,27 +135,31 @@ locals {
126135
] : []
127136

128137
auditor_grants = contains(keys(local.group_name_map_transpose),local.auditor_role) ? [
129-
"allow group ${local.auditor_group_names} to inspect all-resources in tenancy",
130-
"allow group ${local.auditor_group_names} to read instances in tenancy",
131-
"allow group ${local.auditor_group_names} to read load-balancers in tenancy",
132-
"allow group ${local.auditor_group_names} to read buckets in tenancy",
133-
"allow group ${local.auditor_group_names} to read nat-gateways in tenancy",
134-
"allow group ${local.auditor_group_names} to read public-ips in tenancy",
135-
"allow group ${local.auditor_group_names} to read file-family in tenancy",
136-
"allow group ${local.auditor_group_names} to read instance-configurations in tenancy",
137-
"allow group ${local.auditor_group_names} to read network-security-groups in tenancy",
138-
"allow group ${local.auditor_group_names} to read resource-availability in tenancy",
139-
"allow group ${local.auditor_group_names} to read audit-events in tenancy",
140-
"allow group ${local.auditor_group_names} to read users in tenancy",
141-
"allow group ${local.auditor_group_names} to use cloud-shell in tenancy",
142-
"allow group ${local.auditor_group_names} to read vss-family in tenancy",
143-
"allow group ${local.auditor_group_names} to read usage-budgets in tenancy",
144-
"allow group ${local.auditor_group_names} to read usage-reports in tenancy",
145-
"allow group ${local.auditor_group_names} to read data-safe-family in tenancy",
146-
"allow group ${local.auditor_group_names} to read vaults in tenancy",
147-
"allow group ${local.auditor_group_names} to read keys in tenancy",
148-
"allow group ${local.auditor_group_names} to read tag-namespaces in tenancy",
149-
"allow group ${local.auditor_group_names} to use ons-family in tenancy where any {request.operation!=/Create*/, request.operation!=/Update*/, request.operation!=/Delete*/, request.operation!=/Change*/}"
138+
"allow group ${local.auditor_group_names} to inspect all-resources in tenancy",
139+
"allow group ${local.auditor_group_names} to read instances in tenancy",
140+
"allow group ${local.auditor_group_names} to read load-balancers in tenancy",
141+
"allow group ${local.auditor_group_names} to read buckets in tenancy",
142+
"allow group ${local.auditor_group_names} to read nat-gateways in tenancy",
143+
"allow group ${local.auditor_group_names} to read public-ips in tenancy",
144+
"allow group ${local.auditor_group_names} to read file-family in tenancy",
145+
"allow group ${local.auditor_group_names} to read instance-configurations in tenancy",
146+
"allow group ${local.auditor_group_names} to read network-security-groups in tenancy",
147+
"allow group ${local.auditor_group_names} to read resource-availability in tenancy",
148+
"allow group ${local.auditor_group_names} to read audit-events in tenancy",
149+
"allow group ${local.auditor_group_names} to read users in tenancy",
150+
"allow group ${local.auditor_group_names} to use cloud-shell in tenancy",
151+
"allow group ${local.auditor_group_names} to read vss-family in tenancy",
152+
"allow group ${local.auditor_group_names} to read usage-budgets in tenancy",
153+
"allow group ${local.auditor_group_names} to read usage-reports in tenancy",
154+
"allow group ${local.auditor_group_names} to read data-safe-family in tenancy",
155+
"allow group ${local.auditor_group_names} to read vaults in tenancy",
156+
"allow group ${local.auditor_group_names} to read keys in tenancy",
157+
"allow group ${local.auditor_group_names} to read tag-namespaces in tenancy",
158+
"allow group ${local.auditor_group_names} to use ons-family in tenancy where any {request.operation!=/Create*/, request.operation!=/Update*/, request.operation!=/Delete*/, request.operation!=/Change*/}",
159+
"allow group ${local.auditor_group_names} to read zpr-configuration in tenancy",
160+
"allow group ${local.auditor_group_names} to read zpr-policy in tenancy",
161+
"allow group ${local.auditor_group_names} to read security-attribute-namespace in tenancy",
162+
"allow group ${local.auditor_group_names} to read network-firewall-family in tenancy"
150163
] : []
151164

152165
announcement_reader_grants = contains(keys(local.group_name_map_transpose),local.announcement_reader_role) ? [
@@ -155,7 +168,8 @@ locals {
155168

156169
root_cmp_admin_grants = concat(local.cost_admin_grants_on_root_cmp,local.iam_admin_grants_on_root_cmp,
157170
local.iam_admin_grants_on_enclosing_cmp,local.cred_admin_grants_on_root_cmp,
158-
local.security_admin_grants_on_root_cmp,local.security_admin_grants_on_enclosing_cmp)
171+
local.security_admin_grants_on_root_cmp,local.security_admin_grants_on_enclosing_cmp,
172+
local.network_admin_grants_on_root_cmp)
159173

160174
root_cmp_nonadmin_grants = concat(local.basic_grants_on_root_cmp,local.application_admin_grants_on_enclosing_cmp,
161175
local.auditor_grants,local.announcement_reader_grants, local.objectstorage_read_on_root_cmp)

release.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.2.4
1+
0.2.5

0 commit comments

Comments
 (0)