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 more rest remediations #1129

Merged
merged 1 commit into from
Oct 6, 2023
Merged

Conversation

jhrozek
Copy link
Contributor

@jhrozek jhrozek commented Oct 6, 2023

Adds several more REST remediations. The only remaining ones are branch
protection which still need some work due to the way they work (you need to
PUT the whole request body, so we need to figure out a way to merge the
existing request)

To test them, you can either click the button in the UI to disable the secret
scanning or call:

curl -L -X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/jakubtestorg/testrepo \
-d '{ "security_and_analysis": {"secret_scanning": { "status": "disabled" } } }'

To test the selected actions:

curl -L -X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/jakubtestorg/testrepo/actions/permissions \
-d '{ "enabled": true, "allowed_actions": "all" }'

You should see your actions being reverted by mediator - note that for some reason
GH doesn't send a webhook back once you set the allowed_actions, so you might want
to trigger reconcile via another way..

@rdimitrov rdimitrov merged commit b5ce71c into mindersec:main Oct 6, 2023
12 checks passed
@rdimitrov rdimitrov deleted the some_rest_remediations branch October 6, 2023 19:12
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.

2 participants