Repository navigation
in_forward: accept additional shared keys for key rotation - #5669
Conversation
Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
Watson1978
left a comment
There was a problem hiding this comment.
Thanks for the PR. The rotation flow works end to end in my tests. out_forward senders using the old key and the new key both got through, including one with keepalive and require_ack_response. A sender with an unrelated key was still rejected. Since the PONG is signed with the matched key, senders do not need any change.
One thing should be fixed before merge. An empty entry in additional_shared_keys passes the shared key check, and a null entry breaks the check for the keys after it (see the inline comment). The other two comments are nits.
FYI, malformed JSON in this option, such as additional_shared_keys "[oldkey", puts part of the value in the startup error log. This comes from the shared config code, so we will fix it separately. No change is needed in this PR.
Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
Watson1978
left a comment
There was a problem hiding this comment.
Thanks for the update. I checked 32875e2.
I tried the four invalid configurations from my previous SHOULD comment in both <security> and <client>. All eight failed at configure time with additional_shared_keys must not contain an empty key. Events from out_forward senders using the old and new keys both arrived. The @shared_keys change and the new test for a <client> that inherits the <security> keys look good.
One small follow-up for fluent/fluentd-docs-gitbook#728. The comma example is there. Could you also include additional_shared_keys ["[oldkey"] from our earlier thread? In classic configuration, additional_shared_keys "[oldkey" is parsed as JSON and fails.
LGTM.
Add the new parameter to <security> and <client>, and a how-to for rotating the shared key. See fluent/fluentd#5669. Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
Which issue(s) this PR fixes:
Fixes #4024
What this PR does / why we need it:
Adds
additional_shared_keysto<security>and<client>in in_forward. A client that proves any of the configured keys gets in, and the PONG is signed with the key it used, so out_forward verifies it without any change on the sender side.That makes a zero-downtime rotation possible: add the new key on the receiver, move the senders over at their own pace, then drop the old one. A
<client>with its ownshared_keyonly uses its own keys, same as today. Without the new param nothing changes.Docs Changes:
fluent/fluentd-docs-gitbook#728
Release Note:
in_forward: add
additional_shared_keysto accept more than one shared key, e.g. while rotating keys