Skip to content

Conversation

@erm-g
Copy link
Contributor

@erm-g erm-g commented Apr 28, 2023

Part of RBAC audit logging effort for authz. The functionality in this PR includes a built in StdOut logger (prints the whole Event to stdout in json format)

RELEASE NOTES:

  • TBD

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Apr 28, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@erm-g erm-g requested review from gtcooke94 and rockspore April 28, 2023 03:38
Copy link
Contributor

@gtcooke94 gtcooke94 left a comment

Choose a reason for hiding this comment

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

Good start, I think we definitely want to split this into a PR for the stdout logger and a PR for XDS registry and parsing, then title them accordingly

Copy link
Contributor

@rockspore rockspore left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. Left some comments. Also suggest simply some variable names following Go's style. Please follow existing code in the repo to do logging instead of fmt.Println

@rockspore rockspore changed the title Audit logger registry authz: Audit logger registry Apr 28, 2023
@erm-g erm-g marked this pull request as ready for review May 8, 2023 02:14
@erm-g erm-g changed the title authz: Audit logger registry authz: Stdout logger May 8, 2023
@erm-g erm-g requested review from gtcooke94 and rockspore May 8, 2023 16:18
Copy link
Contributor

@gtcooke94 gtcooke94 left a comment

Choose a reason for hiding this comment

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

Looks good! Have a few comments and some golang convention items to change

Copy link
Contributor

@gtcooke94 gtcooke94 left a comment

Choose a reason for hiding this comment

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

Looks good! Have a few comments and some golang convention items to change

@erm-g erm-g added the Type: Security A bug or other problem affecting security label May 9, 2023
@easwars
Copy link
Contributor

easwars commented May 10, 2023

@erm-g Please don't mark comment threads as resolved. The policy we follow is that the reviewer marks them as resolved, once they feel that the comment has been appropriately addressed. It's a pain to unresolve every comment and see if they have been addressed appropriately. Thanks.

erm-g added 2 commits May 14, 2023 03:56
…ger struct func. Add timestamp testing logic. Add registry presense test.
@erm-g erm-g requested a review from rockspore May 15, 2023 03:03
@easwars
Copy link
Contributor

easwars commented May 15, 2023

@erm-g : Looks like there are more comments from the security team here. Please let me know once you have addressed all of them, and want me to take another pass. Thanks.

@erm-g erm-g requested a review from rockspore May 16, 2023 02:16
Copy link
Contributor

@rockspore rockspore left a comment

Choose a reason for hiding this comment

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

One nit was not resolved yet. The rest LGTM! Thanks.

Comment on lines 70 to 71
l := log.New(&buf, "", 0)
builder := &loggerBuilder{goLogger: l}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: inline l into the next line.

builder := &loggerBuilder{goLogger: l}
auditLogger := builder.Build(nil)
auditLogger.Log(test.event)
var container map[string]interface{}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Consider adding newlines to logically separate the steps of the test. At the very least, it would be good to separate out the following steps using newlines: setup, actual test logic, verification.

@easwars
Copy link
Contributor

easwars commented May 16, 2023

LGTM. Some very minor nits. Feel free to merge without another pass from me.

@erm-g erm-g merged commit 52fef6d into grpc:master May 17, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Type: Feature New features or improvements in behavior Type: Security A bug or other problem affecting security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants