Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@dividedmind
Copy link
Contributor

Closes #572.

What does this pull request do?

Ultimately, this pull request adds audit events for entitlement operations (roles#add_member and roles#delete_member).

This addition prompted a thorough refactoring of audit code. Hopefully now it's a bit clearer and better organized.

What background context can you provide?

Audit events were generated for policy loading, but similar events when using entitlements were missing. This brings them in.

Where should the reviewer start?

It's probably a good idea to take a look at the cukes and see if the audit messages seem reasonable. In particular I wasn't sure if the audit events generated from entitlements should carry a policy@43868 structured data element; when loading a policy, it describes which version of which policy caused the given change.

Then, since this PR encompasses a supporting refactoring in addition to the nominal change, I suggest examining the code commit-by-commit instead of wholesale.

How should this be manually tested?

When a server from this codebase is run and entitlement endpoints are being used, there should be messages in the log stream describing these actions.

Link to build in Jenkins (if appropriate)

https://jenkins.conjur.net/job/cyberark--conjur/job/entitlement-events/1/

Questions:

Does this have automated Cucumber tests?

Yes. However they're not currently ran on Jenkins as they rely on an in-process server (#579).

This change brings Layout/MultilineMethodCallIndentation and
Layout/AlignParameters in line with the most common style currently
used in the project.
- Abstract audit events
- Add a new Util::Struct class for clearer and more concise
  explicit declaration of structures
- Move some subclasses of Audit to better places in the codebase
Add the tests using audit steps for the policy events already emitted.
Also modify matchers in audit_steps to disregard the order of
parameters in structured data for more robust tests.
To support emitting audit events from entitlements,
policy_version is now an optional parameter for Audit::Event::Policy.
You can provide user role instead, and the event will use that for
auth@43868 and won't have policy@43868 field.
Copy link
Contributor

@micahlee micahlee left a comment

Choose a reason for hiding this comment

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

I really like the refactor! I was able to understand and follow everything clearly, without having looked at the audit code before.

I'm going to leave the approval for Alan, but I have no changes to request on either the refactor or the entitlement audit messages. The only concern I have is the tests not running in the CI pipeline yet, but as there is a ticket to address this, I'm satisfied for now.

@dividedmind dividedmind requested a review from jonahx June 22, 2018 21:39
Copy link
Contributor

@apotterri apotterri 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, thanks.

@dividedmind dividedmind merged commit b5ac452 into master Jun 26, 2018
@ghost ghost removed the review label Jun 26, 2018
conjur-jenkins pushed a commit that referenced this pull request Nov 22, 2024
CNJR-6108 Add delete items to policy dryrun REST API response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants