OCPBUGS-76699: ebpf: consolidate packet event logs into single line#706
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
WalkthroughConsolidated ingress node firewall event logging: multiple per-field syslog calls replaced by constructing a single composite log message (ruleId, action, pktLen, interface, and one mutually-exclusive protocol detail branch for IPv4/IPv6 + transport/ICMP) and emitting it once. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 11 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (11 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
|
Hi @rameshsahoo111. Thanks for your PR. I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Internal Jira - https://redhat.atlassian.net/browse/OCPBUGS-76699 |
|
/cc |
|
@Meina-rh thank you for your review. With the current code (using else if): From a networking perspective, a single packet can ONLY be either IPv4 OR IPv6, never both. This is fundamental to how IP works: So the current code with else if correctly handles both: In a dual-stack cluster: I confirmed that IPV6 logging is also correctly logged; Requesting you to further review and my original change and update. |
|
@rameshsahoo111 thanks for your explaining, I forgot it's from packet. |
|
/ok-to-test |
|
Unit test is failing because ./testbin/setup-envtest.sh is failing to download kubebuilder-tools. Requesting someone to fix CI failure. |
|
/retest-required |
|
Verified with all test cases and the below are the result. Requesting someone to fix the CI failure. IngressNodeFirewall RulesapiVersion: ingressnodefirewall.openshift.io/v1alpha1
kind: IngressNodeFirewall
metadata:
name: ingressnodefirewall
spec:
interfaces:
- breth0
nodeSelector:
matchLabels:
kubernetes.io/hostname: ovn-worker
ingress:
- sourceCIDRs:
- 0.0.0.0/0
- ::/0
rules:
- order: 10
protocolConfig:
protocol: TCP
tcp:
ports: "5000-5001"
action: Deny
- order: 11
protocolConfig:
protocol: UDP
udp:
ports: "5000-5001"
action: Deny
- order: 12
protocolConfig:
protocol: ICMP
icmp:
icmpType: 8 #ICMP Echo request
action: Deny
- order: 13
protocolConfig:
protocol: ICMPv6
icmpv6:
icmpType: 128 #ICMPV6 Echo request
action: Deny
- order: 14
protocolConfig:
protocol: SCTP
sctp:
ports: "6000-6001"
action: Deny
Test Result[SCTP TEST]
Server Listen;
socat -v SCTP6-LISTEN:6000,fork,ipv6only=0 -
SCTP Client connect;
echo "Hello Ramesh"|socat - SCTP:10.89.0.16:6000
echo "Hello Ramesh"|socat - SCTP:[fc00:f853:ccd:e793::10]:6000
[TCP/UDP TEST]
nc -l 5000
curl --retry 0 --fail --max-time 1 -v telnet://10.89.0.16:5000 --connect-timeout 1
curl --retry 0 --fail --max-time 1 -v telnet://[fc00:f853:ccd:e793::10]:5000 --connect-timeout 1
nc -lu 5000
nc -zu 10.89.0.16 5000
nc -6 -zu fc00:f853:ccd:e793::10 5000
[ICMP Test]
ping -c1 10.89.0.16
ping6 -c1 fc00:f853:ccd:e793::10
# oc logs -c events ingress-node-firewall-daemon-h44gk
[TCP]
2026-04-03 10:53:58 +0000 UTC ovn-worker ruleId 10 action Drop len 74 if breth0 | ipv4 src 10.89.0.1 dst 10.89.0.16 | tcp srcPort 58444 dstPort 5000
2026-04-03 10:55:17 +0000 UTC ovn-worker ruleId 10 action Drop len 94 if breth0 | ipv6 src fc00:f853:ccd:e793::1 dst fc00:f853:ccd:e793::10 | tcp srcPort 40772 dstPort 5000
[UDP]
2026-04-03 10:56:18 +0000 UTC ovn-worker ruleId 11 action Drop len 43 if breth0 | ipv4 src 10.89.0.1 dst 10.89.0.16 | udp srcPort 52237 dstPort 5000
2026-04-03 10:56:44 +0000 UTC ovn-worker ruleId 11 action Drop len 63 if breth0 | ipv6 src fc00:f853:ccd:e793::1 dst fc00:f853:ccd:e793::10 | udp srcPort 50747 dstPort 5000
[SCTP]
2026-04-03 10:59:27 +0000 UTC ovn-worker ruleId 14 action Drop len 98 if breth0 | ipv4 src 10.89.0.1 dst 10.89.0.16 | sctp srcPort 58063 dstPort 6000
2026-04-03 10:59:30 +0000 UTC ovn-worker ruleId 14 action Drop len 98 if breth0 | ipv4 src 10.89.0.1 dst 10.89.0.16 | sctp srcPort 58063 dstPort 6000
2026-04-03 10:59:36 +0000 UTC ovn-worker ruleId 14 action Drop len 98 if breth0 | ipv4 src 10.89.0.1 dst 10.89.0.16 | sctp srcPort 58063 dstPort 6000
2026-04-03 11:00:20 +0000 UTC ovn-worker ruleId 14 action Drop len 102 if breth0 | ipv6 src fc00:f853:ccd:e793::1 dst fc00:f853:ccd:e793::10 | sctp srcPort 36912 dstPort 6000
2026-04-03 11:00:23 +0000 UTC ovn-worker ruleId 14 action Drop len 102 if breth0 | ipv6 src fc00:f853:ccd:e793::1 dst fc00:f853:ccd:e793::10 | sctp srcPort 36912 dstPort 6000
2026-04-03 11:00:30 +0000 UTC ovn-worker ruleId 14 action Drop len 102 if breth0 | ipv6 src fc00:f853:ccd:e793::1 dst fc00:f853:ccd:e793::10 | sctp srcPort 36912 dstPort 6000
[ICMP]
2026-04-03 11:00:58 +0000 UTC ovn-worker ruleId 12 action Drop len 98 if breth0 | ipv4 src 10.89.0.1 dst 10.89.0.16 | icmpv4 type 8 code 0
2026-04-03 11:01:20 +0000 UTC ovn-worker ruleId 13 action Drop len 118 if breth0 | ipv6 src fc00:f853:ccd:e793::1 dst fc00:f853:ccd:e793::10 | icmpv6 type 128 code 0 |
|
@rameshsahoo111: This pull request references Jira Issue OCPBUGS-76699, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/jira-refresh |
|
/jira refresh |
|
@rameshsahoo111: This pull request references Jira Issue OCPBUGS-76699, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/retest-required |
|
/testwith openshift/ingress-node-firewall/master/unit-test #705 |
|
/retest |
|
/lgtm |
|
hm, no lgtm-means-approve here? |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: danwinship, rameshsahoo11 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@rameshsahoo11: DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/verified by logs manually |
|
@rameshsahoo11: Jira verification commands are restricted to collaborators for this repo. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@danwinship I'm not a collaborator for this report as I get Jira verification commands are restricted to collaborators for this repo. Can you assist? |
|
/verified by @anuragthehatter |
|
@anuragthehatter: This PR has been marked as verified by DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/jira refresh |
|
@anuragthehatter: This pull request references Jira Issue OCPBUGS-76699, which is invalid:
Comment DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
Need to fix the
Change your bug to target 5.0, do |
|
/jira refresh |
|
@rameshsahoo11: This pull request references Jira Issue OCPBUGS-76699, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
Thanks @danwinship and @anuragthehatter for your assistance. The invalid jira flags has been removed after I set the target version to 5.0 as suggested. @anuragthehatter kindly review it again and do the needful. |
|
@rameshsahoo11: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
@rameshsahoo11: Jira Issue OCPBUGS-76699: All pull requests linked via external trackers have merged: All linked pull requests have the DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/cherry-pick release-4.22 |
|
@rameshsahoo11: only openshift org members may request cherry picks. If you are already part of the org, make sure to change your membership to public. Otherwise you can still do the cherry-pick manually. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/cherry-pick release-4.22 |
|
@danwinship: new pull request created: #711 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Previously, firewall packet events were logged as three separate syslog messages (rule info, IP addresses, protocol details), making log parsing and analysis more difficult. This change consolidates all packet event information into a single log line for better observability.
Changes:
Example output format:
Before (3 lines):
After (1 line):
2026-02-06 09:04:59 +0000 UTC ruleId 10 action Drop len 74 if br1 | ipv4 src 192.xx.xx.149 dst 192.xx.xx.56 | tcp srcPort 56354 dstPort 22This improves log grep-ability, parsing, and integration with log aggregation tools where single-line entries are preferred.
Test result from ovnkind cluster after appling the fix
Summary by CodeRabbit