-
Notifications
You must be signed in to change notification settings - Fork 41
NETOBSERV-2198: IPsec support #538
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
Conversation
b85b6d1
to
539f368
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #538 +/- ##
==========================================
- Coverage 27.34% 26.59% -0.75%
==========================================
Files 47 47
Lines 4988 5121 +133
==========================================
- Hits 1364 1362 -2
- Misses 3521 3653 +132
- Partials 103 106 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
d1c4b50
to
e0ce8ed
Compare
/ok-to-test |
New images: These will expire after two weeks. To deploy this build, run from the operator repo, assuming the operator is running: USER=netobserv VERSION=5162ef0 make set-agent-image |
e0ce8ed
to
61e4bfe
Compare
/ok-to-test |
New images: These will expire after two weeks. To deploy this build, run from the operator repo, assuming the operator is running: USER=netobserv VERSION=bdedd3c make set-agent-image |
61e4bfe
to
6430115
Compare
/ok-to-test |
New images: These will expire after two weeks. To deploy this build, run from the operator repo, assuming the operator is running: USER=netobserv VERSION=d4ab178 make set-agent-image |
6430115
to
f73f9d5
Compare
f73f9d5
to
75237b6
Compare
75237b6
to
51b45a8
Compare
@msherif1234: This pull request references NETOBSERV-1668 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the epic to target either version "4.19." or "openshift-4.19.", but it targets "netobserv-1.9" instead. In 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. |
bpf/ipsec.h
Outdated
extra_metrics->end_mono_time_ts = bpf_ktime_get_ns(); | ||
extra_metrics->eth_protocol = eth_protocol; | ||
extra_metrics->flow_encrypted_ret = flow_encrypted_ret; | ||
extra_metrics->flow_encrypted = flow_encrypted_ret == 0 ? true : false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if a flow contains both encrypted and unencrypted packets, here we keep only the last packet state.
I'd argue it's more important to show any unencrypted state, no?
So something like:
if (extra_metrics->flow_encrypted && flow_encrypted_ret != 0) {
extra_metrics->flow_encrypted = false;
}
wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the encrypted flag name my be missleading here as it work both ways
for xfrm_input where we decrypt and check decryption state, while in xfrm_out this the encryption path , maybe I should rename them here as well to ipsec_ret and ipsec_success similar to the json ?
pkg/model/flow_content.go
Outdated
if other.FlowEncrypted { | ||
p.AdditionalMetrics.FlowEncrypted = other.FlowEncrypted | ||
} | ||
if p.AdditionalMetrics.FlowEncryptedRet != other.FlowEncryptedRet { | ||
p.AdditionalMetrics.FlowEncryptedRet = other.FlowEncryptedRet | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same remark as in the bpf code: I think we should prioritize showing errors over successes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
won't the above show both ?
579edfb
to
43966d2
Compare
bpf/ipsec.h
Outdated
if (extra_metrics != NULL) { | ||
extra_metrics->end_mono_time_ts = bpf_ktime_get_ns(); | ||
extra_metrics->eth_protocol = eth_protocol; | ||
extra_metrics->flow_encrypted_ret = flow_encrypted_ret; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't update flow_encrypted_ret to replace it with a success, if it had an error I think
extra_metrics->flow_encrypted_ret = flow_encrypted_ret; | |
if (flow_encrypted_ret != 0) { | |
extra_metrics->flow_encrypted_ret = flow_encrypted_ret; | |
} |
43966d2
to
142bea6
Compare
@msherif1234: This pull request references NETOBSERV-2198 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.19.0" version, but no target version was set. In 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. |
@msherif1234: The following test failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
Signed-off-by: Mohamed Mahmoud <[email protected]>
Signed-off-by: Mohamed Mahmoud <[email protected]>
Signed-off-by: Mohamed Mahmoud <[email protected]>
ce79dec
to
a576882
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: msherif1234 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Description
probing XFRM input and output processing to know if packets came encrypted or left encrypted
[root@ip-10-0-1-35 /]# ip xfrm state src 10.0.1.158 dst 10.0.1.35 proto esp spi 0x17e83b29 reqid 16393 mode transport replay-window 0 flag esn aead rfc4106(gcm(aes)) 0x2dff2e25143878e71710cc484f87a0e04a5d9882b9e23643f28692e33935eef6879f7ef5 128 anti-replay esn context: seq-hi 0x0, seq 0x0, oseq-hi 0x0, oseq 0x0 replay_window 128, bitmap-length 4 00000000 00000000 00000000 00000000 sel src 10.0.1.158/32 dst 10.0.1.35/32 proto udp sport 6081
Dependencies
n/a
Checklist
If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.