Skip to main content

SSH Shield Chart

The ssh-shield Helm chart deploys the SSH Shield service, which protects the k8shell SSH entry point from brute-force attacks by monitoring authentication failures published over NATS and blocking offending IP addresses at the firewall level. For more details see SSH Shield.

Configuration reference

The sections below document every parameter accepted by the chart's values.yaml. All parameters are optional unless noted otherwise. The imageRegistry field and secret-valued parameters are documented on the Common Fields page.

Top-level

ParameterDescription
replicasNumber of pod replicas. Default: 1
image.repositoryContainer image repository. Default: ghcr.io/k8shell-io/ssh-shield
image.tagContainer image tag. Default: v0.12.1
imageRegistryPrivate container registry for image pulls. See imageRegistry.
natsNATS connection and failure event subscription. See nats.
blockerIP blocking policy and escalation schedule. See blocker.
stateStoreBackend used to store per-IP rate-limit state. See stateStore.
pluginsFirewall plugin configuration. See plugins.

nats

NATS connection used to subscribe to SSH failure events.

FieldDescription
hostNATS server hostname. Default: nats
portNATS server port. Default: 4222
userNATS username. Default: sshshield
passwordNATS password. See secret fields.
sshFailures.subjectNATS subject to subscribe to for SSH failure events. Must match sshProxy.publishSshFailures.subject in the k8shell chart. Default: ssh.failures

blocker

Policy for tracking and banning offending IP addresses.

FieldDescription
windowSliding time window over which failures from the same IP are counted. Default: 5m
thresholdNumber of failures within the window required to trigger a ban. Default: 4
decreasingThresholdIf true, the threshold decreases with each successive strike, making repeat offenders easier to ban. Default: true
idleCleanupHow long to retain state for an IP that has produced no new failures. Default: 12h
banScheduleOrdered list of ban durations applied on each successive strike. The last entry is reused for any further strikes. Default: [1m, 5m, 15m, 1h, 6h, 24h, 72h]
maxIPStateMaximum number of IP entries kept in state. Oldest entries are evicted when the limit is reached. Default: 100000
gcIntervalHow often the garbage collector runs to evict expired state entries. Default: 10m
whitelistList of CIDR ranges that are never banned. Default: []

stateStore

Backend used to persist per-IP rate-limit state.

FieldDescription
typeStorage backend. memory keeps state in-process (not shared across replicas); nats-kv stores state in a NATS JetStream KV bucket (shared across all replicas). Default: nats-kv
bucketName of the NATS JetStream KV bucket (used when type is nats-kv). Default: ssh-shield-state

plugins

Map of firewall plugin configurations keyed by plugin type. Each entry is rendered into a dedicated ConfigMap and mounted into the pod at /app/config/plugins/{type}.yaml.

plugins.nfgate

The nfgate plugin delegates IP blocking to an nfgate service, which installs rules directly into an nftables set on the Linux host.

FieldDescription
addressgRPC endpoint address of the nfgate sidecar. Default: localhost:9090
tlsEnable TLS on the gRPC connection to nfgate. Default: false
dialTimeoutMaximum time to wait when dialing the nfgate gRPC endpoint. Default: 5s
authKeyShared secret sent as Authorization: Bearer <key> in every gRPC call. Must match the authKey configured on the nfgate server. Accepts value, secretName/secretKey. Default: {}