-
Notifications
You must be signed in to change notification settings - Fork 431
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
chore: Protect pentesting user and role from sweepers #3426
base: dev
Are you sure you want to change the base?
Conversation
Integration tests cancelled for f33be25e3621e3db996ac3a9b3a4636ae8268599 |
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.
- Looks like docs check fails
- Nit: this would not matter in this case, but in general we should not cancel tests on PRs with changes in the sweepers.
pkg/sdk/sweepers.go
Outdated
@@ -201,7 +203,7 @@ func getRoleSweeper(client *Client, suffix string) func() error { | |||
return fmt.Errorf("sweeping roles ended with error, err = %w", err) | |||
} | |||
for _, role := range roles { | |||
if strings.HasSuffix(role.Name, suffix) && !slices.Contains([]string{"ACCOUNTADMIN", "SECURITYADMIN", "SYSADMIN", "ORGADMIN", "USERADMIN", "PUBLIC"}, role.Name) { | |||
if strings.HasSuffix(role.Name, suffix) && !slices.Contains([]string{"ACCOUNTADMIN", "SECURITYADMIN", "SYSADMIN", "ORGADMIN", "USERADMIN", "PUBLIC", snowflakeroles.PentestingRole.Name()}, role.Name) { |
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.
Nit: can we use []sdk.AccountObjectIdentifier here with roles from snowflakeroles
package?
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.
I dont think so, currently the sweepers are in SDK pkg so it would be circular dep, there is a TODO for it
Integration tests failure for 0ea1f66c9d3dcebd7e1942eb009e381e0b4b7a6d |
Integration tests failure for c42e2951e47176471a731e40dd327abf75fac8e7 |
Changes