Skip to content

Commit 2e541d7

Browse files
committed
adjust event description
1 parent de78eed commit 2e541d7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

azure-iptables-monitor/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ Follow the steps below to build and run the program:
2929
```
3030
- The `-input` flag specifies the directory containing allowed regex pattern files. Default: `/etc/config/`
3131
- The `-input6` flag specifies the directory containing allowed regex pattern files for IPv6 ip6tables. Default: `/etc/config6/`
32-
- The `-interval` flag specifies how often to check iptables rules in seconds. Default: `300`
32+
- The `-interval` flag specifies how often to check iptables rules and the bpf map in seconds. Default: `300`
3333
- The `-events` flag enables Kubernetes event creation for rule violations. Default: `false`
3434
- The `-ipv6` flag enables IPv6 ip6tables monitoring using the IPv6 allowlists. Default: `false`
3535
- The `-checkMap` flag enables checking the pinned bpf map specified in mapPath for increases. Default: `false`
36-
- The `-mapPath` flag species the pinned bpf map path to check. Default: `/block-iptables/iptables_block_event_counter`
36+
- The `-mapPath` flag specifies the pinned bpf map path to check. Default: `/block-iptables/iptables_block_event_counter`
3737
- The program must be in a k8s environment and `NODE_NAME` must be a set environment variable with the current node.
3838

3939
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).

azure-iptables-monitor/iptables_monitor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var version string
3030
var (
3131
configPath4 = flag.String("input", "/etc/config/", "Name of the directory with the ipv4 allowed regex files")
3232
configPath6 = flag.String("input6", "/etc/config6/", "Name of directory with the ipv6 allowed regex files")
33-
checkInterval = flag.Int("interval", 300, "How often to check iptables rules (in seconds)")
33+
checkInterval = flag.Int("interval", 300, "How often to check for user iptables rules and bpf map increases (in seconds)")
3434
sendEvents = flag.Bool("events", false, "Whether to send node events if unexpected iptables rules are detected")
3535
ipv6Enabled = flag.Bool("ipv6", false, "Whether to check ip6tables using the ipv6 allowlists")
3636
checkMap = flag.Bool("checkMap", false, "Whether to check the bpf map at mapPath for increases")
@@ -351,7 +351,7 @@ func main() {
351351
// if number of blocked rules increased since last time
352352
blockedRulesIncreased := currentBlocks > previousBlocks
353353
if *sendEvents && blockedRulesIncreased {
354-
msg := fmt.Sprintf("Number of blocked iptables rules increased from %d to %d since last check", previousBlocks, currentBlocks)
354+
msg := fmt.Sprintf("Number of blocked iptables rules increased from %d to %d since last check. EBPF Host Routing is enabled: aka.ms/acnsperformance", previousBlocks, currentBlocks)
355355
err = createNodeEvent(clientset, currentNodeName, "BlockedIPTablesRule", msg, corev1.EventTypeWarning)
356356
if err != nil {
357357
klog.Errorf("failed to create iptables block event: %v", err)

0 commit comments

Comments
 (0)