Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7a235a54a | ||
|
|
bef50d3730 | ||
|
|
a46d18da0c | ||
|
|
95c020fbe0 | ||
|
|
7c2084b9af |
No files matched your search
@@ -1,3 +1,9 @@
|
|||||||
|
## Release 2.6.4
|
||||||
|
|
||||||
|
Improves the iptables rule added in 2.6.3 to block just the Weave Net
|
||||||
|
control port and avoid blocking other uses of 127.0.0.1. #3811
|
||||||
|
|
||||||
|
|
||||||
## Release 2.6.3
|
## Release 2.6.3
|
||||||
|
|
||||||
This release has a couple of security improvements, and some other fixes.
|
This release has a couple of security improvements, and some other fixes.
|
||||||
|
|||||||
@@ -13,13 +13,6 @@ function install_terraform() {
|
|||||||
curl -fsS https://releases.hashicorp.com/terraform/0.11.14/terraform_0.11.14_linux_amd64.zip | gunzip >terraform && chmod +x terraform && sudo mv terraform /usr/bin
|
curl -fsS https://releases.hashicorp.com/terraform/0.11.14/terraform_0.11.14_linux_amd64.zip | gunzip >terraform && chmod +x terraform && sudo mv terraform /usr/bin
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_ansible() {
|
|
||||||
sudo apt-get update || true
|
|
||||||
sudo apt-get install -qq -y python-pip python-dev libffi-dev libssl-dev \
|
|
||||||
&& pip install --user -U setuptools cffi \
|
|
||||||
&& pip install --user ansible
|
|
||||||
}
|
|
||||||
|
|
||||||
[ -n "$SECRET_KEY" ] || {
|
[ -n "$SECRET_KEY" ] || {
|
||||||
echo "Cannot run smoke tests: no secret key"
|
echo "Cannot run smoke tests: no secret key"
|
||||||
exit 1
|
exit 1
|
||||||
@@ -28,7 +21,6 @@ function install_ansible() {
|
|||||||
source "$SRCDIR/bin/circle-env"
|
source "$SRCDIR/bin/circle-env"
|
||||||
|
|
||||||
install_terraform
|
install_terraform
|
||||||
install_ansible
|
|
||||||
|
|
||||||
# Only attempt to create GCP image in first container, wait for it to be created otherwise:
|
# Only attempt to create GCP image in first container, wait for it to be created otherwise:
|
||||||
[ "$CIRCLE_NODE_INDEX" != "0" ] && export CREATE_IMAGE=0
|
[ "$CIRCLE_NODE_INDEX" != "0" ] && export CREATE_IMAGE=0
|
||||||
|
|||||||
+11
-3
@@ -221,6 +221,7 @@ type BridgeConfig struct {
|
|||||||
MTU int
|
MTU int
|
||||||
Mac string
|
Mac string
|
||||||
Port int
|
Port int
|
||||||
|
ControlPort string
|
||||||
NoMasqLocal bool
|
NoMasqLocal bool
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -469,10 +470,17 @@ func configureIPTables(config *BridgeConfig, ips ipset.Interface) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Block non-local traffic to the Weave control port
|
if config.ControlPort != "" {
|
||||||
if err = ipt.AppendUnique("filter", "INPUT", "-p", "tcp", "--dst", "127.0.0.1", "-m", "addrtype", "!", "--src-type", "LOCAL", "-m", "conntrack", "!", "--ctstate", "RELATED,ESTABLISHED", "-j", "DROP"); err != nil {
|
if err = ipt.AppendUnique("filter", "INPUT", "-p", "tcp", "--dst", "127.0.0.1", "--dport", config.ControlPort,
|
||||||
return err
|
"-m", "addrtype", "!", "--src-type", "LOCAL",
|
||||||
|
"-m", "conntrack", "!", "--ctstate", "RELATED,ESTABLISHED",
|
||||||
|
"-m", "comment", "--comment", "Block non-local access to Weave Net control port",
|
||||||
|
"-j", "DROP"); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
// Remove the rule from Weave Net 2.6.3 which dropped too much.
|
||||||
|
_ = ipt.Delete("filter", "INPUT", "-p", "tcp", "--dst", "127.0.0.1", "-m", "addrtype", "!", "--src-type", "LOCAL", "-m", "conntrack", "!", "--ctstate", "RELATED,ESTABLISHED", "-j", "DROP")
|
||||||
|
|
||||||
if config.NPC {
|
if config.NPC {
|
||||||
// Steer traffic via the NPC.
|
// Steer traffic via the NPC.
|
||||||
|
|||||||
@@ -307,6 +307,11 @@ func main() {
|
|||||||
|
|
||||||
bridgeConfig.Mac = name.String()
|
bridgeConfig.Mac = name.String()
|
||||||
bridgeConfig.Port = config.Port
|
bridgeConfig.Port = config.Port
|
||||||
|
if httpAddr != "" {
|
||||||
|
if _, port, err := net.SplitHostPort(httpAddr); err == nil {
|
||||||
|
bridgeConfig.ControlPort = port
|
||||||
|
}
|
||||||
|
}
|
||||||
ips := ipset.New(common.LogLogger(), 0)
|
ips := ipset.New(common.LogLogger(), 0)
|
||||||
bridgeType, err := weavenet.EnsureBridge(procPath, &bridgeConfig, Log, ips)
|
bridgeType, err := weavenet.EnsureBridge(procPath, &bridgeConfig, Log, ips)
|
||||||
checkFatal(err)
|
checkFatal(err)
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ function print_vars() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function verify_dependencies() {
|
function verify_dependencies() {
|
||||||
local deps=(python terraform ansible-playbook gcloud)
|
local deps=(python terraform gcloud)
|
||||||
for dep in "${deps[@]}"; do
|
for dep in "${deps[@]}"; do
|
||||||
if [ ! "$(which "$dep")" ]; then
|
if [ ! "$(which "$dep")" ]; then
|
||||||
echo >&2 "$dep is not installed or not in PATH."
|
echo >&2 "$dep is not installed or not in PATH."
|
||||||
@@ -141,9 +141,18 @@ function wait_for_image() {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function install_ansible() {
|
||||||
|
sudo apt-get update || true
|
||||||
|
sudo apt-get install -qq -y python-pip python-dev libffi-dev libssl-dev \
|
||||||
|
&& pip install --user -U setuptools cffi \
|
||||||
|
&& pip install --user ansible
|
||||||
|
}
|
||||||
|
|
||||||
# shellcheck disable=SC2155
|
# shellcheck disable=SC2155
|
||||||
function create_image() {
|
function create_image() {
|
||||||
if [[ "$CREATE_IMAGE" == 1 ]]; then
|
if [[ "$CREATE_IMAGE" == 1 ]]; then
|
||||||
|
install_ansible
|
||||||
|
|
||||||
greenly echo "> Creating GCP image $IMAGE_NAME..."
|
greenly echo "> Creating GCP image $IMAGE_NAME..."
|
||||||
local begin_img=$(date +%s)
|
local begin_img=$(date +%s)
|
||||||
local num_hosts=1
|
local num_hosts=1
|
||||||
|
|||||||
@@ -483,7 +483,7 @@ destroy_bridge() {
|
|||||||
|
|
||||||
[ -n "$DOCKER_BRIDGE_IP" ] || DOCKER_BRIDGE_IP=$(util_op bridge-ip $DOCKER_BRIDGE)
|
[ -n "$DOCKER_BRIDGE_IP" ] || DOCKER_BRIDGE_IP=$(util_op bridge-ip $DOCKER_BRIDGE)
|
||||||
|
|
||||||
run_iptables -t filter -D INPUT -d 127.0.0.1/32 -p tcp -m addrtype ! --src-type LOCAL -m conntrack ! --ctstate RELATED,ESTABLISHED -j DROP >/dev/null 2>&1 || true
|
run_iptables -t filter -D INPUT -d 127.0.0.1/32 -p tcp --dport 6784 -m addrtype ! --src-type LOCAL -m conntrack ! --ctstate RELATED,ESTABLISHED -m comment --comment "Block non-local access to Weave Net control port" -j DROP >/dev/null 2>&1 || true
|
||||||
run_iptables -t filter -D INPUT -i $DOCKER_BRIDGE -p udp --dport 53 -j ACCEPT >/dev/null 2>&1 || true
|
run_iptables -t filter -D INPUT -i $DOCKER_BRIDGE -p udp --dport 53 -j ACCEPT >/dev/null 2>&1 || true
|
||||||
run_iptables -t filter -D INPUT -i $DOCKER_BRIDGE -p tcp --dport 53 -j ACCEPT >/dev/null 2>&1 || true
|
run_iptables -t filter -D INPUT -i $DOCKER_BRIDGE -p tcp --dport 53 -j ACCEPT >/dev/null 2>&1 || true
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user