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

Gitleaks GitHub Action Rule #250

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Gitleaks GitHub Action Rule #250

wants to merge 6 commits into from

Conversation

dussab
Copy link
Member

@dussab dussab commented Dec 19, 2024

Checks to make sure Gitleaks GitHub action is enabled to prevent the leakage of passwords or keys.

Checks to make sure Gitleaks GitHub action is enabled to prevent the leakage of passwords or keys.
@dussab dussab requested a review from a team as a code owner December 19, 2024 17:32
guidance: |
Ensure that Gitleak is configured and enabled for the repository.
Gitleaks is an open-source secret scanner for git repositories, files, and directories.
For more information, see the [GitHub Action Gitleaks](https://github.com/gitleaks/gitleaks) documentation.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: should we show a sample of how a workflow with this action looks like?

Copy link
Member Author

Choose a reason for hiding this comment

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

I updated the guidance and linked directly to the github action repo. Do you think i should add the Github action configuration directly to the guidance section?


default message := "Gitleaks GitHub action is not configured"
default allow := false
allow if {"gitleaks/gitleaks-action" in actions
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated to use contains keyword.

release_phase: alpha
type: rule-type
name: gitleaks_github_action
display_name: Enable Gitleak to prevent leakage of passwords or keys
Copy link
Member

Choose a reason for hiding this comment

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

s/Gitleak/Gitleaks/

https://github.com/gitleaks/gitleaks seems to be consistently plural

Copy link
Member Author

Choose a reason for hiding this comment

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

Good eyes. Updated text to be consistently plural

Comment on lines +36 to +38
default message := "Gitleaks GitHub action is not configured"
default allow := false
allow if contains(actions[_], "gitleaks/gitleaks-action")
Copy link
Member

Choose a reason for hiding this comment

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

Do you want to check that the workflow is on for both pull_request and push events?

Copy link
Member

Choose a reason for hiding this comment

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

Also, do you want to add a remediation using the usage example from either the action or the repo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants