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

feat: Add audit log output #111

Open
wants to merge 32 commits into
base: master
Choose a base branch
from

Conversation

Laugslander
Copy link
Contributor

Adds the audit_log output parameter that captures audit log information in a list of JSON objects. Fixes #110

An audit log object contains the following properties:

  • repo: string
  • target: string
  • action: string
  • secret_name: string
  • secret_hash: string
  • environment: string
  • dry_run: boolean

The secret_hash contains the hashed password. This can be used to track whether a secret actually changes.
Optionally, a custom salt can be provided via the audit_log_hashing_salt to make it more difficult to reverse engineer the secret.

This functionality might be a bit specific for our project's needs. If it is useful for the greater public, feel free to merge. It does not introduce any breaking changes.

@Laugslander Laugslander changed the title Add audit log output feat: Add audit log output Dec 20, 2023
Copy link
Owner

@jpoehnelt jpoehnelt left a comment

Choose a reason for hiding this comment

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

I'm concerned about the handling of the case where a salt has not been provided. As far as I can tell this would mean the hash(value, "") would show up in the logs.

__tests__/main.test.ts Outdated Show resolved Hide resolved
@jpoehnelt
Copy link
Owner

I'm concerned about the handling of the case where a salt has not been provided. As far as I can tell this would mean the hash(value, "") would show up in the logs.

Following up on this to see what your thoughts are?

@Laugslander
Copy link
Contributor Author

I'm concerned about the handling of the case where a salt has not been provided. As far as I can tell this would mean the hash(value, "") would show up in the logs.

Following up on this to see what your thoughts are?

You are right, the unsalted hashed value is printed in the logs.
As a mitigation, I now use the GITHUB_REPOSITORY_ID as the default salt value. What do you think?

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.

No auditability
2 participants