Multiple services exposed over network / firewall refactor
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Fuel for OpenStack |
Fix Committed
|
High
|
Maksim Malchuk | ||
8.0.x |
Won't Fix
|
High
|
Fuel Library (Deprecated) | ||
Mitaka |
Fix Released
|
High
|
Maksim Malchuk |
Bug Description
Observed on Fuel master:
release: "8.0"
openstack_
api: "1.0"
build_number: "264"
Problem description:
It was observed that on Fuel master node the default firewall INPUT policy is set to 'ACCEPT' rather than to 'DROP'.
This leads to exposure of unnecessary services over a potentially untrusted networks.
# iptables -L -n
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 /* 002 accept related established rules */ state RELATED,ESTABLISHED
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 multiport ports 22 /* 005 ssh */
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 multiport ports 123 /* 006 ntp */
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 multiport ports 123 /* 007 ntp_udp */
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 multiport ports 162 /* 008 snmp */
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 multiport ports 8000 /* 009 nailgun_web */
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 multiport ports 8001 /* 010 nailgun_internal */
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 multiport ports 8001 ADDRTYPE match src-type LOCAL /* 011 nailgun_
REJECT tcp -- 0.0.0.0/0 0.0.0.0/0 multiport ports 8001 /* 012 nailgun_
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 multiport ports 5432 ADDRTYPE match src-
(.....)
Solution proposal:
Refactor firewall rules to match the following criterias:
1. Allow all necessary services to be reached only from ADMIN/PXE network segment (ADMIN/PXE network IP addressing as provided by user during Fuel menu installation phase). All other network segments should not be allowed to reach possibly sensitive services like RabbitMQ, Erlang, dnsmasq and similar.
2. Allow Fuel Web (8000, 8443) and Fuel API to be reached from any source IP address.
3. Allow SSH network access only from IP subnets provided during Fuel menu installation phase (it is possible to define up to 2 networks during Fuel menu).
All other INPUT network traffic should be denied (DROP).
Changed in fuel: | |
importance: | Undecided → Medium |
milestone: | none → 8.0 |
importance: | Medium → High |
Changed in fuel: | |
assignee: | nobody → Fuel Library Team (fuel-library) |
tags: | added: area-library |
Changed in fuel: | |
status: | New → Confirmed |
tags: | added: team-bugfix |
Changed in fuel: | |
assignee: | Fuel Library Team (fuel-library) → Kyrylo Galanov (kgalanov) |
Changed in fuel: | |
importance: | High → Medium |
Changed in fuel: | |
importance: | Medium → High |
Changed in fuel: | |
status: | Confirmed → Triaged |
status: | Triaged → Confirmed |
Changed in fuel: | |
assignee: | Kyrylo Galanov (kgalanov) → Sergii Golovatiuk (sgolovatiuk) |
Changed in fuel: | |
importance: | High → Medium |
Changed in fuel: | |
importance: | Medium → High |
Changed in fuel: | |
milestone: | 8.0 → 9.0 |
Changed in fuel: | |
assignee: | Sergii Golovatiuk (sgolovatiuk) → Fuel Library Team (fuel-library) |
Changed in fuel: | |
assignee: | Fuel Library Team (fuel-library) → Dmitry Bilunov (dbilunov) |
Changed in fuel: | |
status: | Confirmed → In Progress |
Changed in fuel: | |
assignee: | Dmitry Bilunov (dbilunov) → Maksim Malchuk (mmalchuk) |
Changed in fuel: | |
milestone: | 9.0 → 10.0 |
Changed in fuel: | |
status: | In Progress → Fix Committed |
tags: | added: on-verification |
We have 'REJECT' rules in the end of INPUT and FORWARD chains:
[root@nailgun ~]# iptables -L INPUT -n -v | tail -2 prohibited prohibited
0 0 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-
0 0 LOG tcp -- * * 0.0.0.0/0 0.0.0.0/0 /* 999 iptables denied */ limit: avg 5/min burst 5 LOG flags 0 level 7 prefix "iptables denied: "
[root@nailgun ~]# iptables -L FORWARD -n -v | tail -2
13927 45M ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 /* 051 forward admin_net conntrack */ ctstate RELATED,ESTABLISHED
0 0 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-
But as far as I know it came to Fuel with CentOS 7 support, so I'm also for setting default 'DROP' policy explicitly (by puppet) for those chains.
>1. Allow all necessary services to be reached only from ADMIN/PXE network segment (ADMIN/PXE network IP addressing as provided by user during Fuel menu installation phase). All other network segments should not be allowed to reach possibly sensitive services like RabbitMQ, Erlang, dnsmasq and similar.
Currently we allow such traffic from any IP, but restrict it only for admin/pxe L2 network (input interface) and we have a reason for that - new admin networks could be created after master node setup using Nailgun API. I'm talking about multi racks feature. So nodes from other racks also need access to the services on master node, but they have IP addresses which are not known by puppet during Fuel setup. That's why I think we should keep our current policy as is, but strongly recommend users do not allow access to hosts in admin/pxe network from the outside.