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

Start SSOT job based on IP Fabric Webhook #194

Open
ghost opened this issue Mar 7, 2022 · 6 comments
Open

Start SSOT job based on IP Fabric Webhook #194

ghost opened this issue Mar 7, 2022 · 6 comments
Labels
integration: ipfabric Issues/PRs for IPFabric integration type: feature Introduction of substantial new functionality to the application

Comments

@ghost
Copy link

ghost commented Mar 7, 2022

Environment

  • Nautobot version:
  • nautobot-ssot-ipfabric version:

Proposed Functionality

IP Fabric allows for webhooks to send to external systems when discovery completes. It would be nice to have IPF send the webhook to Nautobot and that it automatically runs the SSOT job.

Use Case

@chadell
Copy link
Contributor

chadell commented Mar 7, 2022

You can trigger Jobs via API: https://nautobot.readthedocs.io/en/stable/additional-features/jobs/#via-the-api
is it good enough?

@ghost
Copy link
Author

ghost commented Mar 7, 2022

Unfortunately no as IP Fabric does not let you send custom responses. The endpoint receiving the webhooks must parse the data and then do automation against it.

https://ipfabric.atlassian.net/wiki/spaces/ND/pages/1456537601/Webhooks

@chadell
Copy link
Contributor

chadell commented Mar 8, 2022

So, if don't understand it wrong, the problem is that you can't add "data" or custom authorization to the request.
Actually, "data" is optional, we could create a Job that assumes the defaults, but authorization is mandatory, for any API endpoint in Nautobot.
Isn't any way to add it in the webhook?

@ghost
Copy link
Author

ghost commented Mar 8, 2022

Nautobot will need to process the webhook IP Fabric sends because it sends a message for every discovery action and status:
"action": "discover" | "clone" | "delete" | "download" | "load" | "unload", "status": "started" | "completed" | "failed" | "resumed" | "resumed (stopping)" | "stopped",

This will then possibly kick off an SSOT job for example when a snapshot action:delete/status:started which is incorrect. It needs to only kick off an SSOT job when action:discover, status:completed, requester:cron.

There is no way to add any authorization to the webhook. Nautobot will need to accept the event and verify the message:
The secret code is used to calculate the SHA256 HMAC payload hash which is sent inx-ipf-signature header. Using x-ipf-signature you can validate that request comes from correct server.

Full IP Fabric webhook message:
{ "type": "snapshot", "action": "discover" | "clone" | "delete" | "download" | "load" | "unload", "status": "started" | "completed" | "failed" | "resumed" | "resumed (stopping)" | "stopped", "reason"?: string, "requester": "cron" | "user:<id>", "snapshot"?: { "id": string, "name"?: string, "cloneId"?: string, "file"?: string, } "timestamp": number, "test"?: boolean }

@jedelman8
Copy link
Contributor

Just for kicks, worth exploring the roadmap of webhooks in IPF too. For example, being able to template the JSON body as in Nautobot make it very flexible! :)

https://nautobot.readthedocs.io/en/latest/models/extras/webhook/#jinja2-template-support

https://blog.networktocode.com/post/nautobot-webhooks/

@ghost
Copy link
Author

ghost commented Mar 8, 2022

At this time changes to IP Fabric webhooks is not on the roadmap as our highest priorities is adding new vendor functionality.

@alhogan alhogan transferred this issue from nautobot/nautobot-plugin-ssot-ipfabric Sep 5, 2023
@alhogan alhogan added type: minor feature integration: ipfabric Issues/PRs for IPFabric integration labels Sep 5, 2023
@smk4664 smk4664 added type: feature Introduction of substantial new functionality to the application and removed type: minor feature labels Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration: ipfabric Issues/PRs for IPFabric integration type: feature Introduction of substantial new functionality to the application
Projects
None yet
Development

No branches or pull requests

4 participants