Skip to content
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

Re-auth if signal got send again after added to cache #27241

Merged
merged 1 commit into from Aug 25, 2023

Conversation

meyskens
Copy link
Member

@meyskens meyskens commented Aug 3, 2023

This change will re-trigger the auth mechanism if a signal got send but the entry was already in cache.
It adds a 1 second backoff time to allow for the backend map to finish updating, which is why it was added in the first place.

Why does this happen? If somebody removes the entry in the bpf map that is not notified to the cell cache (meaning an external actor) we currently refuse to do the auth handshake again till the entry in the cache is gone.

It does add a small backoff time to not cause un-needed handshakes when data arrives and signals auth_needed between the mutex being released and the datapath getting the update. The current time it will allow for that is 1 second which seems to be okay. It is currently not configurable as it is quite an internal complexity. However I am open to reasons we should export it.

Fixes: #27183

Do mutual authentication handshake again if mismatch between bpf map and cached map happens

@meyskens meyskens requested a review from a team as a code owner August 3, 2023 09:48
@meyskens meyskens requested a review from sayboras August 3, 2023 09:48
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Aug 3, 2023
@meyskens meyskens added the release-note/bug This PR fixes an issue in a previous release of Cilium. label Aug 3, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Aug 3, 2023
@meyskens meyskens added dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. area/servicemesh GH issues or PRs regarding servicemesh feature/authentication labels Aug 3, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot removed dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. labels Aug 3, 2023
Copy link
Member

@joestringer joestringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks! I have a few questions that I think are inconsequential for the fix.

pkg/auth/manager.go Outdated Show resolved Hide resolved
pkg/auth/manager.go Outdated Show resolved Hide resolved
pkg/auth/manager.go Show resolved Hide resolved
@joestringer joestringer added the needs-backport/1.14 This PR / issue needs backporting to the v1.14 branch label Aug 4, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot added this to Needs backport from main in 1.14.1 Aug 4, 2023
pkg/auth/manager.go Show resolved Hide resolved
@nebril nebril added this to Needs backport from main in 1.14.2 Aug 10, 2023
@nebril nebril removed this from Needs backport from main in 1.14.1 Aug 10, 2023
@meyskens meyskens force-pushed the meyskens/robust-auth-map branch 4 times, most recently from b7ff839 to 332fa25 Compare August 23, 2023 11:31
@meyskens
Copy link
Member Author

/test

pkg/auth/cell.go Outdated Show resolved Hide resolved
This change will re-trigger the auth mechanism if a signal got send but
the entry was already in cache.
It adds a 1 second backoff time to allow for the backend map to finish
updating, which is why it was added in the first place.

Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
Signed-off-by: Maartje Eyskens <maartje.eyskens@isovalent.com>
@meyskens
Copy link
Member Author

/test

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Aug 25, 2023
@borkmann borkmann merged commit c45dbb9 into cilium:main Aug 25, 2023
60 checks passed
@pippolo84 pippolo84 mentioned this pull request Aug 28, 2023
9 tasks
@pippolo84 pippolo84 added the backport-pending/1.14 The backport for Cilium 1.14.x for this PR is in progress. label Aug 28, 2023
@pippolo84 pippolo84 removed the needs-backport/1.14 This PR / issue needs backporting to the v1.14 branch label Aug 28, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from main to Backport pending to v1.14 in 1.14.2 Aug 28, 2023
@michi-covalent michi-covalent added backport-done/1.14 The backport for Cilium 1.14.x for this PR is done. and removed backport-pending/1.14 The backport for Cilium 1.14.x for this PR is in progress. labels Sep 9, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Backport pending to v1.14 to Backport done to v1.14 in 1.14.2 Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/servicemesh GH issues or PRs regarding servicemesh backport-done/1.14 The backport for Cilium 1.14.x for this PR is done. feature/authentication ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/bug This PR fixes an issue in a previous release of Cilium.
Projects
No open projects
1.14.2
Backport done to v1.14
Development

Successfully merging this pull request may close these issues.

Mutual Auth does not handle having auth table rules removed by non-agent actors
6 participants