Skip to content

Commit

Permalink
oauth: audit log oauthaccesstokens if fresh 4.6 install
Browse files Browse the repository at this point in the history
  • Loading branch information
sttts committed Sep 16, 2020
1 parent 02e63b1 commit 0954258
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion pkg/operator/starter.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,27 @@ func RunOperator(ctx context.Context, controllerConfig *controllercmd.Controller
return err
}

// TODO(4.7): switch over to secure access-token logging by default and delete old non-sha256 tokens
auditPolicyPathGetterWithAccessTokenLogs := func(profile string) (string, error) {
apiServerConfig, err := configInformers.Config().V1().APIServers().Lister().Get("cluster")
if err != nil {
return "", err
}

if apiServerConfig.Annotations["oauth-apiserver.openshift.io/secure-token-storage"] == "true" {
return auditPolicyPahGetter("secure-oauth-storage-" + profile)
}
return auditPolicyPahGetter(profile)
}

configObserver := configobservercontroller.NewConfigObserver(
kubeInformersForNamespaces.InformersFor(operatorclient.TargetNamespace),
kubeInformersForNamespaces.InformersFor(libgoetcd.EtcdEndpointNamespace),
operatorClient,
resourceSyncController,
operatorConfigInformers,
configInformers,
auditPolicyPahGetter,
auditPolicyPathGetterWithAccessTokenLogs,
controllerConfig.EventRecorder,
)

Expand Down

0 comments on commit 0954258

Please sign in to comment.