-
Notifications
You must be signed in to change notification settings - Fork 210
/
sample_k8s.pol
88 lines (76 loc) · 1.78 KB
/
sample_k8s.pol
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
#
# This is an example policy for capirca
# Target defaults to INGRESS is not specified in the header
#
header {
comment:: "this is a sample policy to generate Kubernetes NetworkPolicy filter"
target:: k8s
}
term test-ssh {
comment:: "Allow SSH access to all pods from company."
source-address:: PUBLIC_NAT
protocol:: tcp
destination-port:: SSH
action:: accept
}
term test-web {
comment:: "Allow HTTP to pods"
source-address:: ANY
protocol:: tcp
destination-port:: HTTP
action:: accept
}
term test-multiple-protocols {
comment:: "Allow TCP/UDP access to all pods from company."
source-address:: PUBLIC_NAT
protocol:: tcp udp
destination-port:: HIGH_PORTS
action:: accept
}
term test-multiple-protocols-tcp-sctp {
comment:: "Allow all tcp and sctp."
source-address:: PUBLIC_NAT
protocol:: tcp sctp
action:: accept
}
term test-internal {
comment:: "Allow all network internal traffic."
source-address:: RFC1918
protocol:: tcp udp
action:: accept
}
term default-deny {
action:: deny
}
#
# Sample EGRESS policy
# If source-tag is included, it maps to targetTags in the Kubernetes NetworkPolicy Egress rule
#
header {
comment:: "this is a sample policy to generate EGRESS Kubernetes NetworkPolicy filter"
target:: k8s EGRESS
}
term test-egress-address {
comment:: "Outbound to Mail Server"
protocol:: tcp
destination-port:: SMTP
destination-address:: MAIL_SERVERS
action:: accept
}
term test-egress-tag {
comment:: "Outbound to RFC1918"
protocol:: tcp
destination-port:: SSH
destination-address:: PUBLIC_NAT
action:: accept
}
term test-egress-address-v6-only {
comment:: "Outbound to IPv6 Server"
protocol:: tcp
destination-port:: SMTP
destination-address:: PUBLIC_IPV6_SERVERS
action:: accept
}
term default-deny {
action:: deny
}