Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control commands #25

Draft
wants to merge 71 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
2affd37
Bump the golang-x-dependencies group with 4 updates (#1085)
dependabot[bot] Mar 18, 2024
2a778de
Bump github.com/flynn/noise from 1.0.1 to 1.1.0 (#1072)
dependabot[bot] Mar 18, 2024
2792650
Bump github.com/stretchr/testify from 1.8.4 to 1.9.0 (#1087)
dependabot[bot] Mar 18, 2024
1f1d660
Bump google.golang.org/protobuf from 1.32.0 to 1.33.0 (#1092)
dependabot[bot] Mar 18, 2024
f8fb975
Bump the golang-x-dependencies group with 1 update (#1094)
dependabot[bot] Mar 22, 2024
8b68a08
Fix "any" firewall rules for unsafe_routes (#1099)
johnmaguire Mar 28, 2024
bbb15f8
Unsafe route reload (#1083)
nbrownus Mar 28, 2024
a390125
Support reloading preferred_ranges (#1043)
nbrownus Apr 4, 2024
7efa750
avoid deadlock in lighthouse queryWorker (#1112)
wadey Apr 11, 2024
c1711bc
Remove tcp rtt tracking from the firewall (#1114)
nbrownus Apr 12, 2024
a5a07cc
Allow `::` in lighthouse.dns.host config (#1115)
nbrownus Apr 12, 2024
9bd92a7
Bump golang.org/x/net from 0.22.0 to 0.23.0 (#1123)
dependabot[bot] Apr 23, 2024
cdcea00
Bump github.com/miekg/dns from 1.1.58 to 1.1.59 (#1126)
dependabot[bot] Apr 23, 2024
d95fb4a
Bump the golang-x-dependencies group with 5 updates (#1110)
dependabot[bot] Apr 23, 2024
41e2e1d
Remove Fedora nebula.service file (#1128)
johnmaguire Apr 29, 2024
8e94eb9
Add suggested filenames for collected profiles in the ssh commands (#…
jasikpark Apr 29, 2024
a99618e
Don't log invalid certificates (#1116)
nbrownus Apr 29, 2024
3aca576
update to go1.22 (#981)
wadey Apr 29, 2024
7ed9f2a
add ssh command to print device info (#763)
kazzmir Apr 29, 2024
8b55caa
Remove Arch nebula.service file (#1132)
Antiz96 Apr 30, 2024
df78158
Create service script for open-rc (#711)
opie4624 Apr 30, 2024
e54f9dd
dns_server.go: parseQuery: set NXDOMAIN if there's no Answer to retur…
nodakai Apr 30, 2024
d7f52de
Fix errant capitalisation in DNS TXT response (#1127)
johnmaguire Apr 30, 2024
24f336e
switch off deprecated elliptic.Marshal (#1108)
wadey Apr 30, 2024
7e7d5e0
Bump github.com/prometheus/client_golang from 1.18.0 to 1.19.0 (#1086)
dependabot[bot] Apr 30, 2024
f7db0eb
Remove Vagrant example (#1129)
johnmaguire Apr 30, 2024
9cd944d
chore: fix function name in comment (#1111)
kindknow Apr 30, 2024
f31bab5
Add support for SSH CAs (#1098)
johnmaguire Apr 30, 2024
5f17db5
Add support for LoongArch64 (#1003)
fangyaling Apr 30, 2024
4f4941e
Add Vagrant based smoke tests (#1067)
wadey Apr 30, 2024
f39bfbb
Bump google.golang.org/protobuf in the protobuf-dependencies group (#…
dependabot[bot] Apr 30, 2024
b5c3486
Push Docker images as part of the release workflow (#1037)
johnmaguire May 2, 2024
aa18d7f
Bump actions/upload-artifact from 3 to 4 (#1046)
dependabot[bot] May 2, 2024
18f69af
Bump actions/download-artifact from 3 to 4 (#1047)
dependabot[bot] May 2, 2024
d6e4b88
release: use download-action v4 in docker section (#1134)
wadey May 3, 2024
fd1906b
minor text fixes (#1135)
JackDoan May 4, 2024
f19a286
Bump google.golang.org/protobuf in the protobuf-dependencies group (#…
dependabot[bot] May 6, 2024
c0130f8
Bump the golang-x-dependencies group with 4 updates (#1138)
dependabot[bot] May 6, 2024
50b24c1
v1.9.0 (#1137)
wadey May 8, 2024
4eb1da0
remove deadlock in GetOrHandshake (#1151)
wadey May 29, 2024
a92056a
v1.9.1 (#1152)
wadey May 29, 2024
d9cae9e
ensure messageCounter is set before handshake is complete (#1154)
wadey Jun 3, 2024
249ae41
v1.9.2 (#1155)
wadey Jun 3, 2024
4c066d8
initialize messageCounter to 2 instead of verifying later (#1156)
wadey Jun 6, 2024
b14bad5
v1.9.3 (#1160)
wadey Jun 6, 2024
40cfd00
Bump the golang-x-dependencies group with 4 updates (#1161)
dependabot[bot] Jun 10, 2024
d372df5
Bump google.golang.org/protobuf in the protobuf-dependencies group (#…
dependabot[bot] Jun 24, 2024
506ba5a
Bump github.com/miekg/dns from 1.1.59 to 1.1.61 (#1168)
dependabot[bot] Jun 24, 2024
97e9834
cleanup SK_MEMINFO vars (#1162)
wadey Jun 24, 2024
8109cf2
Add puncuation to doc comment (#1164)
jasikpark Jun 24, 2024
a76723e
Bump Apple-Actions/import-codesign-certs from 2 to 3 (#1146)
dependabot[bot] Jun 24, 2024
b9aace1
Bump github.com/prometheus/client_golang from 1.19.0 to 1.19.1 (#1147)
dependabot[bot] Jun 24, 2024
e6009b8
github actions: use macos-latest (#1171)
wadey Jul 2, 2024
8ee3fee
Initial pass
nbrownus Jul 4, 2024
58e330f
Some more Unmaps needed
nbrownus Jul 5, 2024
7ea16be
Resolve TODOs and issues with allow_list
nbrownus Jul 5, 2024
c407658
Remove resolved notes in connection manager
nbrownus Jul 5, 2024
c371659
Kind of unbreak the control tests
nbrownus Jul 5, 2024
544f58e
Re-enable e2e hot path benchmark
nbrownus Jul 5, 2024
64427f7
Fixup e2e
nbrownus Jul 5, 2024
682b1d8
Log invalid ips and unmap v4in6 on handshake
nbrownus Jul 6, 2024
485bd4d
Cleaner handshake manager tests
nbrownus Jul 6, 2024
68884e8
Ip unmapping and better reporting in hostmap
nbrownus Jul 6, 2024
d99d00a
Resolve todos in inside and interface
nbrownus Jul 8, 2024
9b75905
A few more todo resolutions
nbrownus Jul 8, 2024
103fe33
Simplify tests
nbrownus Jul 8, 2024
c977cae
Resolve go vet nits
nbrownus Jul 8, 2024
a98ede2
Fix windows endianness, android builds
nbrownus Jul 8, 2024
0dfab46
Another round of cleanup
nbrownus Jul 9, 2024
0a2d896
Bit more cleanup
nbrownus Jul 9, 2024
3e2ea7a
control commands
brad-defined Jul 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/gofmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
go-version: '1.22'
check-latest: true

- name: Install goimports
Expand Down
64 changes: 55 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
go-version: '1.22'
check-latest: true

- name: Build
Expand All @@ -24,7 +24,7 @@ jobs:
mv build/*.tar.gz release

- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: linux-latest
path: release
Expand All @@ -37,7 +37,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
go-version: '1.22'
check-latest: true

- name: Build
Expand All @@ -55,7 +55,7 @@ jobs:
mv dist\windows\wintun build\dist\windows\

- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: windows-latest
path: build
Expand All @@ -64,18 +64,18 @@ jobs:
name: Build Universal Darwin
env:
HAS_SIGNING_CREDS: ${{ secrets.AC_USERNAME != '' }}
runs-on: macos-11
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
go-version: '1.22'
check-latest: true

- name: Import certificates
if: env.HAS_SIGNING_CREDS == 'true'
uses: Apple-Actions/import-codesign-certs@v2
uses: Apple-Actions/import-codesign-certs@v3
with:
p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}
p12-password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }}
Expand Down Expand Up @@ -104,11 +104,57 @@ jobs:
fi

- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: darwin-latest
path: ./release/*

build-docker:
name: Create and Upload Docker Images
# Technically we only need build-linux to succeed, but if any platforms fail we'll
# want to investigate and restart the build
needs: [build-linux, build-darwin, build-windows]
runs-on: ubuntu-latest
env:
HAS_DOCKER_CREDS: ${{ vars.DOCKERHUB_USERNAME != '' && secrets.DOCKERHUB_TOKEN != '' }}
# XXX It's not possible to write a conditional here, so instead we do it on every step
#if: ${{ env.HAS_DOCKER_CREDS == 'true' }}
steps:
# Be sure to checkout the code before downloading artifacts, or they will
# be overwritten
- name: Checkout code
if: ${{ env.HAS_DOCKER_CREDS == 'true' }}
uses: actions/checkout@v4

- name: Download artifacts
if: ${{ env.HAS_DOCKER_CREDS == 'true' }}
uses: actions/download-artifact@v4
with:
name: linux-latest
path: artifacts

- name: Login to Docker Hub
if: ${{ env.HAS_DOCKER_CREDS == 'true' }}
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up Docker Buildx
if: ${{ env.HAS_DOCKER_CREDS == 'true' }}
uses: docker/setup-buildx-action@v3

- name: Build and push images
if: ${{ env.HAS_DOCKER_CREDS == 'true' }}
env:
DOCKER_IMAGE_REPO: ${{ vars.DOCKER_IMAGE_REPO || 'nebulaoss/nebula' }}
DOCKER_IMAGE_TAG: ${{ vars.DOCKER_IMAGE_TAG || 'latest' }}
run: |
mkdir -p build/linux-{amd64,arm64}
tar -zxvf artifacts/nebula-linux-amd64.tar.gz -C build/linux-amd64/
tar -zxvf artifacts/nebula-linux-arm64.tar.gz -C build/linux-arm64/
docker buildx build . --push -f docker/Dockerfile --platform linux/amd64,linux/arm64 --tag "${DOCKER_IMAGE_REPO}:${DOCKER_IMAGE_TAG}" --tag "${DOCKER_IMAGE_REPO}:${GITHUB_REF#refs/tags/v}"

release:
name: Create and Upload Release
needs: [build-linux, build-darwin, build-windows]
Expand All @@ -117,7 +163,7 @@ jobs:
- uses: actions/checkout@v4

- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: artifacts

Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/smoke-extra.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: smoke-extra
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, labeled, reopened]
paths:
- '.github/workflows/smoke**'
- '**Makefile'
- '**.go'
- '**.proto'
- 'go.mod'
- 'go.sum'
jobs:

smoke-extra:
if: github.ref == 'refs/heads/master' || contains(github.event.pull_request.labels.*.name, 'smoke-test-extra')
name: Run extra smoke tests
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: true

- name: install vagrant
run: sudo apt-get update && sudo apt-get install -y vagrant virtualbox

- name: freebsd-amd64
run: make smoke-vagrant/freebsd-amd64

- name: openbsd-amd64
run: make smoke-vagrant/openbsd-amd64

- name: netbsd-amd64
run: make smoke-vagrant/netbsd-amd64

- name: linux-386
run: make smoke-vagrant/linux-386

- name: linux-amd64-ipv6disable
run: make smoke-vagrant/linux-amd64-ipv6disable

timeout-minutes: 30
2 changes: 1 addition & 1 deletion .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
go-version: '1.22'
check-latest: true

- name: build
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/smoke/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ mkdir ./build
cp ../../../../build/linux-amd64/nebula .
cp ../../../../build/linux-amd64/nebula-cert .

if [ "$1" ]
then
cp "../../../../build/$1/nebula" "$1-nebula"
fi

HOST="lighthouse1" \
AM_LIGHTHOUSE=true \
../genconfig.sh >lighthouse1.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoke/genconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ listen:
port: ${LISTEN_PORT:-4242}

tun:
dev: ${TUN_DEV:-nebula1}
dev: ${TUN_DEV:-tun0}

firewall:
inbound_action: reject
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoke/smoke-relay.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ docker exec host4 sh -c 'kill 1'
docker exec host3 sh -c 'kill 1'
docker exec host2 sh -c 'kill 1'
docker exec lighthouse1 sh -c 'kill 1'
sleep 1
sleep 5

if [ "$(jobs -r)" ]
then
Expand Down
105 changes: 105 additions & 0 deletions .github/workflows/smoke/smoke-vagrant.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
#!/bin/bash

set -e -x

set -o pipefail

export VAGRANT_CWD="$PWD/vagrant-$1"

mkdir -p logs

cleanup() {
echo
echo " *** cleanup"
echo

set +e
if [ "$(jobs -r)" ]
then
docker kill lighthouse1 host2
fi
vagrant destroy -f
}

trap cleanup EXIT

CONTAINER="nebula:${NAME:-smoke}"

docker run --name lighthouse1 --rm "$CONTAINER" -config lighthouse1.yml -test
docker run --name host2 --rm "$CONTAINER" -config host2.yml -test

vagrant up
vagrant ssh -c "cd /nebula && /nebula/$1-nebula -config host3.yml -test"

docker run --name lighthouse1 --device /dev/net/tun:/dev/net/tun --cap-add NET_ADMIN --rm "$CONTAINER" -config lighthouse1.yml 2>&1 | tee logs/lighthouse1 | sed -u 's/^/ [lighthouse1] /' &
sleep 1
docker run --name host2 --device /dev/net/tun:/dev/net/tun --cap-add NET_ADMIN --rm "$CONTAINER" -config host2.yml 2>&1 | tee logs/host2 | sed -u 's/^/ [host2] /' &
sleep 1
vagrant ssh -c "cd /nebula && sudo sh -c 'echo \$\$ >/nebula/pid && exec /nebula/$1-nebula -config host3.yml'" &
sleep 15

# grab tcpdump pcaps for debugging
docker exec lighthouse1 tcpdump -i nebula1 -q -w - -U 2>logs/lighthouse1.inside.log >logs/lighthouse1.inside.pcap &
docker exec lighthouse1 tcpdump -i eth0 -q -w - -U 2>logs/lighthouse1.outside.log >logs/lighthouse1.outside.pcap &
docker exec host2 tcpdump -i nebula1 -q -w - -U 2>logs/host2.inside.log >logs/host2.inside.pcap &
docker exec host2 tcpdump -i eth0 -q -w - -U 2>logs/host2.outside.log >logs/host2.outside.pcap &
# vagrant ssh -c "tcpdump -i nebula1 -q -w - -U" 2>logs/host3.inside.log >logs/host3.inside.pcap &
# vagrant ssh -c "tcpdump -i eth0 -q -w - -U" 2>logs/host3.outside.log >logs/host3.outside.pcap &

docker exec host2 ncat -nklv 0.0.0.0 2000 &
vagrant ssh -c "ncat -nklv 0.0.0.0 2000" &
#docker exec host2 ncat -e '/usr/bin/echo host2' -nkluv 0.0.0.0 3000 &
#vagrant ssh -c "ncat -e '/usr/bin/echo host3' -nkluv 0.0.0.0 3000" &

set +x
echo
echo " *** Testing ping from lighthouse1"
echo
set -x
docker exec lighthouse1 ping -c1 192.168.100.2
docker exec lighthouse1 ping -c1 192.168.100.3

set +x
echo
echo " *** Testing ping from host2"
echo
set -x
docker exec host2 ping -c1 192.168.100.1
# Should fail because not allowed by host3 inbound firewall
! docker exec host2 ping -c1 192.168.100.3 -w5 || exit 1

set +x
echo
echo " *** Testing ncat from host2"
echo
set -x
# Should fail because not allowed by host3 inbound firewall
#! docker exec host2 ncat -nzv -w5 192.168.100.3 2000 || exit 1
#! docker exec host2 ncat -nzuv -w5 192.168.100.3 3000 | grep -q host3 || exit 1

set +x
echo
echo " *** Testing ping from host3"
echo
set -x
vagrant ssh -c "ping -c1 192.168.100.1"
vagrant ssh -c "ping -c1 192.168.100.2"

set +x
echo
echo " *** Testing ncat from host3"
echo
set -x
#vagrant ssh -c "ncat -nzv -w5 192.168.100.2 2000"
#vagrant ssh -c "ncat -nzuv -w5 192.168.100.2 3000" | grep -q host2

vagrant ssh -c "sudo xargs kill </nebula/pid"
docker exec host2 sh -c 'kill 1'
docker exec lighthouse1 sh -c 'kill 1'
sleep 1

if [ "$(jobs -r)" ]
then
echo "nebula still running after SIGTERM sent" >&2
exit 1
fi
2 changes: 1 addition & 1 deletion .github/workflows/smoke/smoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ docker exec host4 sh -c 'kill 1'
docker exec host3 sh -c 'kill 1'
docker exec host2 sh -c 'kill 1'
docker exec lighthouse1 sh -c 'kill 1'
sleep 1
sleep 5

if [ "$(jobs -r)" ]
then
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/smoke/vagrant-freebsd-amd64/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "generic/freebsd14"

config.vm.synced_folder "../build", "/nebula", type: "rsync"
end
7 changes: 7 additions & 0 deletions .github/workflows/smoke/vagrant-linux-386/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial32"

config.vm.synced_folder "../build", "/nebula"
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/jammy64"

config.vm.synced_folder "../build", "/nebula"

config.vm.provision :shell do |shell|
shell.inline = <<-EOF
sed -i 's/GRUB_CMDLINE_LINUX=""/GRUB_CMDLINE_LINUX="ipv6.disable=1"/' /etc/default/grub
update-grub
EOF
shell.privileged = true
shell.reboot = true
end
end
7 changes: 7 additions & 0 deletions .github/workflows/smoke/vagrant-netbsd-amd64/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "generic/netbsd9"

config.vm.synced_folder "../build", "/nebula", type: "rsync"
end
7 changes: 7 additions & 0 deletions .github/workflows/smoke/vagrant-openbsd-amd64/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "generic/openbsd7"

config.vm.synced_folder "../build", "/nebula", type: "rsync"
end
Loading