Skip to content

Commit bb793dc

Browse files
committed
add job capability preflight and redaction policy
1 parent 122bb26 commit bb793dc

13 files changed

Lines changed: 1003 additions & 27 deletions

File tree

docs/plugins/generated.md

Lines changed: 224 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1785,6 +1785,38 @@ with:
17851785
device: /dev/sdb
17861786
```
17871787

1788+
## capability
1789+
1790+
### `capability.assert`
1791+
1792+
Assert remote tools, paths and optional shell checks required by a job preflight.
1793+
1794+
- Remote session: `true`
1795+
- Dry-run support: `true`
1796+
- Check mode support: `true`
1797+
1798+
| Parameter | Required | Type | Default | Description |
1799+
|---|---:|---|---|---|
1800+
| `tools` | no | `list` | | Executable names required by a capability preflight. |
1801+
| `paths` | no | `list` | | Relative paths selected for manifest or inventory operations. |
1802+
| `commands` | no | `list` | | Allowed sudo command list or ALL. |
1803+
| `path` | no | `path` | | Remote or local path, depending on the plugin. |
1804+
1805+
Result fields:
1806+
1807+
- `changed`: Whether the plugin changed the target or controller state.
1808+
- `message`: Human-readable result message.
1809+
- `rc`: Process or command return code when applicable.
1810+
- `stdout`: Captured standard output when applicable.
1811+
- `stderr`: Captured standard error when applicable.
1812+
- `data`: Plugin-specific structured result data.
1813+
1814+
Example:
1815+
1816+
```yaml
1817+
use: capability.assert
1818+
```
1819+
17881820
## cert
17891821

17901822
### `cert.expiry_report`
@@ -8284,6 +8316,36 @@ with:
82848316
sudo: true
82858317
```
82868318

8319+
## plugin
8320+
8321+
### `plugin.requirements`
8322+
8323+
Report remote tools required by one or more plugins without connecting to a target.
8324+
8325+
- Remote session: `false`
8326+
- Dry-run support: `true`
8327+
- Check mode support: `true`
8328+
8329+
| Parameter | Required | Type | Default | Description |
8330+
|---|---:|---|---|---|
8331+
| `plugin` | no | `string` | | Plugin name selected for requirements inspection. |
8332+
| `plugins` | no | `list` | | Plugin names selected for requirements inspection. |
8333+
8334+
Result fields:
8335+
8336+
- `changed`: Whether the plugin changed the target or controller state.
8337+
- `message`: Human-readable result message.
8338+
- `rc`: Process or command return code when applicable.
8339+
- `stdout`: Captured standard output when applicable.
8340+
- `stderr`: Captured standard error when applicable.
8341+
- `data`: Plugin-specific structured result data.
8342+
8343+
Example:
8344+
8345+
```yaml
8346+
use: plugin.requirements
8347+
```
8348+
82878349
## process
82888350

82898351
### `process.assert_absent`
@@ -8562,6 +8624,104 @@ with:
85628624
sudo: true
85638625
```
85648626

8627+
## secret
8628+
8629+
### `secret.redact_assert`
8630+
8631+
Assert that a payload contains no declared secret values after redaction policy is applied.
8632+
8633+
- Remote session: `false`
8634+
- Dry-run support: `true`
8635+
- Check mode support: `true`
8636+
8637+
| Parameter | Required | Type | Default | Description |
8638+
|---|---:|---|---|---|
8639+
| `text` | no | `string` | | Text payload for redaction scanning or assertion. |
8640+
| `value` | no | `string` | | Desired parameter value. |
8641+
| `source` | no | `path` | | Remote source path to archive. |
8642+
8643+
Result fields:
8644+
8645+
- `changed`: Whether the plugin changed the target or controller state.
8646+
- `message`: Human-readable result message.
8647+
- `rc`: Process or command return code when applicable.
8648+
- `stdout`: Captured standard output when applicable.
8649+
- `stderr`: Captured standard error when applicable.
8650+
- `data`: Plugin-specific structured result data.
8651+
8652+
Example:
8653+
8654+
```yaml
8655+
use: secret.redact_assert
8656+
with:
8657+
text: password=secret
8658+
value: 1
8659+
```
8660+
8661+
### `secret.scan_output`
8662+
8663+
Scan an arbitrary output payload and report whether redaction would change it.
8664+
8665+
- Remote session: `false`
8666+
- Dry-run support: `true`
8667+
- Check mode support: `true`
8668+
8669+
| Parameter | Required | Type | Default | Description |
8670+
|---|---:|---|---|---|
8671+
| `text` | no | `string` | | Text payload for redaction scanning or assertion. |
8672+
| `value` | no | `string` | | Desired parameter value. |
8673+
| `source` | no | `path` | | Remote source path to archive. |
8674+
8675+
Result fields:
8676+
8677+
- `changed`: Whether the plugin changed the target or controller state.
8678+
- `message`: Human-readable result message.
8679+
- `rc`: Process or command return code when applicable.
8680+
- `stdout`: Captured standard output when applicable.
8681+
- `stderr`: Captured standard error when applicable.
8682+
- `data`: Plugin-specific structured result data.
8683+
8684+
Example:
8685+
8686+
```yaml
8687+
use: secret.scan_output
8688+
with:
8689+
text: password=secret
8690+
value: 1
8691+
```
8692+
8693+
### `secret.scan_preview`
8694+
8695+
Scan preview/manual-command text with the same redaction policy used by the engine.
8696+
8697+
- Remote session: `false`
8698+
- Dry-run support: `true`
8699+
- Check mode support: `true`
8700+
8701+
| Parameter | Required | Type | Default | Description |
8702+
|---|---:|---|---|---|
8703+
| `text` | no | `string` | | Text payload for redaction scanning or assertion. |
8704+
| `value` | no | `string` | | Desired parameter value. |
8705+
| `source` | no | `path` | | Remote source path to archive. |
8706+
8707+
Result fields:
8708+
8709+
- `changed`: Whether the plugin changed the target or controller state.
8710+
- `message`: Human-readable result message.
8711+
- `rc`: Process or command return code when applicable.
8712+
- `stdout`: Captured standard output when applicable.
8713+
- `stderr`: Captured standard error when applicable.
8714+
- `data`: Plugin-specific structured result data.
8715+
8716+
Example:
8717+
8718+
```yaml
8719+
use: secret.scan_preview
8720+
with:
8721+
text: password=secret
8722+
value: 1
8723+
```
8724+
85658725
## selinux
85668726

85678727
### `selinux.boolean`
@@ -10320,6 +10480,70 @@ with:
1032010480
timezone: value
1032110481
```
1032210482

10483+
## tool
10484+
10485+
### `tool.exists`
10486+
10487+
Assert that one executable exists on the remote PATH.
10488+
10489+
- Remote session: `true`
10490+
- Dry-run support: `true`
10491+
- Check mode support: `true`
10492+
10493+
| Parameter | Required | Type | Default | Description |
10494+
|---|---:|---|---|---|
10495+
| `name` | yes | `string` | | Package, user or group name. |
10496+
| `path` | no | `path` | | Remote or local path, depending on the plugin. |
10497+
10498+
Result fields:
10499+
10500+
- `changed`: Whether the plugin changed the target or controller state.
10501+
- `message`: Human-readable result message.
10502+
- `rc`: Process or command return code when applicable.
10503+
- `stdout`: Captured standard output when applicable.
10504+
- `stderr`: Captured standard error when applicable.
10505+
- `data`: Plugin-specific structured result data.
10506+
10507+
Example:
10508+
10509+
```yaml
10510+
use: tool.exists
10511+
with:
10512+
name: nginx
10513+
```
10514+
10515+
### `tool.version_assert`
10516+
10517+
Assert that a remote tool version output contains or matches the expected value.
10518+
10519+
- Remote session: `true`
10520+
- Dry-run support: `true`
10521+
- Check mode support: `true`
10522+
10523+
| Parameter | Required | Type | Default | Description |
10524+
|---|---:|---|---|---|
10525+
| `name` | yes | `string` | | Package, user or group name. |
10526+
| `version_arg` | no | `string` | `--version` | Argument used to print a tool version. |
10527+
| `contains` | no | `string` | | Required substring in stdout or HTTP response body. |
10528+
| `regex` | no | `string` | | Regular expression expected in command output. |
10529+
10530+
Result fields:
10531+
10532+
- `changed`: Whether the plugin changed the target or controller state.
10533+
- `message`: Human-readable result message.
10534+
- `rc`: Process or command return code when applicable.
10535+
- `stdout`: Captured standard output when applicable.
10536+
- `stderr`: Captured standard error when applicable.
10537+
- `data`: Plugin-specific structured result data.
10538+
10539+
Example:
10540+
10541+
```yaml
10542+
use: tool.version_assert
10543+
with:
10544+
name: nginx
10545+
```
10546+
1032310547
## transfer
1032410548

1032510549
### `transfer.download`

docs/plugins/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ block.partition_rescan
7070
block.rescan
7171
block.size_assert
7272
block.wipe_signatures
73+
capability.assert
7374
cert.expiry_report
7475
cert.fingerprint
7576
cert.generate_csr
@@ -257,6 +258,7 @@ pki.ca_install
257258
pki.cert_expiry_assert
258259
pki.key_permissions
259260
platform.facts
261+
plugin.requirements
260262
process.assert_absent
261263
process.assert_count
262264
process.kill
@@ -265,6 +267,9 @@ process.wait
265267
remote.command
266268
resolver.config
267269
resolver.facts
270+
secret.redact_assert
271+
secret.scan_output
272+
secret.scan_preview
268273
selinux.boolean
269274
selinux.context
270275
selinux.fcontext
@@ -317,6 +322,8 @@ systemd.unit
317322
timedatectl.ntp
318323
timedatectl.status
319324
timedatectl.timezone
325+
tool.exists
326+
tool.version_assert
320327
transfer.download
321328
transfer.rsync
322329
transfer.sync

docs/plugins/linux-operations.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,3 +236,13 @@ Time synchronization helpers include `timedatectl.status`,
236236
User and group readback/assertion plugins include `user.facts`,
237237
`user.shell_assert`, `user.home_assert`, `user.groups_assert`, `group.members`
238238
and `group.member_absent`. Removing a group member requires `confirm: true`.
239+
240+
## Job-scoped capability preflight
241+
242+
Automax can derive remote command dependencies from the selected job plan and render per-target checks. This keeps dependency preflight scoped to the actual plugins that will run, rather than requiring broad host assumptions.
243+
244+
```bash
245+
automax capabilities requirements --job jobs/site.yaml --inventory inventory/prod.yaml
246+
```
247+
248+
Use job-level `preflight.capabilities: true` or the `automax run --preflight-capabilities` flag to make the run fail early when required remote tools are missing.

docs/plugins/security.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,18 @@ PAM stack assertion and backup plugins complement the mutating PAM plugins:
100100
`pam.include_assert`, `pam.module_assert`, `pam.order_assert`, `pam.backup` and
101101
`pam.restore`. `pam.restore` requires `confirm: true` because it can affect login
102102
paths.
103+
104+
## Capability preflight and redaction policy
105+
106+
Use `capabilities requirements` to derive remote tool requirements from the selected job plan before execution. Use `--preflight-capabilities` on `automax run`, or set `preflight.capabilities: true` in the job, to make Automax check required remote executables before running selected substeps.
107+
108+
The explicit capability plugins are:
109+
110+
```text
111+
tool.exists
112+
tool.version_assert
113+
capability.assert
114+
plugin.requirements
115+
```
116+
117+
Use `secret.redact_assert`, `secret.scan_output` and `secret.scan_preview` to validate that previews, command output and registered payloads do not expose declared secret values or common secret-shaped assignments such as `password=...`, bearer tokens or private-key blocks.

0 commit comments

Comments
 (0)