cleanup: Fuel: docker: remove obsolete ffi patch
[armband.git] / patches / opnfv-fuel / 0004-post-scripts-Allow-SSH-on-non-admin-ifaces.patch
1 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
2 : Copyright (c) 2017 Enea AB and others.
3 :
4 : All rights reserved. This program and the accompanying materials
5 : are made available under the terms of the Apache License, Version 2.0
6 : which accompanies this distribution, and is available at
7 : http://www.apache.org/licenses/LICENSE-2.0
8 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
9 From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
10 Date: Tue, 12 Jul 2016 16:12:25 +0200
11 Subject: [PATCH] post-scripts: Allow SSH on non-admin ifaces.
12
13 By default, Fuel 9.0 configures iptables to only accept SSH connections
14 on admin interface.
15
16 If more than the admin interface is configured (e.g. by transplant script
17 or manually in fuel menu), whitelist SSH connections on all ifaces.
18
19 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
20 ---
21  .../post-scripts/10_accept_ssh_all_ifaces.sh       | 25 ++++++++++++++++++++++
22  1 file changed, 25 insertions(+)
23  create mode 100755 build/f_isoroot/f_bootstrap/post-scripts/10_accept_ssh_all_ifaces.sh
24
25 diff --git a/build/f_isoroot/f_bootstrap/post-scripts/10_accept_ssh_all_ifaces.sh b/build/f_isoroot/f_bootstrap/post-scripts/10_accept_ssh_all_ifaces.sh
26 new file mode 100755
27 index 0000000..b551516
28 --- /dev/null
29 +++ b/build/f_isoroot/f_bootstrap/post-scripts/10_accept_ssh_all_ifaces.sh
30 @@ -0,0 +1,25 @@
31 +#/bin/sh
32 +##############################################################################
33 +# Copyright (c) 2016 Enea AB and others.
34 +# Alexandru.Avadanii@enea.com
35 +# All rights reserved. This program and the accompanying materials
36 +# are made available under the terms of the Apache License, Version 2.0
37 +# which accompanies this distribution, and is available at
38 +# http://www.apache.org/licenses/LICENSE-2.0
39 +##############################################################################
40 +
41 +# Only mess with iptables if we have additional interfaces configured
42 +if grep -q "DEFROUTE=no" "/etc/sysconfig/network-scripts/ifcfg-eth0"; then
43 +  echo "iptables: Allow SSH connections on all interfaces"
44 +  # By default, Fuel 9.0 configures iptables to only accept SSH connections
45 +  # on admin interface. Whitelist SSH connections on all ifaces.
46 +  while [ $? -eq 0 ]; do
47 +    # First, try removing the rule we want to add to prevent duplicates
48 +    iptables -D INPUT -p tcp --dport ssh -j ACCEPT > /dev/null 2>&1;
49 +  done
50 +  iptables -A INPUT -p tcp --dport ssh -j ACCEPT
51 +  service iptables save
52 +  echo "iptables: Done configuring SSH"
53 +else
54 +  echo "iptables: Skipping configuring SSH for non-admin ifaces"
55 +fi