{"id":20238465,"url":"https://github.com/smallstep/webhooks","last_synced_at":"2025-04-10T19:35:23.314Z","repository":{"id":98614151,"uuid":"528938100","full_name":"smallstep/webhooks","owner":"smallstep","description":"Example server implementation for step-ca webhooks","archived":false,"fork":false,"pushed_at":"2025-03-13T08:55:21.000Z","size":99,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-03-24T17:13:37.511Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smallstep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-25T16:46:19.000Z","updated_at":"2025-03-13T08:55:25.000Z","dependencies_parsed_at":"2023-12-20T07:08:06.259Z","dependency_job_id":"1cb3f0f6-8783-4bbb-9be4-a42d2d2e292a","html_url":"https://github.com/smallstep/webhooks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallstep%2Fwebhooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallstep%2Fwebhooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallstep%2Fwebhooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallstep%2Fwebhooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smallstep","download_url":"https://codeload.github.com/smallstep/webhooks/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248281423,"owners_count":21077423,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T08:34:18.367Z","updated_at":"2025-04-10T19:35:23.284Z","avatar_url":"https://github.com/smallstep.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Webhooks\n\nThis repo contains an example webhook server in Go compatible with [step-ca provisioner webhooks.](https://smallstep.com/docs/step-ca/webhooks)\n\n## Requirements\n\n1. [Install Go](https://go.dev/doc/install)\n2. Generate a certificate for the server available at the paths `webhook.crt` and `webhook.key`: `step ca certificate localhost webhook.crt webhook.key`\n3. Provide your authority's root cert at `root_ca.crt`: `step ca root \u003e root_ca.crt`.\n4. Update the [secrets](https://github.com/smallstep/webhooks/blob/f6a74c2e30dcb19b15d9903fdb6271a8358d26cd/main.go#L31) and [db](https://github.com/smallstep/webhooks/blob/f6a74c2e30dcb19b15d9903fdb6271a8358d26cd/main.go#L26) maps with your own webhook secret and entity.\n5. Start the server with `go run main.go`.\n \nThis webhook server expects a request to `/\u003cemail\u003e` and returns data containg a role that may be used in a provisioner template.\n\nThe following example commands show how to configure a provisioner to use this server.\n\n```\ncat \u003c\u003cEOF \u003e prov.tmpl\n{\n  {\n    \"subject\": {\n      \"organizationalUnit\": {{ toJson .Webhooks.People.role }}\n    }\n  }\n}\nEOF\n\nstep ca provisioner add my_provisioner --create --x509-template prov.tmpl\n\nstep ca provisioner webhook add my_provisioner my_webhook --url 'https://localhost:9443/{{ .Token.sub }}'\n```\n\nThe final command will print out the webhook ID and signing secret you will need to configure this webhook server:\n\n```\nWebhook ID: 7d3c64dc-ec0e-4a0f-a489-241650554bd7\nSigning Secret: nN/sH6+72GvLTSxYejUDcp5Fd2hh/yq00S7ivU8wRwPF09Ne0B7HxBkBq5IaQIWkcKBBkSoXuQyj62N3wwcYPQ==\n```\n\nThen creating a certificate using this provisioner will result in the role supplied by the webhook server being used as the OU in the certificate's subject.\n```\nstep ca certificate andrew@smallstep.com my.crt my.key\n\nstep certificate inspect me.crt --format json | jq .subject\n# {\n#   \"organizational_unit\": [\n#       \"eng\"\n#   ]\n# }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmallstep%2Fwebhooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmallstep%2Fwebhooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmallstep%2Fwebhooks/lists"}