-
Notifications
You must be signed in to change notification settings - Fork 13
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
Secrets Rotation: only write secret files if changed #432
Conversation
201d2f7
to
8a8aff0
Compare
4b3b6e8
to
5ada5a9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, very nice job on the UT!!!
if _, err := writer.Write(fileContent.Bytes()); err != nil { | ||
return err | ||
} | ||
prevFileChecksums[groupName] = checksum |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to log an INFO level message here that an individual file has been written?
Or do we assume that the user will deduce that the secret file has been written if we don't see the No change in secret files, no secret files written
for this file, but we do see the DAP/Conjur Secrets pushed to shared volume successfully
at the very end of the refresh cycle?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's necessary to add a new log statement for this functionality. Nothing has changed in that scenario and the "Secrets pushed to shared volume" log at the end should be sufficient. I think it's more important to log if they aren't written since this could be a source of problems if, say, the secrets file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. The only weird aspect is that the logs will continually show "Secrets pushed to shared volume" when they really aren't (after the first write). But then again, we don't want to make the logs too chatty either.
Code Climate has analyzed commit e54f879 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 89.2% (50% is the threshold). This pull request will bring the total coverage in the repository to 92.5% (0.0% change). View more on Code Climate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Desired Outcome
Overview:
For conjur secrets rotation functionality for push-to-file mode, the SP's pushtofile package needs to be able to detect changes in secret file content, and conditionally write secret files only if content has been changed since the last write of the file.
Notes:
Implemented Changes
Connected Issue/Story
CyberArk internal issue link: ONYX-15541
Definition of Done
Changelog
CHANGELOG update
Test coverage
changes, or
Documentation
README
s) were updated in this PRBehavior
Security