-
Notifications
You must be signed in to change notification settings - Fork 1.8k
in_forward: Fix incorrect user auth sequence #11028
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
WalkthroughThe secure-forward handshake in Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant C as Client
participant S as Server (fw_prot)
participant P as check_ping
participant W as send_pong
participant L as Logger
C->>S: PING (secure_forward)
S->>P: validate/authenticate
P-->>S: ping_ret (>=0 ok, <0 auth fail, -1 error)
alt ping_ret == -1 (validation error)
S->>L: log validation error
S-->>C: Close connection / handshake error
else ping_ret < 0 (authentication failure)
S->>W: send PONG (auth-fail signal)
W-->>S: pong_ret (>=0 ok, -1 write error)
alt pong_ret == -1 (write failure)
S->>L: log write failure
S-->>C: Close connection
else pong_ret >= 0
S->>L: note auth failure and terminate handshake (clean up)
S-->>C: End handshake (no error)
end
else ping_ret >= 0 (auth ok)
S->>W: send PONG (success)
W-->>S: pong_ret (>=0 ok, -1 write error)
alt pong_ret == -1 (write failure)
S->>L: log write failure
S-->>C: Close connection
else pong_ret >= 0
S-->>C: Handshake complete
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ 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. Comment |
Signed-off-by: Hiroshi Hatake <[email protected]>
c27a546
to
55a9b8e
Compare
The previous pingpong handshaking is not enough for failing handshake case.
We need to distinguish where the error happens on pingpong handshaking.
This could be made rigid approach to handle this.
Follows up #11026.
This PR is tested with Fluent Bit (receiver)/Fluent Bit (sender) and Fluent Bit (receiver)/Fluentd (sender) cases.
Enter
[N/A]
in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
Fluent Bit (Server Configs)
Fluent Bit (Client Configs)
Fluentd Sender configs
Both of Fluent Bit case
Shared_Key -> OK
Empty_Shared_Key -> OK
Fluent Bit (receiver)/Fluentd (sender) case
Shared_Key -> OK
Empty_Shared_Key -> OK
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
ok-package-test
label to test for all targets (requires maintainer to do).Documentation
Backporting
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.
Summary by CodeRabbit
Bug Fixes
Refactor