-
Notifications
You must be signed in to change notification settings - Fork 36
Add comprehensive strict mode reference documentation #4224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -183,9 +183,32 @@ Enables enhanced validation for production workflows, enforcing security constra | |||||||||||||||
| strict: true # Enable (default: false) | ||||||||||||||||
| ``` | ||||||||||||||||
|
|
||||||||||||||||
| Strict mode enforces: (1) no write permissions for `contents`, `issues`, or `pull-requests` (use `safe-outputs` instead), (2) explicit network configuration required, (3) no wildcard `*` in `network.allowed`, (4) network configuration for custom MCP servers with containers. | ||||||||||||||||
| **Enforcement Areas:** | ||||||||||||||||
|
|
||||||||||||||||
| Enable with `strict: true` in frontmatter or `gh aw compile --strict` (CLI flag applies to all workflows and takes precedence). Use for production workflows requiring enhanced security validation or security policy compliance. | ||||||||||||||||
| Strict mode enforces the following security constraints: | ||||||||||||||||
|
|
||||||||||||||||
| 1. **Write Permissions**: Refuses `contents:write`, `issues:write`, and `pull-requests:write` permissions. Use [safe-outputs](/gh-aw/reference/safe-outputs/) instead for GitHub API write operations. | ||||||||||||||||
|
|
||||||||||||||||
| 2. **Network Configuration**: Requires explicit network configuration. No implicit defaults allowed. See [Network Permissions](/gh-aw/reference/network/). | ||||||||||||||||
|
|
||||||||||||||||
| 3. **Network Wildcards**: Refuses wildcard `*` in `network.allowed` domains. Specify explicit domains or use ecosystem identifiers. | ||||||||||||||||
|
|
||||||||||||||||
| 4. **MCP Network**: Requires network configuration for custom MCP servers with containers. | ||||||||||||||||
|
|
||||||||||||||||
| 5. **Action Pinning**: Enforces GitHub Actions to be pinned to specific commit SHAs instead of tags or branches. | ||||||||||||||||
|
|
||||||||||||||||
| 6. **Deprecated Fields**: Refuses use of deprecated frontmatter fields. | ||||||||||||||||
|
|
||||||||||||||||
|
Comment on lines
+198
to
+201
|
||||||||||||||||
| 5. **Action Pinning**: Enforces GitHub Actions to be pinned to specific commit SHAs instead of tags or branches. | |
| 6. **Deprecated Fields**: Refuses use of deprecated frontmatter fields. | |
| 5. **Deprecated Fields**: Refuses use of deprecated frontmatter fields. | |
| > **Note:** Strict mode also enforces that all GitHub Actions must be pinned to specific commit SHAs (not tags or branches). This enforcement occurs during the compilation process, not as part of the strict mode validation checks. |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -141,13 +141,47 @@ Remote imports are automatically cached in `.github/aw/imports/` for offline com | |||||||||||||
| | Option | Description | | ||||||||||||||
| |--------|-------------| | ||||||||||||||
| | `--validate` | Schema validation and container checks | | ||||||||||||||
| | `--strict` | Requires timeouts, explicit network config, blocks write permissions | | ||||||||||||||
| | `--strict` | Enable strict mode validation for all workflows | | ||||||||||||||
| | `--zizmor` | Security scanning with [zizmor](https://github.com/woodruffw/zizmor) | | ||||||||||||||
| | `--dependabot` | Generate npm/pip/Go manifests and update dependabot.yml | | ||||||||||||||
| | `--json` | Output validation results in machine-readable JSON format | | ||||||||||||||
| | `--watch` | Auto-recompile on file changes | | ||||||||||||||
| | `--purge` | Remove orphaned `.lock.yml` files | | ||||||||||||||
|
|
||||||||||||||
| **Strict Mode (`--strict`):** | ||||||||||||||
|
|
||||||||||||||
| The `--strict` flag enables enhanced security validation for all workflows during compilation. This flag is recommended for production workflows that require strict security compliance. | ||||||||||||||
|
|
||||||||||||||
| When enabled, strict mode enforces: | ||||||||||||||
|
|
||||||||||||||
| 1. **No Write Permissions**: Blocks `contents:write`, `issues:write`, and `pull-requests:write` permissions. Use [safe-outputs](/gh-aw/reference/safe-outputs/) instead. | ||||||||||||||
|
|
||||||||||||||
| 2. **Explicit Network Configuration**: Requires explicit `network` configuration. No implicit defaults allowed. | ||||||||||||||
|
|
||||||||||||||
| 3. **No Network Wildcards**: Refuses wildcard `*` in `network.allowed` domains. Use explicit domains or ecosystem identifiers. | ||||||||||||||
|
|
||||||||||||||
| 4. **MCP Server Network**: Requires network configuration for custom MCP servers with containers. | ||||||||||||||
|
|
||||||||||||||
| 5. **Action Pinning**: Enforces GitHub Actions to be pinned to specific commit SHAs. | ||||||||||||||
|
|
||||||||||||||
| 6. **No Deprecated Fields**: Refuses deprecated frontmatter fields. | ||||||||||||||
|
Comment on lines
+165
to
+167
|
||||||||||||||
| 5. **Action Pinning**: Enforces GitHub Actions to be pinned to specific commit SHAs. | |
| 6. **No Deprecated Fields**: Refuses deprecated frontmatter fields. | |
| 5. **No Deprecated Fields**: Refuses deprecated frontmatter fields. | |
| **Note:** Action pinning (requiring all GitHub Actions to be pinned to specific commit SHAs) is always enforced during the compilation process. In strict mode, any unpinned actions will cause compilation to fail, but this is enforced during compilation/pinning, not as part of strict mode validation checks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation lists "Action Pinning" as enforcement area #5, but action pinning is not validated in the
validateStrictMode()function instrict_mode_validation.go. Instead, strict mode affects action pinning behavior indirectly throughGetActionPinWithData()inaction_pins.go(lines 121-127), which returns an error when an action cannot be pinned.This enforcement happens during the compilation/pinning process, not as part of the centralized strict mode validation checks. The documentation should clarify that action pinning enforcement occurs during compilation, not as a validation check, or consider removing it from the "Enforcement Areas" list to accurately reflect what
validateStrictMode()actually validates.