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

Firewall #150

Merged
merged 35 commits into from
Mar 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
aa61ca0
Merge pull request #149 from DefGuard/dev
t-aleksander Jan 27, 2025
3cf4b42
first firewall iteration
t-aleksander Feb 21, 2025
3059ba9
comments, port and protocol fixes
t-aleksander Feb 21, 2025
5b55351
basic error handling
t-aleksander Feb 25, 2025
17f9e1d
proto update, gateway communication
t-aleksander Feb 27, 2025
70a3a3a
install dependencies
t-aleksander Feb 27, 2025
40b326d
add config option to masquarade the firewall
t-aleksander Mar 3, 2025
3a5eb97
docker builds
t-aleksander Mar 4, 2025
dfd304a
cleanup, refactor
t-aleksander Mar 4, 2025
2b2ba59
add more logging to gateway rule comparison
t-aleksander Mar 5, 2025
ea0ee5e
fix firewall rules not being applied
t-aleksander Mar 5, 2025
6f5ab04
fix experimental docker builds
t-aleksander Mar 13, 2025
aae1ea6
add nftables to container
t-aleksander Mar 17, 2025
738fbd9
dont compile for non-linux, allow setting chain priority
t-aleksander Mar 17, 2025
5e0eb29
correct the documentation
t-aleksander Mar 17, 2025
4db3883
reduce cloning, cleanup
t-aleksander Mar 17, 2025
87384cf
Merge branch 'firewall' of https://github.com/DefGuard/gateway into f…
t-aleksander Mar 17, 2025
4f65c1a
fix building on other systems
t-aleksander Mar 17, 2025
badf7ca
cleanup
t-aleksander Mar 18, 2025
507e63d
Apply suggestions from code review
t-aleksander Mar 18, 2025
e937178
cleanup, small refactor
t-aleksander Mar 18, 2025
851d102
Merge branch 'firewall' of https://github.com/DefGuard/gateway into f…
t-aleksander Mar 18, 2025
0d7e497
cleanup
t-aleksander Mar 18, 2025
edca2ff
atomic firewall operations
t-aleksander Mar 18, 2025
9cec98e
rename v4
t-aleksander Mar 18, 2025
abd0b02
update variable names
t-aleksander Mar 20, 2025
334cfaa
fix masquerade
t-aleksander Mar 20, 2025
90dea84
drop chain before applying masquerade
t-aleksander Mar 20, 2025
c645cca
fix test
t-aleksander Mar 20, 2025
4fece3e
set masquerade status when reconfigured
t-aleksander Mar 20, 2025
a6452dc
allow negating interfaces
t-aleksander Mar 20, 2025
c542bf9
fix tests
t-aleksander Mar 27, 2025
3ea3f05
restore workflows
t-aleksander Mar 27, 2025
ebd740d
update protos
t-aleksander Mar 27, 2025
ae5162b
bump version
t-aleksander Mar 27, 2025
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:
uses: Swatinem/rust-cache@v2
with:
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install protoc
run: apt-get update && apt-get -y install protobuf-compiler
- name: Install dependencies
run: apt-get update && apt-get -y install protobuf-compiler libnftnl-dev libmnl-dev
- name: Check format
run: |
rustup component add rustfmt
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
- name: Install Rust toolchain
run: rustup update --no-self-update stable

- name: Install protoc
run: apt-get update && apt-get -y install protobuf-compiler
- name: Install dependencies
run: apt-get update && apt-get -y install protobuf-compiler libnftnl-dev libmnl-dev

- name: Build Docs
run: cargo doc --all --no-deps
Expand Down
52 changes: 51 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "defguard-gateway"
version = "1.2.1"
version = "1.2.2"
edition = "2021"

[dependencies]
Expand All @@ -19,6 +19,11 @@ tonic = { version = "0.12", features = ["gzip", "tls", "tls-native-roots"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
tokio-stream = { version = "0.1", features = [] }
toml = { version = "0.8", default-features = false, features = ["parse"] }
ipnetwork = "0.21"

[target.'cfg(target_os = "linux")'.dependencies]
nftnl = { git = "https://github.com/DefGuard/nftnl-rs.git", rev = "1a1147271f43b9d7182a114bb056a5224c35d38f" }
mnl = "0.2"

[dev-dependencies]
tokio = { version = "1", features = ["io-std", "io-util"] }
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM rust:1-slim as builder

RUN apt-get update && apt-get -y install protobuf-compiler
RUN apt-get update && apt-get -y install protobuf-compiler libnftnl-dev libmnl-dev
WORKDIR /app
COPY . .
RUN cargo build --release

FROM debian:bookworm-slim
RUN apt-get update && apt-get -y --no-install-recommends install \
iproute2 wireguard-tools sudo ca-certificates iptables ebtables && \
iproute2 wireguard-tools sudo ca-certificates iptables ebtables nftables && \
apt-get clean && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=builder /app/target/release/defguard-gateway /usr/local/bin
Expand Down
13 changes: 0 additions & 13 deletions LICENSE

This file was deleted.

Loading
Loading