https://github.com/openziti-test-kitchen/webhookz Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code + Explore + All features + Documentation + GitHub Skills + Changelog * Solutions + By Plan + Enterprise + Teams + Compare all + By Solution + CI/CD & Automation + DevOps + DevSecOps + Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles + Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this organization All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} openziti-test-kitchen / webhookz Public template * Notifications * Fork 0 * Star 37 Template for sending a GitHub webhook over a zero trust, private network based on https://github.com/openziti/ziti License Apache-2.0 license 37 stars 0 forks Star Notifications * Code * Issues 0 * Pull requests 0 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights openziti-test-kitchen/webhookz This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 1 branch 0 tags Code * Clone HTTPS GitHub CLI [https://github.com/o] Use Git or checkout with SVN using the web URL. [gh repo clone openzi] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @qrkourier qrkourier clarify step to trigger workflow run ... 9c96fa0 Sep 20, 2022 clarify step to trigger workflow run 9c96fa0 Git stats * 22 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github/workflows .gitignore LICENSE README.md docker-compose.yml View code webhookz Use this template repository Decide how you will configure your OpenZiti Network Hosting Option 1: Configure a self-hosted OpenZiti Network Hosting Option 2: Configure OpenZiti with the Developer Sandbox Run the private webhook server Have questions? README.md webhookz This repo sends a GitHub webhook to a private server with the OpenZiti Webhook Action over a zero trust, private network based on OpenZiti GitHub Repo stars. Use this template repository Do this first: there's a button in the GitHub UI to "Use this template" which will give you a blank commit history in a repo generated from this one. Clone your new repo and follow the steps below in your Git working copy directory. Decide how you will configure your OpenZiti Network You might prefer to self-host your network or you may use the network provided by the Ziti Edge Developer Sandbox (ZEDS). Self-hosting means you won't need to sign up for anything and you'll have full transparency of the open source software and total control of the network. ZEDS requires a painless and free-forever signup for a private developer sandbox on shared servers and does provide end to end encryption like all OpenZiti Networks. Hosting Option 1: Configure a self-hosted OpenZiti Network The steps for this hosting option will guide you to self-host an OpenZiti Network by following the "Run on your own server" quickstart . With that zero trust overlay in place you can follow these steps on your OpenZiti server to add the necessary entities. 1. Create an identity for the webhook sender i.e. API consumer / client ziti edge create identity device github --jwt-output-file github.jwt --role-attributes webhookz-senders 2. Create an identity for the webhook server ziti edge create identity device server --jwt-output-file server.jwt --role-attributes webhookz-servers 3. Create a config with type intercept.v1. ziti edge create config webhookz-intercept-config intercept.v1 '{"protocols":["tcp"],"addresses":["webhookz.ziti"], "portRanges":[{"low":80, "high":80}]}' 4. Create a config with type host.v1 ziti edge create config webhookz-host-config host.v1 '{"protocol":"tcp", "address":"httpbin","port":8080}' 5. Create a service to associate the two configs ziti edge create service webhookz-service --configs webhookz-intercept-config,webhookz-host-config 6. Create a bind service policy ziti edge create service-policy webhookz-bind-policy Bind --service-roles '@webhookz-service' --identity-roles '#webhookz-servers' 7. Create a dial service policy ziti edge create service-policy webhookz-dial-policy Dial --service-roles '@webhookz-service' --identity-roles '#webhookz-senders' 8. Copy "github.jwt" and "server.jwt" from the OpenZiti server to the computer where you cloned this repo. Hosting Option 2: Configure OpenZiti with the Developer Sandbox We'll use Ziti Edge Developer Sandbox (ZEDS) in this example. 1. Sign up for a free developer account at https://zeds.openziti.org /. We'll create a couple of identities to attach to an OpenZiti network provided by ZEDS. 2. In ZEDS, follow the "build your app" button. Populate the form with an app name like "my webhook app", two identities "github" and "server", and a service named "webhookz". Finish up with the "build my app" button. 3. On the following screen click the edit button for the service "webhookz". 1. Create a config with type intercept.v1. { "addresses": [ "webhookz.ziti" ], "protocols": [ "tcp" ], "portRanges": [ { "low": 80, "high": 80 } ] } 1. Create a config with type host.v1. { "port": 8080, "address": "httpbin", "protocol": "tcp" } 4. Go back to "manage app" and click the download buttons to get the token files for identities "github" and "server". Run the private webhook server A private webhook server is included in this repo as a Docker Compose project to demonstrate how to publish an unmodified API producer with OpenZiti. These steps will guide you run and publish the server so it can receive the GitHub webhook via OpenZiti. The Compose project provides an OpenZiti sidecar to host the service that provides zero trust ingress to the server in an isolated Docker network. webhookz drawio (2) 1. Copy "github.jwt" and "server.jwt" into the directory where you cloned this repo. 2. In your terminal, change to the directory where you cloned this repo. Enroll "github" to obtain the identity file "github.json" in the current directory. docker run --rm --volume ${PWD}:/mnt/ openziti/quickstart /openziti/ziti-bin/ziti edge enroll /mnt/github.jwt 3. In the GitHub UI, create a new GitHub Actions secret named ZITI_WEBHOOK_IDENTITY with the contents of "github.json". 4. In your terminal, run the Docker Compose project to start the demo webhook server and OpenZiti tunneler. docker compose up --detach You should now have a new file "server.json" in the directory where you cloned this repo. That is the OpenZiti identity file used by the tunneler running in one of the containers. 5. Finally, trigger the GitHub Actions workflow to demonstrate sending a GitHub webhook to your private server. Navigate to "Actions" / "Main Workflow" in the GitHub UI and punch the "Run workflow" button. You may instead trigger it with the GitHub CLI if your current directory is repo. gh workflow run main.yml 6. Optionally, follow the private server's log to see the webhook activity from GitHub docker compose logs --follow httpbin The result of the triggered workflow will be an HTTP response from the httpbin application echoing the payload and headers it received. Have questions? * Follow our Blog * Join Discussion * Development * Documentation * Like it? Give us a star About Template for sending a GitHub webhook over a zero trust, private network based on https://github.com/openziti/ziti Resources Readme License Apache-2.0 license Stars 37 stars Watchers 7 watching Forks 0 forks Releases No releases published Packages 0 No packages published Footer (c) 2022 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.