You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2015/02/06 11:01:06 UTC

[1/2] git commit: updated refs/heads/4.5 to 81994cf

Repository: cloudstack
Updated Branches:
  refs/heads/4.5 cf7a8cc05 -> 81994cf44


rc.local: add missing license header

Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/671248b3
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/671248b3
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/671248b3

Branch: refs/heads/4.5
Commit: 671248b3e157cadb6981359fe314c437d0cfeacb
Parents: cf7a8cc
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Fri Feb 6 14:58:21 2015 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Fri Feb 6 14:58:21 2015 +0530

----------------------------------------------------------------------
 systemvm/patches/debian/config/etc/rc.local | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/671248b3/systemvm/patches/debian/config/etc/rc.local
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/etc/rc.local b/systemvm/patches/debian/config/etc/rc.local
index fd3488e..4b2c6a1 100755
--- a/systemvm/patches/debian/config/etc/rc.local
+++ b/systemvm/patches/debian/config/etc/rc.local
@@ -1,5 +1,22 @@
 #/bin/bash
 
+#Licensed to the Apache Software Foundation (ASF) under one
+#or more contributor license agreements.  See the NOTICE file
+#distributed with this work for additional information
+#regarding copyright ownership.  The ASF licenses this file
+#to you under the Apache License, Version 2.0 (the
+#"License"); you may not use this file except in compliance
+#with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+#Unless required by applicable law or agreed to in writing,
+#software distributed under the License is distributed on an
+#"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#KIND, either express or implied.  See the License for the
+#specific language governing permissions and limitations
+#under the License.
+
 [ ! -f /var/cache/cloud/enabled_svcs ] && touch /var/cache/cloud/enabled_svcs
 for svc in $(cat /var/cache/cloud/enabled_svcs) 
 do


[2/2] git commit: updated refs/heads/4.5 to 81994cf

Posted by bh...@apache.org.
CLOUDSTACK-5494: Fixed dns is open to public in VR

Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/81994cf4
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/81994cf4
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/81994cf4

Branch: refs/heads/4.5
Commit: 81994cf443ca64aead822ed1b3cf1c22d10bd9fe
Parents: 671248b
Author: Jayapal <ja...@apache.org>
Authored: Tue Jan 27 16:33:03 2015 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Fri Feb 6 15:29:57 2015 +0530

----------------------------------------------------------------------
 .../debian/config/etc/init.d/cloud-early-config |  6 ++++
 .../config/opt/cloud/bin/createIpAlias.sh       | 29 ++++++++++++++++++++
 .../config/opt/cloud/bin/deleteIpAlias.sh       |  2 ++
 3 files changed, 37 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/81994cf4/systemvm/patches/debian/config/etc/init.d/cloud-early-config
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/etc/init.d/cloud-early-config b/systemvm/patches/debian/config/etc/init.d/cloud-early-config
index f7d752d..dcd49cb 100755
--- a/systemvm/patches/debian/config/etc/init.d/cloud-early-config
+++ b/systemvm/patches/debian/config/etc/init.d/cloud-early-config
@@ -987,6 +987,12 @@ setup_router() {
   cp /etc/iptables/iptables-router /etc/iptables/rules
   setup_sshd $ETH1_IP "eth1"
   load_modules
+
+  #Only allow DNS service for current network
+  sed -i "s/-A INPUT -i eth0 -p udp -m udp --dport 53 -j ACCEPT/-A INPUT -i eth0 -p udp -m udp --dport 53 -s $DHCP_RANGE\/$CIDR_SIZE -j ACCEPT/g" /etc/iptables/rules.v4
+  sed -i "s/-A INPUT -i eth0 -p udp -m udp --dport 53 -j ACCEPT/-A INPUT -i eth0 -p udp -m udp --dport 53 -s $DHCP_RANGE\/$CIDR_SIZE -j ACCEPT/g" /etc/iptables/rules
+  sed -i "s/-A INPUT -i eth0 -p tcp -m tcp --dport 53 -j ACCEPT/-A INPUT -i eth0 -p tcp -m tcp --dport 53 -s $DHCP_RANGE\/$CIDR_SIZE -j ACCEPT/g" /etc/iptables/rules.v4
+  sed -i "s/-A INPUT -i eth0 -p tcp -m tcp --dport 53 -j ACCEPT/-A INPUT -i eth0 -p tcp -m tcp --dport 53 -s $DHCP_RANGE\/$CIDR_SIZE -j ACCEPT/g" /etc/iptables/rules
 }
 
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/81994cf4/systemvm/patches/debian/config/opt/cloud/bin/createIpAlias.sh
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/createIpAlias.sh b/systemvm/patches/debian/config/opt/cloud/bin/createIpAlias.sh
index cd273f6..160bc5e 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/createIpAlias.sh
+++ b/systemvm/patches/debian/config/opt/cloud/bin/createIpAlias.sh
@@ -60,6 +60,7 @@ setup_apache2() {
 var="$1"
 cert="/root/.ssh/id_rsa.cloud"
 config_ips=""
+setDnsRules=0
 
 while [ -n "$var" ]
 do
@@ -71,6 +72,7 @@ do
  setup_apache2 "$routerip"
  config_ips="${config_ips}"$routerip":"
  var=$( echo $var | sed "s/${var1}-//" )
+ setDnsRules=1
 done
 
 #restarting the apache server for the config to take effect.
@@ -95,6 +97,33 @@ then
    unlock_exit $result $lock $locked
 fi
 
+if [ "$setDnsRules" -eq 1 ]
+then
+    //check wether chain exist
+    iptables-save -t filter | grep 'dnsIpAlias_allow'
+
+    if [ $? -eq  0 ]
+    then
+      iptables -F dnsIpAlias_allow
+    else
+        //if not exist create it
+        iptables -N dnsIpAlias_allow
+        iptables -A INPUT -i eth0 -p tcp --dport 53 -j dnsIpAlias_allow
+        iptables -A INPUT -i eth0 -p udp --dport 53 -j dnsIpAlias_allow
+    fi
+
+    for cidr in $(ip addr | grep eth0 | grep inet | awk '{print $2}');
+    do
+        iptables -A dnsIpAlias_allow  -i eth0 -p tcp --dport 53 -s $cidr -j ACCEPT
+        iptables -A dnsIpAlias_allow  -i eth0 -p udp --dport 53 -s $cidr -j ACCEPT
+    done
+else
+        iptables -D INPUT -i eth0 -p tcp --dport 53 -j dnsIpAlias_allow
+        iptables -D INPUT -i eth0 -p udp --dport 53 -j dnsIpAlias_allow
+        iptables -X dnsIpAlias_allow
+fi
+
+
 #restaring the password service to enable it on the ip aliases
 /etc/init.d/cloud-passwd-srvr restart
 unlock_exit $? $lock $locked
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/81994cf4/systemvm/patches/debian/config/opt/cloud/bin/deleteIpAlias.sh
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/opt/cloud/bin/deleteIpAlias.sh b/systemvm/patches/debian/config/opt/cloud/bin/deleteIpAlias.sh
index 8b14919..5c07028 100755
--- a/systemvm/patches/debian/config/opt/cloud/bin/deleteIpAlias.sh
+++ b/systemvm/patches/debian/config/opt/cloud/bin/deleteIpAlias.sh
@@ -55,6 +55,8 @@ service apache2 restart
 
 releaseLockFile $lock $locked
 
+iptables -F dnsIpAlias_allow
+
 #recreating the active ip aliases
 /opt/cloud/bin/createIpAlias.sh $2
 unlock_exit $? $lock $locked
\ No newline at end of file