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

Add audit message for List request #2652

Merged
merged 1 commit into from
Sep 19, 2022
Merged

Add audit message for List request #2652

merged 1 commit into from
Sep 19, 2022

Conversation

aloncarmel111
Copy link
Contributor

Desired Outcome

This PR adds an audit log message for List request using the API endpoint GET /resources

Implemented Changes

Describe how the desired outcome above has been achieved with this PR. In
particular, consider:

  • Example audit message

Successful Audit:

<86>1 2022-09-15T07:25:34.064+00:00 cc00d96ebc41 conjur test-id list [auth@43868 user="CyberArk:user:admin"][subject@43868 limit="3"][client@43868 ip="172.17.0.1"][action@43868 result="success" operation="list"][meta sequenceId="2"] CyberArk:user:admin successfully listed resources with parameter: {:limit=>"3"}

Failed Audit:

<84>1 2022-09-15T11:12:48.797+00:00 cc00d96ebc41 conjur test-id list [auth@43868 user="CyberArk:user:admin"][subject@43868 role="conjurr:user:alice"][client@43868 ip="172.17.0.1"][action@43868 result="failure" operation="list"][meta sequenceId="2"] CyberArk:user:admin failed to listed resources with parameter: {:role=>"conjurr:user:alice"}: The authenticated user lacks the necessary privilege

Connected Issue/Story

Resolves #ONYX-23737)

Definition of Done

At least 1 todo must be completed in the sections below for the PR to be
merged.

Changelog

  • The CHANGELOG has been updated, or
  • This PR does not include user-facing changes and doesn't require a
    CHANGELOG update

Test coverage

  • This PR includes new unit and integration tests to go with the code
    changes, or
  • The changes in this PR do not require tests

Documentation

  • Docs (e.g. READMEs) were updated in this PR
  • A follow-up issue to update official docs has been filed here: insert issue ID
  • This PR does not require updating any documentation

Behavior

  • This PR changes product behavior and has been reviewed by a PO, or
  • These changes are part of a larger initiative that will be reviewed later, or
  • No behavior was changed with this PR

Security

  • Security architect has reviewed the changes in this PR,
  • These changes are part of a larger initiative with a separate security review, or
  • There are no security aspects to these changes

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.

Thanks @aloncarmel111! I just noticed a small issue in the message text.

Would you also please clean up the code climate reports on this PR? I notice there are two about blank lines in the changelog that can be ignored. The others are legitimate, though. Thanks!

These don't need to be fixed:
image

app/models/audit/event/list.rb Outdated Show resolved Hide resolved
micahlee
micahlee previously approved these changes Sep 15, 2022
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.

LGTM!

@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [1.18.5] - 2022-09-14

### Added
- List resources request (`GET /resources`) now produce audit events.
Copy link

Choose a reason for hiding this comment

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

Lists should be surrounded by blank lines

micahlee
micahlee previously approved these changes Sep 15, 2022
@codeclimate
Copy link

codeclimate bot commented Sep 19, 2022

Code Climate has analyzed commit ac0e71d and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Style 1

The test coverage on the diff in this pull request is 91.3% (50% is the threshold).

This pull request will bring the total coverage in the repository to 90.0% (-1.5% change).

View more on Code Climate.

@aloncarmel111 aloncarmel111 merged commit dace15f into master Sep 19, 2022
@aloncarmel111 aloncarmel111 deleted the audit-list branch September 19, 2022 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants