Blame SOURCES/0001-RHEL-only-Add-cockpit-by-default-to-some-zones.patch

e67a06
From 52d53cc4ab0503ad484330b2121f85094a7903de Mon Sep 17 00:00:00 2001
66253d
From: Eric Garver <e@erig.me>
66253d
Date: Mon, 9 Jul 2018 11:29:33 -0400
e67a06
Subject: [PATCH 1/6] RHEL only: Add cockpit by default to some zones
66253d
66253d
Fixes: #1581578
66253d
---
66253d
 config/zones/home.xml                 |  1 +
66253d
 config/zones/internal.xml             |  1 +
66253d
 config/zones/public.xml               |  1 +
66253d
 config/zones/work.xml                 |  1 +
e67a06
 src/tests/cli/firewall-cmd.at         | 14 +++++++++++++-
66253d
 src/tests/features/helpers_custom.at  |  9 +++++++++
66253d
 src/tests/features/service_include.at |  2 +-
66253d
 src/tests/regression/gh366.at         |  3 +++
66253d
 src/tests/regression/gh453.at         |  2 ++
66253d
 src/tests/regression/rhbz1514043.at   |  2 +-
66253d
 10 files changed, 33 insertions(+), 3 deletions(-)
66253d
66253d
diff --git a/config/zones/home.xml b/config/zones/home.xml
66253d
index 42b29b2f2d50..8aa8afa0e8aa 100644
66253d
--- a/config/zones/home.xml
66253d
+++ b/config/zones/home.xml
66253d
@@ -6,4 +6,5 @@
66253d
   <service name="mdns"/>
66253d
   <service name="samba-client"/>
66253d
   <service name="dhcpv6-client"/>
66253d
+  <service name="cockpit"/>
66253d
 </zone>
66253d
diff --git a/config/zones/internal.xml b/config/zones/internal.xml
66253d
index e646b48c94e8..40cb7e14424b 100644
66253d
--- a/config/zones/internal.xml
66253d
+++ b/config/zones/internal.xml
66253d
@@ -6,4 +6,5 @@
66253d
   <service name="mdns"/>
66253d
   <service name="samba-client"/>
66253d
   <service name="dhcpv6-client"/>
66253d
+  <service name="cockpit"/>
66253d
 </zone>
66253d
diff --git a/config/zones/public.xml b/config/zones/public.xml
66253d
index 49795d8c9068..617e131a4895 100644
66253d
--- a/config/zones/public.xml
66253d
+++ b/config/zones/public.xml
66253d
@@ -4,4 +4,5 @@
66253d
   <description>For use in public areas. You do not trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.</description>
66253d
   <service name="ssh"/>
66253d
   <service name="dhcpv6-client"/>
66253d
+  <service name="cockpit"/>
66253d
 </zone>
66253d
diff --git a/config/zones/work.xml b/config/zones/work.xml
66253d
index 6ea5550a40bd..9609ee6f65c2 100644
66253d
--- a/config/zones/work.xml
66253d
+++ b/config/zones/work.xml
66253d
@@ -4,4 +4,5 @@
66253d
   <description>For use in work areas. You mostly trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.</description>
66253d
   <service name="ssh"/>
66253d
   <service name="dhcpv6-client"/>
66253d
+  <service name="cockpit"/>
66253d
 </zone>
e67a06
diff --git a/src/tests/cli/firewall-cmd.at b/src/tests/cli/firewall-cmd.at
e67a06
index 806af74221b6..74f480f8730f 100644
e67a06
--- a/src/tests/cli/firewall-cmd.at
e67a06
+++ b/src/tests/cli/firewall-cmd.at
e67a06
@@ -1285,6 +1285,7 @@ FWD_START_TEST([rich rules priority])
66253d
         chain filter_IN_public_allow {
66253d
         tcp dport 22 ct state new,untracked accept
66253d
         ip6 daddr fe80::/64 udp dport 546 ct state new,untracked accept
66253d
+        tcp dport 9090 ct state new,untracked accept
66253d
         tcp dport 1122 ct state new,untracked accept
66253d
         tcp dport 3333 ct state new,untracked accept
66253d
         tcp dport 4444 ct state new,untracked accept
e67a06
@@ -1300,6 +1301,7 @@ FWD_START_TEST([rich rules priority])
66253d
     ])
66253d
     IPTABLES_LIST_RULES([filter], [IN_public_allow], 0, [dnl
66253d
         ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 ctstate NEW,UNTRACKED
66253d
+        ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:9090 ctstate NEW,UNTRACKED
66253d
         ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:1122 ctstate NEW,UNTRACKED
66253d
         ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:3333 ctstate NEW,UNTRACKED
66253d
         ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:4444 ctstate NEW,UNTRACKED
e67a06
@@ -1314,6 +1316,7 @@ FWD_START_TEST([rich rules priority])
66253d
     IP6TABLES_LIST_RULES([filter], [IN_public_allow], 0, [dnl
66253d
         ACCEPT tcp ::/0 ::/0 tcp dpt:22 ctstate NEW,UNTRACKED
66253d
         ACCEPT udp ::/0 fe80::/64 udp dpt:546 ctstate NEW,UNTRACKED
66253d
+        ACCEPT tcp ::/0 ::/0 tcp dpt:9090 ctstate NEW,UNTRACKED
66253d
         ACCEPT tcp ::/0 ::/0 tcp dpt:1122 ctstate NEW,UNTRACKED
66253d
         ACCEPT tcp ::/0 ::/0 tcp dpt:3333 ctstate NEW,UNTRACKED
66253d
         ACCEPT tcp ::/0 ::/0 tcp dpt:4444 ctstate NEW,UNTRACKED
e67a06
@@ -1395,6 +1398,7 @@ FWD_START_TEST([rich rules priority])
66253d
         chain filter_IN_public_allow {
66253d
         tcp dport 22 ct state new,untracked accept
66253d
         ip6 daddr fe80::/64 udp dport 546 ct state new,untracked accept
66253d
+        tcp dport 9090 ct state new,untracked accept
66253d
         }
66253d
         }
66253d
     ])
e67a06
@@ -1498,6 +1502,7 @@ FWD_START_TEST([rich rules priority])
66253d
     ])
66253d
     IPTABLES_LIST_RULES([filter], [IN_public_allow], 0, [dnl
66253d
         ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 ctstate NEW,UNTRACKED
66253d
+        ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:9090 ctstate NEW,UNTRACKED
66253d
     ])
66253d
     IPTABLES_LIST_RULES([filter], [FWDI_public_pre], 0, [dnl
66253d
     ])
e67a06
@@ -1532,6 +1537,7 @@ FWD_START_TEST([rich rules priority])
66253d
     IP6TABLES_LIST_RULES([filter], [IN_public_allow], 0, [dnl
66253d
         ACCEPT tcp ::/0 ::/0 tcp dpt:22 ctstate NEW,UNTRACKED
66253d
         ACCEPT udp ::/0 fe80::/64 udp dpt:546 ctstate NEW,UNTRACKED
66253d
+        ACCEPT tcp ::/0 ::/0 tcp dpt:9090 ctstate NEW,UNTRACKED
66253d
     ])
66253d
     IP6TABLES_LIST_RULES([filter], [FWDI_public_pre], 0, [dnl
66253d
     ])
e67a06
@@ -1579,6 +1585,7 @@ FWD_START_TEST([rich rules priority])
66253d
         chain filter_IN_public_allow {
66253d
         tcp dport 22 ct state new,untracked accept
66253d
         ip6 daddr fe80::/64 udp dport 546 ct state new,untracked accept
66253d
+        tcp dport 9090 ct state new,untracked accept
66253d
         icmp type echo-request accept
66253d
         icmpv6 type echo-request accept
66253d
         }
e67a06
@@ -1619,6 +1626,7 @@ FWD_START_TEST([rich rules priority])
66253d
     ])
66253d
     IPTABLES_LIST_RULES([filter], [IN_public_allow], 0, [dnl
66253d
         ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 ctstate NEW,UNTRACKED
66253d
+        ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:9090 ctstate NEW,UNTRACKED
66253d
         ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 icmptype 8
66253d
     ])
66253d
     IPTABLES_LIST_RULES([filter], [FWDI_public_pre], 0, [dnl
e67a06
@@ -1641,6 +1649,7 @@ FWD_START_TEST([rich rules priority])
66253d
     IP6TABLES_LIST_RULES([filter], [IN_public_allow], 0, [dnl
66253d
         ACCEPT tcp ::/0 ::/0 tcp dpt:22 ctstate NEW,UNTRACKED
66253d
         ACCEPT udp ::/0 fe80::/64 udp dpt:546 ctstate NEW,UNTRACKED
66253d
+        ACCEPT tcp ::/0 ::/0 tcp dpt:9090 ctstate NEW,UNTRACKED
66253d
         ACCEPT icmpv6 ::/0 ::/0 ipv6-icmptype 128
66253d
     ])
66253d
     IP6TABLES_LIST_RULES([filter], [FWDI_public_pre], 0, [dnl
e67a06
@@ -1697,6 +1706,7 @@ FWD_START_TEST([rich rules priority])
66253d
         chain filter_IN_public_allow {
66253d
         tcp dport 22 ct state new,untracked accept
66253d
         ip6 daddr fe80::/64 udp dport 546 ct state new,untracked accept
66253d
+        tcp dport 9090 ct state new,untracked accept
66253d
         }
66253d
         }
66253d
     ])
e67a06
@@ -1734,6 +1744,7 @@ FWD_START_TEST([rich rules priority])
66253d
     ])
66253d
     IPTABLES_LIST_RULES([filter], [IN_public_allow], 0, [dnl
66253d
         ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 ctstate NEW,UNTRACKED
66253d
+        ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:9090 ctstate NEW,UNTRACKED
66253d
     ])
66253d
     IPTABLES_LIST_RULES([filter], [IN_public_deny], 0, [dnl
66253d
     ])
e67a06
@@ -1754,6 +1765,7 @@ FWD_START_TEST([rich rules priority])
66253d
     IP6TABLES_LIST_RULES([filter], [IN_public_allow], 0, [dnl
66253d
         ACCEPT tcp ::/0 ::/0 tcp dpt:22 ctstate NEW,UNTRACKED
66253d
         ACCEPT udp ::/0 fe80::/64 udp dpt:546 ctstate NEW,UNTRACKED
66253d
+        ACCEPT tcp ::/0 ::/0 tcp dpt:9090 ctstate NEW,UNTRACKED
66253d
     ])
66253d
     IP6TABLES_LIST_RULES([filter], [IN_public_deny], 0, [dnl
66253d
     ])
e67a06
@@ -1779,7 +1791,7 @@ FWD_START_TEST([rich rules priority])
66253d
         icmp-block-inversion: no
66253d
         interfaces:
66253d
         sources:
66253d
-        services: dhcpv6-client ssh
66253d
+        services: cockpit dhcpv6-client ssh
66253d
         ports:
66253d
         protocols:
66253d
         masquerade: no
e67a06
diff --git a/src/tests/features/helpers_custom.at b/src/tests/features/helpers_custom.at
e67a06
index 41d0f17b1d9e..bd4b52cfb1d6 100644
e67a06
--- a/src/tests/features/helpers_custom.at
e67a06
+++ b/src/tests/features/helpers_custom.at
e67a06
@@ -37,6 +37,7 @@ NFT_LIST_RULES([inet], [filter_IN_public_allow], 0, [dnl
e67a06
         chain filter_IN_public_allow {
e67a06
             tcp dport 22 ct state new,untracked accept
e67a06
             ip6 daddr fe80::/64 udp dport 546 ct state new,untracked accept
e67a06
+            tcp dport 9090 ct state new,untracked accept
e67a06
             tcp dport 2121 ct helper set "helper-ftptest-tcp"
e67a06
             tcp dport 2121 ct state new,untracked accept
e67a06
         }
e67a06
@@ -47,6 +48,7 @@ IPTABLES_LIST_RULES([raw], [PRE_public_allow], 0, [dnl
e67a06
 ])
e67a06
 IPTABLES_LIST_RULES([filter], [IN_public_allow], 0, [dnl
e67a06
     ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 ctstate NEW,UNTRACKED
e67a06
+    ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:9090 ctstate NEW,UNTRACKED
e67a06
     ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:2121 ctstate NEW,UNTRACKED
e67a06
 ])
e67a06
 IP6TABLES_LIST_RULES([raw], [PRE_public_allow], 0, [dnl
e67a06
@@ -55,6 +57,7 @@ IP6TABLES_LIST_RULES([raw], [PRE_public_allow], 0, [dnl
e67a06
 IP6TABLES_LIST_RULES([filter], [IN_public_allow], 0, [dnl
e67a06
     ACCEPT tcp ::/0 ::/0 tcp dpt:22 ctstate NEW,UNTRACKED
e67a06
     ACCEPT udp ::/0 fe80::/64 udp dpt:546 ctstate NEW,UNTRACKED
e67a06
+    ACCEPT tcp ::/0 ::/0 tcp dpt:9090 ctstate NEW,UNTRACKED
e67a06
     ACCEPT tcp ::/0 ::/0 tcp dpt:2121 ctstate NEW,UNTRACKED
e67a06
 ])
e67a06
 
e67a06
@@ -91,6 +94,7 @@ NFT_LIST_RULES([inet], [filter_IN_public_allow], 0, [dnl
e67a06
         chain filter_IN_public_allow {
e67a06
             tcp dport 22 ct state new,untracked accept
e67a06
             ip6 daddr fe80::/64 udp dport 546 ct state new,untracked accept
e67a06
+            tcp dport 9090 ct state new,untracked accept
e67a06
             tcp dport 2121 ct helper set "helper-ftptest-tcp"
e67a06
             tcp dport 2121 ct state new,untracked accept
e67a06
         }
e67a06
@@ -101,6 +105,7 @@ IPTABLES_LIST_RULES([raw], [PRE_public_allow], 0, [dnl
e67a06
 ])
e67a06
 IPTABLES_LIST_RULES([filter], [IN_public_allow], 0, [dnl
e67a06
     ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 ctstate NEW,UNTRACKED
e67a06
+    ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:9090 ctstate NEW,UNTRACKED
e67a06
     ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:2121 ctstate NEW,UNTRACKED
e67a06
 ])
e67a06
 IP6TABLES_LIST_RULES([raw], [PRE_public_allow], 0, [dnl
e67a06
@@ -109,6 +114,7 @@ IP6TABLES_LIST_RULES([raw], [PRE_public_allow], 0, [dnl
e67a06
 IP6TABLES_LIST_RULES([filter], [IN_public_allow], 0, [dnl
e67a06
     ACCEPT tcp ::/0 ::/0 tcp dpt:22 ctstate NEW,UNTRACKED
e67a06
     ACCEPT udp ::/0 fe80::/64 udp dpt:546 ctstate NEW,UNTRACKED
e67a06
+    ACCEPT tcp ::/0 ::/0 tcp dpt:9090 ctstate NEW,UNTRACKED
e67a06
     ACCEPT tcp ::/0 ::/0 tcp dpt:2121 ctstate NEW,UNTRACKED
e67a06
 ])
e67a06
 
e67a06
@@ -126,6 +132,7 @@ NFT_LIST_RULES([inet], [filter_IN_public_allow], 0, [dnl
e67a06
         chain filter_IN_public_allow {
e67a06
             tcp dport 22 ct state new,untracked accept
e67a06
             ip6 daddr fe80::/64 udp dport 546 ct state new,untracked accept
e67a06
+            tcp dport 9090 ct state new,untracked accept
e67a06
             tcp dport 21 ct helper set "helper-ftp-tcp"
e67a06
             tcp dport 2121 ct helper set "helper-ftptest-tcp"
e67a06
             tcp dport 2121 ct state new,untracked accept
e67a06
@@ -139,6 +146,7 @@ IPTABLES_LIST_RULES([raw], [PRE_public_allow], 0, [dnl
e67a06
 ])
e67a06
 IPTABLES_LIST_RULES([filter], [IN_public_allow], 0, [dnl
e67a06
     ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 ctstate NEW,UNTRACKED
e67a06
+    ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:9090 ctstate NEW,UNTRACKED
e67a06
     ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:2121 ctstate NEW,UNTRACKED
e67a06
     ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:21 ctstate NEW,UNTRACKED
e67a06
 ])
e67a06
@@ -149,6 +157,7 @@ IP6TABLES_LIST_RULES([raw], [PRE_public_allow], 0, [dnl
e67a06
 IP6TABLES_LIST_RULES([filter], [IN_public_allow], 0, [dnl
e67a06
     ACCEPT tcp ::/0 ::/0 tcp dpt:22 ctstate NEW,UNTRACKED
e67a06
     ACCEPT udp ::/0 fe80::/64 udp dpt:546 ctstate NEW,UNTRACKED
e67a06
+    ACCEPT tcp ::/0 ::/0 tcp dpt:9090 ctstate NEW,UNTRACKED
e67a06
     ACCEPT tcp ::/0 ::/0 tcp dpt:2121 ctstate NEW,UNTRACKED
e67a06
     ACCEPT tcp ::/0 ::/0 tcp dpt:21 ctstate NEW,UNTRACKED
e67a06
 ])
e67a06
diff --git a/src/tests/features/service_include.at b/src/tests/features/service_include.at
e67a06
index 7f02701a9419..070f1578fc2b 100644
e67a06
--- a/src/tests/features/service_include.at
e67a06
+++ b/src/tests/features/service_include.at
e67a06
@@ -120,7 +120,7 @@ FWD_CHECK([--zone=drop --list-services], 0, [dnl
e67a06
 
e67a06
 ])
e67a06
 FWD_CHECK([--zone=public --list-services], 0, [dnl
e67a06
-dhcpv6-client ssh
e67a06
+cockpit dhcpv6-client ssh
e67a06
 ])
e67a06
 FWD_CHECK([-q --permanent --service=my-service-with-include --remove-include=does-not-exist])
e67a06
 FWD_RELOAD
66253d
diff --git a/src/tests/regression/gh366.at b/src/tests/regression/gh366.at
66253d
index 1441a6be53bf..51ff504e6a9d 100644
66253d
--- a/src/tests/regression/gh366.at
66253d
+++ b/src/tests/regression/gh366.at
66253d
@@ -7,6 +7,7 @@ table inet firewalld {
66253d
 chain filter_IN_public_allow {
66253d
 tcp dport 22 ct state new,untracked accept
66253d
 ip6 daddr fe80::/64 udp dport 546 ct state new,untracked accept
66253d
+tcp dport 9090 ct state new,untracked accept
66253d
 ip daddr 224.0.0.251 udp dport 5353 ct state new,untracked accept
66253d
 ip6 daddr ff02::fb udp dport 5353 ct state new,untracked accept
66253d
 }
66253d
@@ -14,11 +15,13 @@ ip6 daddr ff02::fb udp dport 5353 ct state new,untracked accept
66253d
 ])
66253d
 IPTABLES_LIST_RULES([filter], [IN_public_allow], 0, [dnl
66253d
 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 ctstate NEW,UNTRACKED
66253d
+ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:9090 ctstate NEW,UNTRACKED
66253d
 ACCEPT udp -- 0.0.0.0/0 224.0.0.251 udp dpt:5353 ctstate NEW,UNTRACKED
66253d
 ])
66253d
 IP6TABLES_LIST_RULES([filter], [IN_public_allow], 0, [dnl
66253d
 ACCEPT tcp ::/0 ::/0 tcp dpt:22 ctstate NEW,UNTRACKED
66253d
 ACCEPT udp ::/0 fe80::/64 udp dpt:546 ctstate NEW,UNTRACKED
66253d
+ACCEPT tcp ::/0 ::/0 tcp dpt:9090 ctstate NEW,UNTRACKED
66253d
 ACCEPT udp ::/0 ff02::fb udp dpt:5353 ctstate NEW,UNTRACKED
66253d
 ])])
66253d
 
66253d
diff --git a/src/tests/regression/gh453.at b/src/tests/regression/gh453.at
e67a06
index 36a6fce5f22a..61bc90aae673 100644
66253d
--- a/src/tests/regression/gh453.at
66253d
+++ b/src/tests/regression/gh453.at
66253d
@@ -18,6 +18,7 @@ NFT_LIST_RULES([inet], [filter_IN_public_allow], 0, [dnl
e67a06
     chain filter_IN_public_allow {
e67a06
     tcp dport 22 ct state new,untracked accept
e67a06
     ip6 daddr fe80::/64 udp dport 546 ct state new,untracked accept
e67a06
+    tcp dport 9090 ct state new,untracked accept
e67a06
     tcp dport 21 ct helper set "helper-ftp-tcp"
e67a06
     tcp dport 21 ct state new,untracked accept
e67a06
     }
66253d
@@ -42,6 +43,7 @@ NFT_LIST_RULES([inet], [filter_IN_public_allow], 0, [dnl
e67a06
     chain filter_IN_public_allow {
e67a06
     tcp dport 22 ct state new,untracked accept
e67a06
     ip6 daddr fe80::/64 udp dport 546 ct state new,untracked accept
e67a06
+    tcp dport 9090 ct state new,untracked accept
e67a06
     tcp dport 21 ct helper set "helper-ftp-tcp"
e67a06
     tcp dport 21 ct state new,untracked accept
e67a06
     tcp dport 5060 ct helper set "helper-sip-tcp"
66253d
diff --git a/src/tests/regression/rhbz1514043.at b/src/tests/regression/rhbz1514043.at
66253d
index efc33e09478b..241cf547f7f3 100644
66253d
--- a/src/tests/regression/rhbz1514043.at
66253d
+++ b/src/tests/regression/rhbz1514043.at
66253d
@@ -5,7 +5,7 @@ FWD_CHECK([-q --set-log-denied=all])
66253d
 FWD_CHECK([-q --permanent --zone=public --add-service=samba])
66253d
 FWD_RELOAD
66253d
 FWD_CHECK([--zone=public --list-all | TRIM | grep ^services], 0, [dnl
66253d
-services: dhcpv6-client samba ssh
66253d
+services: cockpit dhcpv6-client samba ssh
66253d
 ])
66253d
 
66253d
 dnl check that log denied actually took effect
66253d
-- 
66253d
2.23.0
66253d