Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guacamole updates firewall with deployment pipeline #2371

Merged
merged 7 commits into from
Jul 31, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions templates/shared_services/firewall/.gitignore

This file was deleted.

30 changes: 0 additions & 30 deletions templates/shared_services/firewall/Dockerfile.tmpl

This file was deleted.

6 changes: 6 additions & 0 deletions templates/shared_services/firewall/parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@
"env": "RULE_COLLECTIONS"
}
},
{
"name": "network_rule_collections",
"source": {
"env": "NETWORK_RULE_COLLECTIONS"
}
},
{
"name": "stateful_resources_locked",
"source": {
Expand Down
15 changes: 11 additions & 4 deletions templates/shared_services/firewall/porter.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
name: tre-shared-service-firewall
version: 0.3.2
version: 0.4.0
description: "An Azure TRE Firewall shared service"
registry: azuretre
dockerfile: Dockerfile.tmpl

credentials:
- name: azure_tenant_id
Expand Down Expand Up @@ -39,15 +38,20 @@ parameters:
- name: rule_collections
type: string
default: "W10=" # b64 for []
description: "Application rule collection array"
- name: network_rule_collections
type: string
default: "W10=" # b64 for []
description: "Network rule collection array"
- name: stateful_resources_locked
env: STATEFUL_RESOURCES_LOCKED
type: boolean
default: true

mixins:
- exec
- terraform:
clientVersion: 1.1.5
initFile: providers.tf
clientVersion: 1.2.5

install:
- terraform:
Expand All @@ -57,6 +61,7 @@ install:
tre_id: "{{ bundle.parameters.tre_id }}"
tre_resource_id: "{{ bundle.parameters.id }}"
api_driven_rule_collections_b64: "{{ bundle.parameters.rule_collections }}"
api_driven_network_rule_collections_b64: "{{ bundle.parameters.network_rule_collections }}"
stateful_resources_locked: "{{ bundle.parameters.stateful_resources_locked }}"
backendConfig:
resource_group_name: "{{ bundle.parameters.tfstate_resource_group_name }}"
Expand All @@ -72,6 +77,7 @@ upgrade:
tre_id: "{{ bundle.parameters.tre_id }}"
tre_resource_id: "{{ bundle.parameters.id }}"
api_driven_rule_collections_b64: "{{ bundle.parameters.rule_collections }}"
api_driven_network_rule_collections_b64: "{{ bundle.parameters.network_rule_collections }}"
stateful_resources_locked: "{{ bundle.parameters.stateful_resources_locked }}"
backendConfig:
resource_group_name: "{{ bundle.parameters.tfstate_resource_group_name }}"
Expand All @@ -87,6 +93,7 @@ uninstall:
tre_id: "{{ bundle.parameters.tre_id }}"
tre_resource_id: "{{ bundle.parameters.id }}"
api_driven_rule_collections_b64: "{{ bundle.parameters.rule_collections }}"
api_driven_network_rule_collections_b64: "{{ bundle.parameters.network_rule_collections }}"
stateful_resources_locked: "{{ bundle.parameters.stateful_resources_locked }}"
backendConfig:
resource_group_name: "{{ bundle.parameters.tfstate_resource_group_name }}"
Expand Down
174 changes: 174 additions & 0 deletions templates/shared_services/firewall/template_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,180 @@
}
}
}
},
"network_rule_collections": {
"$id": "#properties/network_rule_collections",
"title": "network_rule_collections",
"type": "array",
"default": [],
"updateable": true,
"items":{
"title": "items",
"type": "object",
"required": [
"name",
"action",
"rules"
],
"properties": {
"name": {
"title": "name",
"type": "string",
"examples": [
"my-rule"
],
"pattern": "^.*$"
},
"priority": {
"title": "priority",
"type": "integer",
"description": "Numeric priority for rule collection - leave blank for auto numbering",
"examples": [
110
]
},
"action": {
"title": "action",
"type": "string",
"examples": [
"Allow"
],
"enum": [
"Allow",
"Deny"
]
},
"rules": {
"title": "rules",
"type": "array",
"default": [],
"items":{
"title": "Items",
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"title": "name",
"type": "string",
"examples": [
"rule 1"
],
"pattern": "^.{5,80}$"
},
"description": {
"title": "description",
"type": "string",
"default": "",
"examples": [
"My rule description here"
],
"pattern": "^.*$"
},
"source_addresses": {
"title": "Source_addresses",
"type": "array",
"default": [],
"items":{
"title": "Items",
"type": "string",
"default": "",
"examples": [
"172.196.0.0"
]
}
},
"source_ip_groups": {
"title": "Source_ip_groups",
"type": "array",
"default": [],
"items":{
"title": "Items",
"type": "string",
"default": "",
"examples": [
"some_ip_group_name"
]
}
},
"destination_addresses": {
"title": "Destination_addresses",
"type": "array",
"default": [],
"items":{
"title": "Items",
"type": "string",
"default": "",
"examples": [
"172.196.0.0"
]
}
},
"destination_ip_groups": {
"title": "Destination_ip_groups",
"type": "array",
"default": [],
"items":{
"title": "Items",
"type": "string",
"default": "",
"examples": [
"some_ip_group_name"
]
}
},
"destination_fqdns": {
"title": "Destination_fqdns",
"type": "array",
"default": [],
"items":{
"title": "Items",
"type": "string",
"default": "",
"examples": [
"one.two.three.com"
]
}
},
"destination_ports": {
"title": "Destination_ports",
"type": "array",
"default": [],
"items":{
"title": "Items",
"type": "string",
"default": "",
"examples": [
"80",
"443",
"*"
]
}
},
"protocols": {
"title": "protocols",
"type": "array",
"default": [],
"items":{
"title": "Items",
"type": "string",
"enum": [
"Any",
"ICMP",
"TCP",
"UDP"
],
"examples": [
"TCP"
]
}
}
}
}
}
}
}
}
}
}
22 changes: 22 additions & 0 deletions templates/shared_services/firewall/terraform/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions templates/shared_services/firewall/terraform/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ data "azurerm_subnet" "web_app" {
resource_group_name = local.core_resource_group_name
}

data "azurerm_subnet" "airlock_processor" {
name = "AirlockProcessorSubnet"
virtual_network_name = "vnet-${var.tre_id}"

resource_group_name = local.core_resource_group_name
}

data "azurerm_subnet" "airlock_storage" {
name = "AirlockStorageSubnet"
virtual_network_name = "vnet-${var.tre_id}"
Expand Down
Loading