-
Notifications
You must be signed in to change notification settings - Fork 0
/
panos_plan.tf
97 lines (89 loc) · 2.36 KB
/
panos_plan.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
terraform {
required_providers {
panos = {
source = "PaloAltoNetworks/panos"
version = "1.10.3"
}
}
}
provider "panos" {
hostname = "${var.hostname}"
username = "${var.username}"
password = "${var.password}"
}
resource "panos_ethernet_interface" "eth3" {
name = "ethernet1/3"
vsys = "vsys1"
mode = "layer3"
enable_dhcp = true
create_dhcp_default_route = true
}
resource "panos_ethernet_interface" "eth4" {
name = "ethernet1/4"
vsys = "vsys1"
mode = "layer3"
enable_dhcp = true
}
resource "panos_virtual_router" "vr" {
name = "default"
interfaces = [
"${panos_ethernet_interface.eth3.name}",
"${panos_ethernet_interface.eth4.name}"
]
}
resource "panos_zone" "int" {
name = "L3-trust"
mode = "layer3"
interfaces = ["${panos_ethernet_interface.eth3.name}"]
}
resource "panos_zone" "ext" {
name = "L3-untrust"
mode = "layer3"
interfaces = ["${panos_ethernet_interface.eth4.name}"]
}
resource "panos_address_object" "wp" {
name = "wordpress server"
description = "Internal server"
value = "10.1.23.45"
}
resource "panos_security_rule_group" "policy" {
rule {
name = "Wordpress Traffic"
source_zones = ["${panos_zone.ext.name}"]
source_addresses = ["any"]
source_users = ["any"]
hip_profiles = ["any"]
destination_zones = ["${panos_zone.int.name}"]
destination_addresses = ["any"]
applications = ["web-browsing"]
services = ["application-default"]
categories = ["any"]
action = "allow"
}
rule {
name = "Outbound"
source_zones = ["${panos_zone.int.name}"]
source_addresses = ["any"]
source_users = ["any"]
hip_profiles = ["any"]
destination_zones = ["${panos_zone.ext.name}"]
destination_addresses = ["any"]
applications = ["any"]
services = ["application-default"]
categories = ["any"]
action = "allow"
}
rule {
name = "Default Deny"
source_zones = ["any"]
source_addresses = ["any"]
source_users = ["any"]
hip_profiles = ["any"]
destination_zones = ["any"]
destination_addresses = ["any"]
applications = ["any"]
services = ["application-default"]
categories = ["any"]
action = "deny"
}
}