Closed bcho closed 7 months ago
In our production logs, we detected a mismatched role assignment & username in the log line:
https://github.com/kubeguard/guard/blob/28c225879ee593277a7a42adfd5d350009450c39/authz/providers/azure/rbac/checkaccessreqhelper.go#L39
This is due to this log line is referencing a global variable username:
username
https://github.com/kubeguard/guard/blob/28c225879ee593277a7a42adfd5d350009450c39/authz/providers/azure/rbac/checkaccessreqhelper.go#L51
When the server is serving multiple requests at the same time, the access to this variable will cause data race. We have reproduced this issue in unit test with -race enabled.
-race
In our production logs, we detected a mismatched role assignment & username in the log line:
https://github.com/kubeguard/guard/blob/28c225879ee593277a7a42adfd5d350009450c39/authz/providers/azure/rbac/checkaccessreqhelper.go#L39
This is due to this log line is referencing a global variable
username
:https://github.com/kubeguard/guard/blob/28c225879ee593277a7a42adfd5d350009450c39/authz/providers/azure/rbac/checkaccessreqhelper.go#L51
When the server is serving multiple requests at the same time, the access to this variable will cause data race. We have reproduced this issue in unit test with
-race
enabled.