Sign inSign up

zills/hmac-manager

By zills

•Updated 7 days ago

Image
0

1.0K

zills/hmac-manager repository overview

⁠zills/hmac-manager

Containerized HMAC authentication service for Kubernetes clusters running Istio⁠.

Runs as an Envoy ext-authz⁠ HTTP server. The Istio waypoint proxy or ingress gateway calls it before forwarding any inbound request — a valid HMAC signature passes, anything else is rejected with 403 Forbidden.

Client → Istio waypoint / ingress gateway
              ↓ ext-authz check (original method + path)
         hmac-manager
              ↓ VerifyAsync
         200 OK → forward upstream
         403    → reject

📖 Documentation⁠

⁠Deploy with Helm

The recommended way to run this image is via the hmac-manager Helm chart⁠, which bundles Redis for replay protection and abstracts all configuration:

helm repo add zills https://jzills.github.io/hmac-manager
helm repo update

helm install hmac-manager zills/hmac-manager \
  --namespace hmac-system \
  --create-namespace \
  --set "policies[0].name=my-policy" \
  --set "policies[0].publicKey=00000000-0000-0000-0000-000000000001" \
  --set "policies[0].privateKeySecret.name=my-hmac-secrets" \
  --set "policies[0].privateKeySecret.key=my-policy-privateKey"

A fresh install deploys the verifier and a bundled Redis but does not enforce any traffic until you enable an Istio enforcement point (istio.ingressGateway.* or istio.waypoint.*). See enforcement⁠.

⁠Tags

TagDescription
latestMost recent release
X.Y.ZSpecific release version

⁠Ports

PortPurpose
8080ext-authz check endpoint — the one the Kubernetes Service exposes
8081Signing helper, active only when environment: Development; never exposed by the Service

⁠Environment variables

For advanced use cases or deployments without Helm.

VariableRequiredDescription
ConnectionStrings__RedisNoRedis connection string. When set, every Distributed policy claims its nonces in Redis with an atomic SET NX, shared across replicas.
ASPNETCORE_ENVIRONMENTNoProduction (default) or Development. Development activates the signing helper on port 8081.
ASPNETCORE_URLSNoListening URL (default: http://+:8080).
SignPortNoPort for the dev-only signing helper (default: 8081).

Policies are loaded from a JSON config file mounted at /etc/hmac-manager/config.json:

{
  "HmacManager": [
    {
      "Name": "my-policy",
      "Keys": {
        "PublicKey": "00000000-0000-0000-0000-000000000001"
      },
      "Algorithms": {
        "ContentHashAlgorithm": "SHA256",
        "SigningHashAlgorithm": "HMACSHA256"
      },
      "Nonce": {
        "CacheType": "Distributed",
        "MaxAgeInSeconds": 60
      }
    }
  ]
}

Private keys are injected separately as environment variables (HmacManager__0__Keys__PrivateKey, etc.) and must never be written to the config file.

Under Helm, that file and those variables are maintained by the policy operator⁠ from HmacPolicy custom resources — see the HmacPolicy CRD⁠ and the full chart values⁠.

⁠Replay protection

Every signature carries a nonce and a timestamp, both covered by the signature. The verifier rejects a request outside the policy's window and rejects a nonce it has already seen. Redis is bundled by the chart so this works across replicas. See nonce and replay⁠.

⁠Signing requests

Any of these produce signatures this service accepts:

⁠Source

github.com/jzills/hmac-manager⁠

Tag summary

Content type

Image

Digest

sha256:dc5b7426c…

Size

92.6 MB

Last updated

7 days ago

docker pull zills/hmac-manager