Webhooks & Event Catalog
Arka emits durable, signed HTTP POST webhooks for artifact publishing, builds and immutable promotion, security scanning, license gates, retention/GC, repository administration, and migration workflows.
Every event is matched and enqueued through PostgreSQL's transactional outbox (async_jobs), deduplicated per (eventId, webhookId), delivered by background workers with retry support, and recorded in webhook_deliveries for inspection and manual replay.
1. Quick Start (arkactl & Console)
Manage webhooks in Platform → Webhooks in the Arka Console, via /api/v1/webhooks/*, or with arkactl webhook:
# Inspect the live event catalog directly from your Arka server
arkactl webhook events --json
# Create a scoped webhook for production OCI & npm releases with HMAC + Bearer header
arkactl webhook create \
--name prod-cd-trigger \
--url https://cd.example.com/hooks/arka \
--events asset.published,build.promoted \
--repo-id "$PROD_REPO_ID" \
--format oci --format npm \
--secret "$WEBHOOK_HMAC_SECRET" \
--header "Authorization=Bearer $CD_API_TOKEN" \
--json
# Send a signed webhook.ping test delivery and inspect status/latency
arkactl webhook test "$WEBHOOK_ID" --json
# Rotate secret, adjust scope, or toggle enabled without recreating the webhook
arkactl webhook update "$WEBHOOK_ID" --secret "$NEW_HMAC_SECRET" --json
arkactl webhook update "$WEBHOOK_ID" --disable --json
# Inspect delivery attempts and replay a failed delivery
arkactl webhook deliveries "$WEBHOOK_ID" --limit 20 --json
arkactl webhook replay "$DELIVERY_ID" --jsonCredential hygiene: Both
secretand customheadersare encrypted at rest with Arka's envelope key (ARKA_CREDENTIAL_KEY) and participate in key rotation (arka rotate-credentials). Management APIs return onlyhasSecret: trueand sortedheaderNames— never plaintext secret or header values.
2. HTTP Request Headers & Payload Envelope
Every webhook delivery sends POST with Content-Type: application/json, User-Agent: Arka-Webhook/1.0, any configured custom headers (reserved headers such as Host, Content-Length, Content-Type, User-Agent, and X-Arka-* cannot be overridden), and canonical Arka headers:
| Header | Description |
|---|---|
X-Arka-Event | Canonical event action name (for example build.promoted, asset.published, webhook.ping). |
X-Arka-Event-Id | Stable UUID identifying the logical domain event. Identical across automatic retries and manual replays — use this key for receiver-side idempotency. |
X-Arka-Attempt-Id | Unique UUID for this specific HTTP delivery attempt. |
X-Arka-Delivery | Alias of X-Arka-Attempt-Id for backward compatibility. |
X-Arka-Signature-256 | Present when a signing secret is configured: sha256=<hex(HMAC-SHA256(secret, rawBody))>. |
JSON Payload Envelope
{
"action": "build.promoted",
"actor": "ci-bot",
"resourceType": "build",
"resourceId": "ba61df5b-1cd6-47ce-bee7-22d375bf7883",
"outcome": "success",
"requestId": "req-01j9...",
"repositoryId": "96ad5f63-d4b4-4c9e-a200-1bcfdfaa18ca",
"repositoryName": "prod-npm",
"format": "npm",
"repositoryIds": [
"9f42835f-2161-4dde-9dcf-9f5e23077437",
"96ad5f63-d4b4-4c9e-a200-1bcfdfaa18ca"
],
"formats": ["npm"],
"detail": {
"promotionId": "0f0a4b95-6f9f-4c23-8906-31f5f4e615c3",
"sourceRepositoryId": "9f42835f-2161-4dde-9dcf-9f5e23077437",
"targetRepositoryId": "96ad5f63-d4b4-4c9e-a200-1bcfdfaa18ca",
"promotedCount": 2,
"skippedCount": 0,
"enforcePolicyGate": true
},
"occurredAt": "2026-12-03T01:23:45.678Z"
}Scope Filtering Semantics (Fail-Closed)
- Events: Each pattern matches
*(all events), an exact action (asset.published), or a dot-delimited prefix (asset.*,build.*,migration_job.*). - Repository filter (
repositoryIds): Empty matches all repositories. When non-empty, Arka delivers only events carrying a matchingrepositoryIdorrepositoryIdsentry; global events without a repository scope are not delivered. - Format filter (
formats): Empty matches all formats. When non-empty, Arka delivers only events carrying a matching lowercaseformatorformatsentry. - Subscription mutation safety: Queued deliveries and manual replays re-validate the webhook's current enabled state, subscribed events, repository/format scope, and target URL version. Changing a webhook's URL never sends historical events to the new endpoint (rotating
secretorheaderson the same URL preserves replayability;webhook.pingremains replayable while enabled).
3. Verifying X-Arka-Signature-256
Always compute the HMAC over the exact raw request bytes before JSON parsing and compare in constant time.
Go
func verifyArkaSignature(secret string, rawBody []byte, header string) bool {
mac := hmac.New(sha256.New, []byte(secret))
mac.Write(rawBody)
expected := "sha256=" + hex.EncodeToString(mac.Sum(nil))
return hmac.Equal([]byte(expected), []byte(strings.TrimSpace(header)))
}Node.js (TypeScript / JavaScript)
import { createHmac, timingSafeEqual } from 'node:crypto';
export function verifyArkaSignature(secret: string, rawBody: Buffer, header: string): boolean {
const expected = Buffer.from(
'sha256=' + createHmac('sha256', secret).update(rawBody).digest('hex'),
'utf8',
);
const actual = Buffer.from(header.trim(), 'utf8');
return expected.length === actual.length && timingSafeEqual(expected, actual);
}Python
import hashlib
import hmac
def verify_arka_signature(secret: str, raw_body: bytes, header: str) -> bool:
expected = "sha256=" + hmac.new(secret.encode(), raw_body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, header.strip())4. Outbound Network & SSRF Policy
By default, Arka enforces strict public-egress SSRF protection on webhook URLs at creation, update, and DNS dial time:
- Only
http://andhttps://URLs with a hostname and no embedded credentials (userinfo) or fragments are accepted. - HTTP redirects (
3xx) are never followed so receivers cannot bounce deliveries to internal endpoints or capture custom auth headers. - All resolved DNS addresses are validated before opening a socket (preventing DNS rebinding), and
HTTP_PROXY/HTTPS_PROXYenvironment proxies are bypassed for webhook egress. - Delivery failure diagnostics recorded in
webhook_deliveries.error_messageuse fixed safe classifications (never persisting raw receiver responses or malformedLocationheaders).
For self-hosted intranet deployments where receivers live on RFC 1918 / ULA private networks (for example internal Jenkins, GitLab, ArgoCD, or ChatOps gateways), set:
ARKA_WEBHOOK_ALLOW_PRIVATE_NETWORKS=trueEven with ARKA_WEBHOOK_ALLOW_PRIVATE_NETWORKS=true, Arka always blocks cloud instance metadata and credential endpoints (169.254.0.0/16, fe80::/10, AWS EC2/EKS fd00:ec2::/32, Alibaba Cloud 100.100.100.200/32), unspecified (0.0.0.0 / ::), multicast, zoned IPv6 addresses, and HTTP redirects.
5. Complete Event Catalog
You can fetch this catalog programmatically at runtime via GET /api/v1/webhooks/events or arkactl webhook events --json.
Assets & Properties
| Event Action | Repo/Format Filter | Description |
|---|---|---|
asset.published | Yes | An asset was published to a Hosted repo or cached by a Proxy repo. |
asset.deleted | Yes | An asset was deleted by path (atomic transactional outbox). |
asset.delete | Yes | An asset was deleted via catalog/management API. |
component.delete | Yes | A component and its assets were deleted from the catalog. |
asset.download.presign | Yes | A download was redirected to a presigned storage URL. |
asset.download.quarantined | Yes | An asset download was blocked by quarantine policy. |
asset.download.license_evaluated | Yes | A download license compliance policy was evaluated (audit / enforce). |
asset.properties.updated | Yes | Custom asset properties were merged or replaced. |
asset.properties.deleted | Yes | A custom asset property key was removed. |
Builds & Immutable Promotion
| Event Action | Repo/Format Filter | Description |
|---|---|---|
build.published | Yes | A CI build record and its produced artifact references were recorded. |
build.promoted | Yes | A build was promoted across repositories (repositoryIds includes both source and target). |
Repositories & Governance
| Event Action | Repo/Format Filter | Description |
|---|---|---|
repository.create | Yes | A repository was created. |
repository.update | Yes | Repository configuration or write policy was updated. |
repository.delete | Yes | A repository was deleted. |
repository.directory.delete | Yes | A directory prefix of Hosted repository assets was deleted. |
repository.reindex | Yes | Repository native metadata indexes were rebuilt. |
repository.promote | Yes | A migration proxy repository was promoted to Hosted. |
repository.quota.warning | Yes | A repository crossed its quota warning threshold. |
repository.quota.exceeded | Yes | A write was rejected with HTTP 507 quota_exceeded. |
repository.grant.upsert | Yes | A repository RBAC grant was created or updated. |
repository.grant.delete | Yes | A repository RBAC grant was deleted. |
repository.publish.login | Yes | A package client authenticated to publish. |
Security & Maintenance
| Event Action | Repo/Format Filter | Description |
|---|---|---|
security.scan.completed | Yes | A vulnerability scan completed for an asset. |
retention.run | Yes | A repository retention cleanup (or dry-run) completed. |
blob_gc.run | No | A global physical blob garbage collection pass completed. |
Migration & Cutover
| Event Action | Repo/Format Filter | Description |
|---|---|---|
migration_source.create | No | A migration source (Nexus 3, Artifactory, Harbor, or Arka) was created. |
migration_source.provision | No | Target repositories were provisioned from a migration source. |
migration_job.start | Yes | A migration import job started. |
migration_job.complete | Yes | A migration import job finished. |
migration_job.resume | Yes | A migration job resumed from its saved watermark. |
migration.verify | Yes | Source-vs-Arka parity verification finished. |
migration_cutover.sync | Yes | A cutover incremental sync job was queued. |
migration_cutover.retry | Yes | A cutover failed-item retry job was queued. |
Diagnostics
| Event Action | Repo/Format Filter | Description |
|---|---|---|
webhook.ping | No | Synchronous test delivery triggered via POST /api/v1/webhooks/{id}/test or arkactl webhook test. |