New to Kestra?
Use blueprints to kickstart your first workflows.
SSH into a Linux host, compare /etc/motd ownership and permissions against a KV-stored baseline, and auto-remediate CIS control 1.6.4 with Kestra.
Implement a single CIS benchmark control as a reusable, callable flow. This blueprint covers CIS Ubuntu control 1.6.4 (ensure access to /etc/motd is configured): it reads the expected stat output from the Kestra KV store, SSHes into the target host to capture the current state, and either reports compliance or fixes ownership and permissions in place. A parent scan flow can invoke it per host and aggregate the returned complianceStatus output.
getConfiguration task (io.kestra.plugin.core.kv.Get) loads the expected stat -Lc output for /etc/motd, stored in the KV store under the flow id key so each control owns its baseline.assessControl task (io.kestra.plugin.fs.ssh.Command) connects with authMethod: PUBLIC_KEY and captures the live ownership/permission string, emitting it as a task output through the ::{"outputs":...}:: convention.checkStatus task (io.kestra.plugin.core.flow.Switch) compares the observed value against the baseline: a match, or an absent file, is Compliant.doRemediate task (io.kestra.plugin.core.flow.If) checks the remediateControls input; if true, remediateControl runs chown root:root and chmod u-x,go-wx on the file, otherwise the flow returns Not Compliant.complianceStatus flow output coalesces whichever branch ran, so callers always get a single string verdict.remediateControls) to run in audit-only or auto-fix mode.complianceStatus output for aggregation by a parent scan flow.Hardening scripts run once and leave no trail. As a Kestra flow, every assessment is an execution with logs, timings, and the exact observed value; remediation is an explicit, toggleable branch rather than a side effect; and the control becomes composable, so a scan orchestrator can fan out dozens of controls in parallel and retrigger a single failed control without rerunning the whole benchmark.
sudo chown/chmod.stat output string.SSH_VM_USER: SSH username for the target host.SSH_PRIVATE_KEY: private key used for public key authentication.stat string in the KV store under the key cis-control-motd-permissions.ipAddress and remediateControls: false for a dry audit.io.kestra.plugin.core.flow.Subflow and aggregate complianceStatus values.io.kestra.plugin.core.http.Request.io.kestra.plugin.core.flow.ForEach to scan a whole fleet.