[BugFix:
make console agent port (7758) accessiable for localhost only.
@@ -169,6 +169,8 @@ public class ManagementServerConsoleProxyBackend extends AbstractConsoleProxyBac
builder.append(String.format(";sudo iptables -I INPUT -m set --match-set ZS-MN src -p tcp -m comment --comment %s -m tcp --dport %s -j ACCEPT",
ConsoleConstants.VNC_IPTABLES_COMMENTS, dport));
}
+ builder.append(String.format(";sudo iptables -I INPUT -m set --match-set ZS-MN src -p tcp -m comment --comment %s -m tcp -s 127.0.0.1 --dport %s -j ACCEPT",
+ ConsoleConstants.VNC_IPTABLES_COMMENTS, agentPort));
} else {
builder.append(String.format("sudo iptables-save | grep '%s' | while read LINE;do drule=${LINE//\\\"/};sudo iptables ${drule/-A/-D};done",
ConsoleConstants.VNC_IPTABLES_COMMENTS));
@@ -176,6 +178,8 @@ public class ManagementServerConsoleProxyBackend extends AbstractConsoleProxyBac
builder.append(String.format(";sudo iptables -I INPUT -p tcp -m comment --comment %s -m tcp --dport %s -j ACCEPT",
ConsoleConstants.VNC_IPTABLES_COMMENTS, dport));
}
+ builder.append(String.format(";sudo iptables -I INPUT -p tcp -m comment --comment %s -m tcp -s 127.0.0.1 --dport %s -j ACCEPT",
+ ConsoleConstants.VNC_IPTABLES_COMMENTS, agentPort));
}
ShellUtils.run(builder.toString());
