Created
September 17, 2024 22:31
-
-
Save gdamjan/d7e6a67feae45c1f2b199e7bc605a0cc to your computer and use it in GitHub Desktop.
nftables to drop packets incoming for a cgroup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
table ip myservice | |
delete table ip myservice | |
table ip myservice { | |
chain incoming { | |
type filter hook input priority filter; policy accept; | |
# `level 5` must match the number of levels of directories in the cgroup | |
socket cgroupv2 level 5 "user.slice/user-1000.slice/[email protected]/app.slice/[email protected]" counter | |
socket cgroupv2 level 5 "user.slice/user-1000.slice/[email protected]/app.slice/[email protected]" drop | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment