seawall stack harden
Lock a stack's containers down: capabilities, privileges, admin ports.
Lock a stack's containers down: capabilities, privileges, admin ports
Capabilities, no-new-privileges, admin ports on loopback, off the default bridge. A dry run until --yes, which writes the disk copy and deploys it.
Usage
seawall stack harden [OPTIONS] <STACK>
Changes the host
Without --yes it prints the plan and changes nothing.
Arguments
<STACK>The stack, by Portainer name or directory
Options
--yesWrite the change and deploy it
--pid1Load each root PID 1 script another user can change into memory before it runs
--remove <SETTING>Take settings out instead:
cap_drop,cap_add, no-new-privileges, init orread_only(comma-separate), whoever set them--undo <SETTING>Put back what seawall changed instead: a value it replaced goes back to the one before, one it added goes, others stay
--service <SERVICE>With --remove or --undo: only this service's
--no-deployWrite the disk copy only, don't deploy it
--untriedDeploy even when the trial copy can't run (else the change stops there)
--diffShow the compose diff, by service, and the notes too
--waitAfter a redeploy, wait out the 2-minute compare with before. Without it the facts timer runs it (
SeawallDeployWorse)
Examples
seawall stack harden ntfy
seawall stack harden ntfy --yes
seawall stack harden ntfy --remove cap_drop --service ntfy --yes
seawall stack harden game --pid1 --yes
Notes
With --yes it writes the disk copy and deploys it: the deployed compose is backed up first, rolled back if the stack doesn't come up healthy, and its new containers are watched for refusals. Resources (CPU, memory, processes) are seawall stack limits.