Skip to content

makit v0.6.0

Choose a tag to compare

@ngvcanh ngvcanh released this 04 Oct 17:53
· 21 commits to main since this release
  • Colour in the terminal: help pages, makit status, makit docs (guides rendered with headings and code
    highlighted), makit shield lists, logs, reports, analyze, sites and bots, makit notify and the
    makit scan report. makit shield status prints a readable summary at a terminal (--json for the raw counters,
    as before when piped). Colour is off when output is not a terminal, with NO_COLOR or TERM=dumb, and on
    anywhere with FORCE_COLOR; saved and sent reports never carry colour codes.
  • makit shield: the client IP behind a load balancer is read from the right of X-Forwarded-For — trusted proxies
    are skipped and the first address that is not one is the visitor, so a client can no longer choose its own IP by
    sending the header (every header line counts; at most 16 hops). trusted_proxies presets aws-alb, vpc and
    loopback next to cloudflare. A trusted proxy is never banned automatically, and makit shield ban refuses a
    range that overlaps one. /check without X-Makit-Peer takes the asking proxy from the right-most entry, not the
    left-most one a visitor wrote.
  • makit shield edge listeners read PROXY protocol v1 and v2 (accept_proxy_protocol: true) from trusted proxies only —
    an AWS NLB or HAProxy in front keeps TLS at makit and makit still sees the visitor. Bans apply at accept, before
    TLS; a visitor's own PROXY line is never believed; headers are read off the accept loop with a 5 s limit; TLVs are
    skipped; malformed headers are dropped and counted.
  • makit shield config check [FILE|-] [--json]: every error that would stop the gate loading a config, and every setting
    that loads but does nothing or harm — a misspelt key with the right name suggested, wrong value kinds, two listeners
    on a port, wildcard ACME names, trusted ranges anyone is in, kernel_block behind a load balancer, unknown notify
    channels, rules/scoring/bot settings the catalog rejects — with line numbers. --replay LOG runs a real access
    log through the current and the new config and lists what changes, by rule, with likely false positives (a browser
    the app answered 2xx/3xx) first; nothing is written. makit shield edit saves only a file that passes; the gate
    logs the warnings when it reloads.
  • makit shield: /metrics (Prometheus: decisions by site, verdict and rule, a decision-latency histogram, bans by cause,
    events, set sizes, reloads, Go memory), /healthz and /readyz on the admin address. ~32 ns per request, no
    allocation, striped counters (same cost on 1 and 8 cores). /status reads the config in force (it raced with
    reloads before).
  • makit shield cluster: replicas behind a load balancer share bans, unbans, allow entries, rate limits and request
    scores (cluster: with listen, peers — static or dns: for a headless Service — and a shared secret). Limits use
    windows aligned on the clock and add the other replicas' counts, so limit 60/1m stays 60 for the cluster; a scan
    spread over pods escalates as on one. A decision never waits on the network: the request path costs the same with and
    without a cluster (6.3–6.6 µs, 18 allocations). Messages are HMAC-signed with a time and sequence number; forged,
    old and replayed ones are refused. New replicas copy the bans of a running one. Peers in makit shield status and
    /metrics.
  • makit shield snippet envoy-gateway|istio|envoy|traefik|ingress-nginx: gateways in Kubernetes ask makit before every
    request (Envoy Gateway SecurityPolicy + ReferenceGrant, Istio CUSTOM provider, the Envoy ext_authz filter, Traefik
    forwardAuth, ingress-nginx auth-url), passing every header makit reads. /check understands Envoy's
    /check/<path> and ingress-nginx's X-Original-URL. /status and /metrics answer only private callers, like
    /check.
  • makit in Kubernetes: the makit-shield image (20 MB, distroless, non-root, read-only root filesystem; amd64 and
    arm64; signed keyless with cosign, SBOM and provenance attached; chart pushed to oci://ghcr.io/material-atomic/charts),
    the Helm chart deploy/helm/makit-shield (2+ replicas sharing one shield, cluster secret generated once and kept,
    headless Service for peers, PodDisruptionBudget, NetworkPolicy on the cluster port, optional ServiceMonitor,
    /readyz and /healthz probes) and plain manifests deploy/kubernetes/makit-shield.yaml. shield.yaml comes from a
    ConfigMap mounted as a directory, so helm upgrade applies it live without restarting pods. New guide: Kubernetes
    and cloud load balancers (makit docs kubernetes). tests/k8s-e2e.sh checks it on kind: 3 replicas, CLI and
    automatic bans enforced everywhere, live config, limit 10/1m letting 11 of 30 requests through across replicas
    (27 with cluster: off).
  • makit shield analyze and config check --replay read AWS ALB access logs (--format alb or detected), .gz files
    and directories of them, as S3 delivers them. Logs that keep only the User-Agent (ALB, nginx) no longer get
    header-based bot signals in replay — a browser was scored for headers the log never had.
  • makit shield pushes its live bans to AWS WAF IP sets (aws_waf:, every 30 s, makit shield waf sync [--dry-run]),
    so the ALB or CloudFront drops that traffic first. Only the named IP sets are written, only when they differ, by one
    replica of a cluster; never a range overlapping an allow entry or a trusted proxy, site-only bans, or ranges wider
    than /8 / /32; beyond 10,000 addresses the newest bans win. Credentials from the AWS chain (EKS Pod Identity, IRSA,
    instance role); the chart has a ServiceAccount to annotate.
  • Cluster sync every 250 ms by default (was 1 s): between two syncs a limit can be exceeded by about rate × interval.
  • Catalog files starting with a dot are skipped: a catalog copied from a Mac carries AppleDouble ._*.yaml files, and one
    of them stopped the gate with a YAML error. makit top says the Setup tab is tab 8 (it said 7 since the Shield tab
    came in). makit --help: aligned columns, and what makit is now.
  • Bans, unbans and allow entries reach the other replicas at once instead of at the next sync: ~2 ms on average
    (was a full sync interval), batched at most every 20 ms under a flood.
  • Config playground on makit.sh (playground.html): presets (single site, many domains, behind Cloudflare, behind a load
    balancer in Kubernetes, makit in front), blocks for every part of shield.yaml and a builder for notify.yaml, the
    YAML editable both ways, exports as a file, a ConfigMap, Helm values or a Secret. Checked by makit's own config
    check compiled to WebAssembly with the bundled catalog (~14 ms a check), so the messages are the CLI's; nothing
    leaves the browser and secrets stay placeholders. tests/playground.sh checks the WebAssembly in CI.
curl -fsSL https://raw.githubusercontent.com/material-atomic/makit/v0.6.0/install.sh | bash

Source tarball SHA256 (MAKIT_SHA256): 0d6a028b71ae437b978398f7f8eef6ed79e50f9c67c215c00ecd5fa2d23a0d4a
Source tarball and makit-core binaries: SHA256SUMS (verified by install.sh).