Skip to content
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

🐛 pkg/server: ensure that home workspace handler gets authz with audit … #2628

Merged
merged 1 commit into from
Jan 18, 2023

Conversation

s-urbaniak
Copy link
Contributor

…logging

Summary

This resolves #2627
This resolves #2627
This resolves #2627
This resolves #2627

Related issue(s)

Fixes #2627

apiHandler = genericapiserver.DefaultBuildHandlerChainFromAuthz(apiHandler, genericConfig)
genericConfig.Authorization.Authorizer = authorizerWithoutAudit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't authorizerWithoutAudit what we pass to WithHomeWorkspaces ? (line 342)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if I don't pass it there, I don't get audits at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me retest 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, i believe something changed and WithHomeWorkspaces now hosts regular workspaces as well after the refactoring? (not sure)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my audit logs are empty with what is in main without this PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we be passing an authoriser decorated with authorization.EnableAuditLogging ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that's done in line 335 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

genericConfig.Authorization.Authorizer = authorization.EnableAuditLogging(genericConfig.Authorization.Authorizer)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't we pass genericConfig.Authorization.Authorizer which is overwritten in line 337 (authorizerWithoutAudit) to WithHomeWorkspaces?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

he, yes, that's confusing 😆 You're right, but the audit enabled handler is given to the wrapped apiHandler. I'll comment to make it clearer 👍

@s-urbaniak s-urbaniak changed the title pkg/server: ensure that home workspace handler gets authz with audit … 🐛 pkg/server: ensure that home workspace handler gets authz with audit … Jan 16, 2023
@p0lyn0mial
Copy link
Contributor

/lgtm
/approve

thanks for the comment!

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 18, 2023
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jan 18, 2023
@sttts
Copy link
Member

sttts commented Jan 18, 2023

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 18, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: p0lyn0mial, sttts

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 18, 2023
@p0lyn0mial
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 18, 2023
@openshift-merge-robot openshift-merge-robot merged commit 274f099 into kcp-dev:main Jan 18, 2023
@s-urbaniak s-urbaniak deleted the issue-2627 branch January 18, 2023 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: audit logs don't contain entries for kcp audit decisions
4 participants