Deploy a Canary
A Canary is a passive decoy managed from Fabric. Run the mistershell/canary
image with Docker, Kubernetes, or your container platform. No file or directory
mounts are required. The image creates its own runtime directories and decoy
keys and receives service configuration from MisterShell.
Enroll and configure
- Install an active Base-or-higher license and the Canary add-on. Quantity counts provisioned Canary records, including pending, disabled and disconnected records.
- Open Fabric → Create → Canary. Enter a name and choose a location. Review the optional IPv4 address/CIDR ignore list and event rate (1–600 per minute, default 600).
- Save the one-time token and supply these environment variables to the container:
| Variable | Description |
|---|---|
CANARY_TOKEN | Enrollment token returned when you create the Canary, starting with cny_. |
MISTERSHELL_URL | Public URL of your MisterShell deployment, for example https://mistershell.example.com. |
Use one running Canary instance per enrollment token. The container needs outbound
connectivity to MisterShell and its own IPv4 address reachable from the monitored
network. Add NET_ADMIN for passive Portscan; it is not needed when that service
is disabled. Keep the ordinary container capabilities: startup uses them to run
services under separate identities and bind low ports. Privileged mode and host
networking are not required.
Review the enabled services in Canary Policy. Built-ins start enabled at the root location; disable any you do not need, or duplicate one to customize its settings. An empty effective configuration opens no services. The Canary needs a current management connection and authorization before opening listeners after startup.
Docker example
Set the two variables in your deployment environment. For an interactive shell:
export MISTERSHELL_URL=https://mistershell.example.com
read -r -s -p 'Canary token: ' CANARY_TOKEN
export CANARY_TOKEN
Replace canary-network with a Docker network that gives the Canary a reachable
address on the monitored network:
docker run -d --name mistershell-canary \
--network canary-network \
--cap-add NET_ADMIN \
--cpus 1 --memory 512m --memory-swap 512m --pids-limit 128 \
--ulimit nofile=2048:2048 --ulimit core=0 \
--security-opt no-new-privileges:true \
--restart on-failure:3 \
--log-opt max-size=10m --log-opt max-file=3 \
-e CANARY_TOKEN -e MISTERSHELL_URL \
mistershell/canary:latest
Use an approved version tag or image digest for a pinned deployment. No custom entrypoint, hostname, host log setup, token file, or volume is needed.
Kubernetes example
Create a Secret from CANARY_TOKEN already set in your shell, without creating
or mounting a token file:
printf 'CANARY_TOKEN=%s\n' "$CANARY_TOKEN" | \
kubectl create secret generic canary-enrollment --from-env-file=/dev/stdin
The following single-Pod example uses the Secret as an environment variable. Replace the MisterShell URL and select your approved image version. Your cluster network must make the Pod’s IPv4 address reachable from the monitored network.
apiVersion: v1
kind: Pod
metadata:
name: mistershell-canary
spec:
restartPolicy: Never
terminationGracePeriodSeconds: 6
containers:
- name: canary
image: mistershell/canary:latest
env:
- name: MISTERSHELL_URL
value: https://mistershell.example.com
- name: CANARY_TOKEN
valueFrom:
secretKeyRef:
name: canary-enrollment
key: CANARY_TOKEN
securityContext:
allowPrivilegeEscalation: false
capabilities:
add: [NET_ADMIN]
resources:
requests:
cpu: "1"
memory: 512Mi
limits:
cpu: "1"
memory: 512Mi
No volumes or host-network access are needed. Keep the image’s default startup identity and ensure the container runtime allows at least 2048 file descriptors. Choose your own workload controller and restart policy for ongoing operation; a service-health failure alone should not force container restarts.
Storage and restarts
The Canary creates decoy keys and rotates its activity logs inside the container.
Keys survive an ordinary Docker container restart. Recreating the container or
Pod generates new SSH/HTTPS decoy identities. Persistent storage at
/data/canary/keys is optional if you need those identities to survive
replacement; it is not needed for any service to work. Keep decoy keys separate
from management keys.
Verify network reachability
Use a suitable routed, macvlan or ipvlan deployment network, or another separate network identity that preserves source addresses. Allow inbound TCP/UDP for each enabled service and outbound connectivity to Core. Avoid NAT or forwarding that substitutes a proxy address for the client. With macvlan, communication from the host may require separate routing.
From an authorized test client on the monitored network, connect to an enabled service and inspect the resulting Canary Log entry. Confirm the expected source address, service and destination port. A connected status only confirms management connectivity. Repeat this check after routing, firewall or service-port changes.
The ignore list accepts up to 256 IPv4 addresses/CIDRs and applies to all event sources. It suppresses events without blocking connections. Use an IPv4-only network: IPv6 and dual-stack deployments are unsupported, and an IPv6 hostname mapping prevents SMB from starting.
Optional decoy interface
In Fabric → Canaries → Create/Edit Canary, set Decoy interface to an interface
name visible inside the Canary, such as eth1. Leave it empty to listen on all
interfaces. Services, including SMB and TCP banner, bind to the selected interface’s
primary IPv4 address. Management traffic continues to use normal routing.
Provision the interface and its IPv4 address before enabling services. If it is missing, administratively down or has no IPv4 address when configuration is applied, services stay stopped. Correct the interface, then use the recovery steps below; restoring the interface alone does not clear a rejected configuration.
A changed or removed address stops existing listeners. The Canary can restart on the interface’s current primary IPv4 address within its retry limits. Inspect health and configuration drift in Fabric; repeated failures require the recovery steps below.
This selects a listening address; use host routing and firewall rules when service traffic must be restricted to a physical interface. Portscan observes only packets arriving on the selected Decoy interface. With no interface selected, it observes incoming traffic on all Canary interfaces.
Read-only SMB
SMB serves only the selected bundled decoy asset sets. The documents set includes Quarterly-plan.txt; clients cannot upload or modify it. Selected audited operations generate events, so this is not a complete SMB login or file-access audit. Verify a read from an authorized test client and inspect Canary Log. Do not mount production shares or sensitive files into the Canary.
Passive portscan
Enable Passive portscan in Canary Policy → Services for the Canary’s
location. The examples above include the NET_ADMIN capability
needed for this service. For another container configuration, add NET_ADMIN
to its ordinary permissions. No host logging daemon,
firewall rules, scan-directory mount or additional service configuration is needed.
You can omit NET_ADMIN if Portscan is disabled for that Canary.
Portscan observes incoming IPv4 TCP traffic reaching the Canary, including closed ports. It detects SYN, Nmap OS-probe, NULL, XMAS and FIN signatures. A SYN event alone is not proof of a multiport scan. Collection is passive: it does not initiate scans or block or redirect connections. The Canary ignore list and Portscan’s ignored sources, local ports and remote ports suppress the matching observations.
Use the dedicated network identity described above. Traffic blocked upstream or not delivered to the container cannot be detected; publishing a few Docker ports does not make the other host ports visible to the Canary. Host networking is not supported. The Linux container host must support its standard Netfilter features; missing capability or unavailable kernel support causes service startup to fail and is visible in Fabric health and configuration status.
From an authorized test client, probe the Canary’s address and review Canary Log. Confirm the source address, destination port and signature. The container manages collection and log rotation automatically. Capture is rate limited to five observations per second per signature before the Canary’s overall event-rate limit is applied. It is not a complete packet capture or scan history. Disabling the service stops collection and removes its logging rules.
Recovery and limits
Disable a Canary in Fabric to stop its services and established sessions while keeping management available. Connected changes take up to about 35 seconds to stop services. During a management partition, services stop by the current authorization deadline, at most 120 seconds from the last authorization request. Events during disconnection are dropped rather than saved for later replay.
If capacity is reduced below the provisioned count, operation stops for the Canary category. Delete unused records to release capacity. A minimal identity/status view and deletion remain available without entitlement; policy definitions remain readable, with changes disabled. Deleting a targeted Canary removes its rule memberships and disables a rule that loses its final explicit Canary target. Restoring entitlement does not automatically re-enable that rule.
A rotated token retires the old credential. Update CANARY_TOKEN in your deployment and recreate the container or Pod to connect with the new token. Ordinary reconnects keep the same provisioned record and do not consume extra capacity.
After repeated service crashes or an unsafe configuration failure, correct the effective configuration or perform a confirmed disable, wait for stopped state, then enable. Reconnecting alone does not reset a crash lockout. A container restart starts closed and obtains fresh authorization. Inspect health and configuration drift in Fabric; use docker exec mistershell-canary msh show system or kubectl exec mistershell-canary -- msh show system for deployment diagnostics.
Delivery is bounded and best effort. The supported maximum is 600 events per minute per Canary; raising it is not supported. Counters describe observed drops, not complete loss accounting, and reset on container restart. Use production monitoring and audit systems alongside these decoys.