-
Notifications
You must be signed in to change notification settings - Fork 910
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
629 additions
and
736 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,13 +9,22 @@ Yaml abstraction for Groups can simplify groups creation and members management. | |
### Terraform code | ||
|
||
```hcl | ||
module "prod-firewall" { | ||
source = "./fabric/blueprints/factories/cloud-identity-group-factory" | ||
module "groups" { | ||
source = "./fabric/blueprints/factories/cloud-identity-group-factory" | ||
customer_id = "customers/C0xxxxxxx" | ||
data_dir = "data" | ||
} | ||
# tftest skip | ||
# tftest modules=2 resources=3 files=group1 inventory=example.yaml | ||
``` | ||
|
||
```yaml | ||
# tftest-file id=group1 path=data/[email protected] | ||
display_name: Group 1 | ||
description: Group 1 | ||
members: | ||
- [email protected] | ||
managers: | ||
- [email protected] | ||
``` | ||
### Configuration Structure | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,8 +17,8 @@ module "prod-firewall" { | |
project_id = "my-prod-project" | ||
network = "my-prod-network" | ||
config_directories = [ | ||
"./prod", | ||
"./common" | ||
"./firewall/prod", | ||
"./firewall/common" | ||
] | ||
log_config = { | ||
|
@@ -32,13 +32,86 @@ module "dev-firewall" { | |
project_id = "my-dev-project" | ||
network = "my-dev-network" | ||
config_directories = [ | ||
"./dev", | ||
"./common" | ||
"./firewall/dev", | ||
"./firewall/common" | ||
] | ||
} | ||
# tftest skip | ||
# tftest modules=2 resources=16 files=common,dev,prod inventory=example.yaml | ||
``` | ||
|
||
```yaml | ||
# tftest-file id=common path=firewall/common/common.yaml | ||
# allow ingress from GCLB to all instances in the network | ||
lb-health-checks: | ||
allow: | ||
- ports: [] | ||
protocol: tcp | ||
direction: INGRESS | ||
priority: 1001 | ||
source_ranges: | ||
- 35.191.0.0/16 | ||
- 130.211.0.0/22 | ||
|
||
# deny all egress | ||
deny-all: | ||
deny: | ||
- ports: [] | ||
protocol: all | ||
direction: EGRESS | ||
priority: 65535 | ||
destination_ranges: | ||
- 0.0.0.0/0 | ||
``` | ||
```yaml | ||
# tftest-file id=dev path=firewall/dev/app.yaml | ||
# Myapp egress | ||
web-app-dev-egress: | ||
allow: | ||
- ports: [443] | ||
protocol: tcp | ||
direction: EGRESS | ||
destination_ranges: | ||
- 192.168.0.0/24 | ||
target_service_accounts: | ||
- [email protected] | ||
# Myapp ingress | ||
web-app-dev-ingress: | ||
allow: | ||
- ports: [1234] | ||
protocol: tcp | ||
direction: INGRESS | ||
source_service_accounts: | ||
- [email protected] | ||
target_service_accounts: | ||
- [email protected] | ||
``` | ||
```yaml | ||
# tftest-file id=prod path=firewall/prod/app.yaml | ||
# Myapp egress | ||
web-app-prod-egress: | ||
allow: | ||
- ports: [443] | ||
protocol: tcp | ||
direction: EGRESS | ||
destination_ranges: | ||
- 192.168.10.0/24 | ||
target_service_accounts: | ||
- [email protected] | ||
# Myapp ingress | ||
web-app-prod-ingress: | ||
allow: | ||
- ports: [1234] | ||
protocol: tcp | ||
direction: INGRESS | ||
source_service_accounts: | ||
- [email protected] | ||
target_service_accounts: | ||
- [email protected] | ||
``` | ||
### Configuration Structure | ||
```bash | ||
|
@@ -86,54 +159,6 @@ rule-name: # descriptive name, naming convention is adjusted by the module | |
- [email protected] | ||
``` | ||
Firewall rules example yaml configuration | ||
```bash | ||
cat ./prod/core-network/common-rules.yaml | ||
# allow ingress from GCLB to all instances in the network | ||
lb-health-checks: | ||
allow: | ||
- ports: [] | ||
protocol: tcp | ||
direction: INGRESS | ||
priority: 1001 | ||
source_ranges: | ||
- 35.191.0.0/16 | ||
- 130.211.0.0/22 | ||
|
||
# deny all egress | ||
deny-all: | ||
deny: | ||
- ports: [] | ||
protocol: all | ||
direction: EGRESS | ||
priority: 65535 | ||
destination_ranges: | ||
- 0.0.0.0/0 | ||
|
||
cat ./dev/team-a/web-app-a.yaml | ||
# Myapp egress | ||
web-app-a-egress: | ||
allow: | ||
- ports: [443] | ||
protocol: tcp | ||
direction: EGRESS | ||
destination_ranges: | ||
- 192.168.0.0/24 | ||
target_service_accounts: | ||
- [email protected] | ||
# Myapp ingress | ||
web-app-a-ingress: | ||
allow: | ||
- ports: [1234] | ||
protocol: tcp | ||
direction: INGRESS | ||
source_service_accounts: | ||
- [email protected] | ||
target_service_accounts: | ||
- [email protected] | ||
``` | ||
<!-- BEGIN TFDOC --> | ||
## Variables | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,8 @@ kms_service_agents: | |
|
||
# [opt] Labels for the project - merged with the ones defined in defaults | ||
labels: | ||
environment: dev | ||
environment: dev2 | ||
costcenter: apps | ||
|
||
# [opt] Org policy overrides defined at project level | ||
org_policies: | ||
|
@@ -70,7 +71,7 @@ service_accounts: | |
another-service-account: | ||
- roles/compute.admin | ||
my-service-account: | ||
- roles/compute.admin | ||
- roles/compute.adminv1 | ||
|
||
# [opt] APIs to enable on the project. | ||
services: | ||
|
@@ -103,4 +104,4 @@ vpc: | |
subnets_iam: | ||
europe-west1/dev-default-ew1: | ||
- user:[email protected] | ||
- serviceAccount:service-account1 | ||
- serviceAccount:my-service-account |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.