Skip to content

Commit 5803bd9

Browse files
Merge pull request #345 from joshbranham/bug/fix-sdn-user-override
OSD-21711: Fix admin username that can bypass SDN webhook
2 parents 1cdd943 + 8bd1ef3 commit 5803bd9

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pkg/webhooks/sdnmigration/sdnmigration.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const (
1919
WebhookName string = "sdn-migration-validation"
2020
docString string = `Managed OpenShift customers may not modify the network config type because it can can degrade cluster operators and can interfere with OpenShift SRE monitoring.`
2121
overrideAnnotation string = "unsupported-red-hat-internal-testing"
22-
privilegedHiveUserAccount string = "admin-kubeconfig-signer"
22+
privilegedHiveUserAccount string = "system:admin"
2323
)
2424

2525
var (

pkg/webhooks/sdnmigration/sdnmigration_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,17 @@ func TestAuthorized(t *testing.T) {
3232
},
3333
ExpectAllowed: true,
3434
},
35+
// Hive uses the admin user and we need to bypass the webhook for Hive
3536
{
36-
Name: "system admin should be denied",
37+
Name: "system admin should be allowed",
3738
Request: admissionctl.Request{
3839
AdmissionRequest: admissionv1.AdmissionRequest{
3940
UserInfo: authenticationv1.UserInfo{
4041
Username: "system:admin",
4142
},
4243
},
4344
},
44-
ExpectAllowed: false,
45+
ExpectAllowed: true,
4546
},
4647
{
4748
Name: "non-privileged account should be denied",

0 commit comments

Comments
 (0)