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

Warn about empty secret and skip the update in the webhook updater tool #3208

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

jhrozek
Copy link
Contributor

@jhrozek jhrozek commented Apr 30, 2024

Summary

I was testing the webhook update locally and realized that it's too easy
to let the webhook update proceed with an empty secret. On the server
side we already have a similar check.

Change Type

  • Bug fix (resolves an issue without affecting existing features)
  • Feature (adds new functionality without breaking changes)
  • Breaking change (may impact existing functionalities or require documentation updates)
  • Documentation (updates or additions to documentation)
  • Refactoring or test improvements (no bug fixes or new functionality)

Testing

You'd pass the secret file with an env variable:

MINDER_WEBHOOK_CONFIG_WEBHOOK_SECRET_FILE=.secrets/webhook_secret ./bin/minder-server webhook update -p github

If you omit the secret file, you now get a failure, previously the tool would have proceeded with the update:

./bin/minder-server webhook update -p github

Review Checklist:

  • Reviewed my own code for quality and clarity.
  • Added comments to complex or tricky code sections.
  • Updated any affected documentation.
  • Included tests that validate the fix or feature.
  • Checked that related changes are merged.

I was testing the webhook update locally and realized that it's too easy
to let the webhook update proceed with an empty secret. On the server
side we already have a similar check.
@jhrozek jhrozek requested a review from a team as a code owner April 30, 2024 08:45
@coveralls
Copy link

Coverage Status

coverage: 50.523% (+0.006%) from 50.517%
when pulling 2c5b5da on jhrozek:webhook_rotate_warn_empty_secret
into 30a63bb on stacklok:main.

@jhrozek jhrozek merged commit 3b90c28 into mindersec:main Apr 30, 2024
21 checks passed
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.

3 participants