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

Webhook does not work as intended #999

Open
piotrt-niceguys opened this issue May 13, 2024 · 7 comments
Open

Webhook does not work as intended #999

piotrt-niceguys opened this issue May 13, 2024 · 7 comments

Comments

@piotrt-niceguys
Copy link

The micromdm service run in

System:
Processor: M1 pro
System: 14.4.1 (23E224)

What version of micromdm are you using?

1.12.1

What micromdm command did you run?

micromdm serve   -server-url='https://my-domain'   -filerepo /repo   -config-path /config  -api-key secret     -tls-cert '/certs/cert.pem'  -tls-key '/certs/key.pem'   -command-webhook-url https://my-domain/webhook

What did you expect to see?

I does not see the that webhook is working on adress

What did you see instead?

I got this messages:

2024-05-13 14:36:07 component=main msg=started
2024-05-13 14:36:07 ts="2024/05/13 12:36:07" msg="push: waiting for push certificate before enabling APNS service provider"
2024-05-13 14:36:07 level=debug component=depsync msg="loaded DEP config" cursor=
2024-05-13 14:36:07 level=info component=depsync msg="waiting for DEP token to be added before starting sync"

Api work fine, but i don't have any data from webhook. Does i require further configuration with mdmctl to work properly?

@jessepeterson
Copy link
Member

What are you doing to expect a web hook callback? Are you sending a command? Enrolling a device? The web hook is event-based. It'll send callbacks when events happen. What event are you trying to get to happen?

Separately, this log:

2024-05-13 14:36:07 ts="2024/05/13 12:36:07" msg="push: waiting for push certificate before enabling APNS service provider"

.. It appears you have not uploaded an APNs push certificate. Have you followed the docs? https://github.com/micromdm/micromdm/blob/main/docs/user-guide/quickstart.md#configure-an-apns-certificate

@piotrt-niceguys
Copy link
Author

As in this video, I have APNS certificate set up but i don't see any traffic from webhook like in the video.

@jessepeterson
Copy link
Member

As in this video, I have APNS certificate set up but i don't see any traffic from webhook like in the video.

What are you doing to expect web hook traffic? Can you enroll a device? Does that succeed? Can you enqueue a command and have it be delivered? If you turn on HTTP debug flag do you see responses and HTTP traffic?

You're not supposed to have web hook traffic if nothing's happening.

@piotrt-niceguys
Copy link
Author

  1. As in video, i set up the webhook with flask app.
  2. Yes, I have enrolled device
  3. Yes
  4. Yes
  5. I didn't do that, so I add that to the setup

@jessepeterson
Copy link
Member

Ahh, okay. The logs you posted didn't show any activity, just the startup and then.. nothing.

Yeah so if you see the log lines show up but not webhook requests I'd double-check your server access from MicroMDM (firewalls? Proxies?). Also can you hit your web hook handler with e.g curl from the same network micromdm is on? Usually micromdm will throw errors if it can't connect.

Finally I'd double check the simple stuff: that the actual CLI switches are correct and also check any pathing issues to the webhook (eg trailing slash in url etc).

Hope those help!

@piotrt-niceguys
Copy link
Author

@jessepeterson Do you know way to expose webhook from micromdm in k8s?
I have webhook implementation from here.
I want to expose webhook to external server, so i create ingress to port 5000 where webhook lives but the mdm server takes traffic, is there is a way to omit that.

@korylprince
Copy link
Contributor

@piotrt-niceguys this seems more like a k8s question than a MicroMDM question. If you're sending traffic to the webhook and it's hitting MicroMDM instead, it sounds like you have some sort of misconfiguration.

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

No branches or pull requests

3 participants