Skip to content

Commit

Permalink
oauth-apiserver: 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 15, 2020
1 parent 32c3b69 commit 8da31ae
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 @@ -604,12 +604,25 @@ func prepareOauthAPIServerOperator(ctx context.Context, controllerContext *contr
return err
}

operatorConfig, err := operatorCtx.configClient.ConfigV1().APIServers().Get(ctx, "cluster", metav1.GetOptions{})
if err != nil {
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) {
if operatorConfig.Annotations["oauth-apiserver.openshift.io/secure-token-storage"] == "true" {
return auditPolicyPathGetter("secure-oauth-storage-" + profile)
}
return auditPolicyPathGetter(profile)
}

configObserver := oauthapiconfigobservercontroller.NewConfigObserverController(
operatorCtx.operatorClient,
operatorCtx.kubeInformersForNamespaces,
operatorCtx.operatorConfigInformer,
operatorCtx.resourceSyncController,
auditPolicyPathGetter,
auditPolicyPathGetterWithAccessTokenLogs,
controllerContext.EventRecorder,
)

Expand Down

0 comments on commit 8da31ae

Please sign in to comment.