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

Bitbucket webhook: missing signature #474

Closed
Zophar78 opened this issue Feb 13, 2019 · 3 comments
Closed

Bitbucket webhook: missing signature #474

Zophar78 opened this issue Feb 13, 2019 · 3 comments
Labels
feature New functionality/enhancement provider/bitbucket

Comments

@Zophar78
Copy link

Zophar78 commented Feb 13, 2019

I'm using bitbucket server (no cloud edition) version 5.6.2.

The atlantis server is started with the following parameter:
"--atlantis-url=http://atlantis.local:4141",
"--bitbucket-base-url=https://bitbucket.local",
"--bitbucket-webhook-secret='b8db1d572aa87921edddb772fda4c8ac54e9de80'",
"--bitbucket-user=phl",
"--bitbucket-token=Nzc0OTkxNTU1REMyOg8BHeT6dFJPKHLBvfFmJrQZzZxR",
"--repo-whitelist=*"

When i test the webhook i got this response (body):
request did not pass validation: missing signature

The request headers sent by the webhook of my bitbucket currently installed is:
X-Request-Id: d872ad25-24fe-4278-a73a-2a10ed6b653d
X-Event-Key: diagnostics:ping

As we can see the "X-Hub-Signature" is missing. And this is used for the validation here:
https://github.com/runatlantis/atlantis/blob/v0.4.15/server/events_controller.go#L173

@Zophar78
Copy link
Author

Zophar78 commented Feb 13, 2019

In fact it's the webhook "test-connection" feature that don't send any "X-Hub-Signature" even if we set a webhooksecret.
We should ensure the event "diagnostics:ping" doesn't run any ValidateSignature.

@lkysow
Copy link
Member

lkysow commented Feb 13, 2019

So the other events are fine and send the signature?

@Zophar78
Copy link
Author

Zophar78 commented Feb 14, 2019

As far as I tested (PR created/modified) i confirm the x-hub-signature is present with all other events yes. I also did a quick test with the latest version of bitbucket server (6.0.0). Here's the headers sent in the request of the test (With webhook secret set)
X-Event-Key: diagnostics:ping
X-Request-Id: 7923e92c-08fa-4ef7-90d0-b1ea9e69f013
Content-Type: application/json

Still no "X-Hub-Signature" header.

@lkysow lkysow added the feature New functionality/enhancement label Apr 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality/enhancement provider/bitbucket
Projects
None yet
Development

No branches or pull requests

3 participants