Skip to content

Commit cd931c6

Browse files
authored
Merge branch 'main' into peter-at-progress/vuln-scan
2 parents bffd80a + dd4c47e commit cd931c6

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @brianLoomis @sean-sype-simmons
1+
* @brianLoomis @sean-sype-simmons @chef/chef-infra-owners

.github/copilot-instructions.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copilot Instructions
2+
3+
## GitHub Actions Workflow Security
4+
5+
### Secret Exposure Prevention
6+
7+
1. **Delete any lines that attempt to echo secrets** *(applies to GitHub Actions workflow files — `.yml`/`.yaml` files under `.github/workflows/`)***.**
8+
When editing or generating workflow files, remove any `run` step lines that print secret values to output, such as:
9+
```yaml
10+
# These patterns must be removed:
11+
run: echo ${{ secrets.MY_SECRET }}
12+
run: echo "${{ secrets.MY_SECRET }}"
13+
run: echo '${{ secrets.MY_SECRET }}'
14+
```
15+
This applies to `echo`, `print`, `Write-Output`, `Write-Host`, or any other command that outputs a secret value.
16+
17+
2. **Warn when secrets other than `GITHUB_TOKEN` are accessed** *(applies to GitHub Actions workflow files)***.**
18+
If a workflow references `secrets.*` for any secret other than `secrets.GITHUB_TOKEN`, add a comment warning immediately above the reference:
19+
```yaml
20+
# WARNING: This workflow accesses a non-default secret. Ensure this secret is
21+
# required and that it is stored securely in the repository or organization settings.
22+
- name: Some step
23+
env:
24+
MY_TOKEN: ${{ secrets.MY_CUSTOM_SECRET }}
25+
```
26+
`secrets.GITHUB_TOKEN` is automatically provisioned by GitHub and does not require a warning.

0 commit comments

Comments
 (0)