-
Notifications
You must be signed in to change notification settings - Fork 254
feat: update iptables monitor with ipv6 and bpf map reading capabilities #3948
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
base: master
Are you sure you want to change the base?
Changes from all commits
ebffab9
31e41cb
74b291f
2bb41e1
ba8759b
39a8c4b
8c8efc1
371481b
c05ec53
07d08e7
de78eed
dcce911
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,14 +25,20 @@ Follow the steps below to build and run the program: | |
|
||
4. Start the program with: | ||
```bash | ||
./azure-iptables-monitor --input=/etc/config/ --interval=300 | ||
./azure-iptables-monitor -input=/etc/config/ -interval=300 | ||
``` | ||
- The `--input` flag specifies the directory containing allowed regex pattern files. Default: `/etc/config/` | ||
- The `--interval` flag specifies how often to check iptables rules in seconds. Default: `300` | ||
- The `--events` flag enables Kubernetes event creation for rule violations. Default: `false` | ||
- The `-input` flag specifies the directory containing allowed regex pattern files. Default: `/etc/config/` | ||
- The `-input6` flag specifies the directory containing allowed regex pattern files for IPv6 ip6tables. Default: `/etc/config6/` | ||
- The `-interval` flag specifies how often to check iptables rules and the bpf map in seconds. Default: `300` | ||
- The `-events` flag enables Kubernetes event creation for rule violations. Default: `false` | ||
- The `-ipv6` flag enables IPv6 ip6tables monitoring using the IPv6 allowlists. Default: `false` | ||
- The `-checkMap` flag enables checking the pinned bpf map specified in mapPath for increases. Default: `false` | ||
- The `-mapPath` flag specifies the pinned bpf map path to check. Default: `/block-iptables/iptables_block_event_counter` | ||
- The program must be in a k8s environment and `NODE_NAME` must be a set environment variable with the current node. | ||
|
||
5. The program will set the `user-iptables-rules` label to `true` on the specified ciliumnode resource if unexpected rules are found, or `false` if all rules match expected patterns. Proper RBAC is required for patching (patch for ciliumnodes, create for events, get for nodes). | ||
5. The program will set the `kubernetes.azure.com/user-iptables-rules` label to `true` on the specified ciliumnode resource if unexpected rules are found, or `false` if all rules match expected patterns. Proper RBAC is required for patching (patch for ciliumnodes, create for events, get for nodes). | ||
|
||
6. The program will also send out an event if the bpf map value specified increases between checks | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we also specify how often the program check for increases? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The increases are checked based on |
||
|
||
|
||
## Pattern File Format | ||
|
@@ -48,6 +54,7 @@ Each pattern file should contain one regex pattern per line: | |
- `nat`, `mangle`, `filter`, `raw`, `security`: Patterns specific to each iptables table | ||
- Empty lines are ignored | ||
- Each line should be a valid Go regex pattern | ||
- The ipv6 config directory uses files with same names, but will match against ipv6 iptables rules | ||
|
||
## Debugging | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.