Skip to content

Conversation

@ezhang6811
Copy link
Contributor

Issue #, if available:

Description of changes:
Following https://docs.github.com/en/actions/reference/security/secure-use#use-an-intermediate-environment-variable, use environment variables instead of referencing Github workflow inputs directly in steps to prevent code injection.

Tested updated steps in my own fork: https://github.com/ezhang6811/aws-otel-python-instrumentation/actions/runs/18540890210

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ezhang6811 ezhang6811 requested a review from a team as a code owner October 15, 2025 20:02
@ezhang6811 ezhang6811 added the skip changelog doesn't need a CHANGELOG entry label Oct 15, 2025
thpierce
thpierce previously approved these changes Oct 16, 2025
thpierce and others added 4 commits October 22, 2025 12:23
Add gate jobs that fail if any workflow job fails OR if any job is
missing from the gate's needs array. Prevents both job failures and
configuration drift when adding new workflow jobs. Callout: I don't
think it's possible to have one gate for both workflows, but it should
not be the case that we add more over time.

### Testing:
* Confirmed if even one subjob in a matrix fails, the job fails:
[PASS](https://github.com/aws-observability/aws-otel-python-instrumentation/actions/runs/17930014615/job/50985189015?pr=477)
* lint(lint) passes, but lint (spellcheck) fails, and all-pr-checks-pass
fails.
* Confirmed if a job is missing, the job fails:
[PASS](https://github.com/aws-observability/aws-otel-python-instrumentation/actions/runs/17930365916/job/50986188220?pr=477)


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
…lity#475)

Add validation step to require commit SHAs instead of version tags for
third-party GitHub actions in workflow files. Also fix the one we
missed: `aquasecurity/trivy-action` - depending on `master` is pretty
unusual and not trivial to catch, ultimately the Repo config `Require
actions to be pinned to a full-length commit SHA` will protect against
this if we missed any others.

* `Python Instrumentation PR Build / static-code-checks (pull_request)`
passes
* `Check CHANGELOG` fails, causing PR-build to fail, but `Check for
versioned GitHub action` passes:
https://github.com/aws-observability/aws-otel-python-instrumentation/actions/runs/17924516041/job/50967250100?pr=475
* Added various [`@v` in
code](aws-observability@f2f0523),
only finds uncommented ones:
https://github.com/aws-observability/aws-otel-python-instrumentation/actions/runs/17925754982/job/50971348934?pr=475
```
Found versioned GitHub actions. Use commit SHAs instead:
.github/actions/lambda_artifacts_build/action.yml:30:    - uses: actions/checkout@v4
.github/actions/lambda_artifacts_build/action.yml:42:    - uses: actions/checkout@v4 #v4
.github/workflows/daily-scan.yml:54:      - uses: actions/checkout@v4 #v4
.github/workflows/daily-scan.yml:106:      - uses: actions/checkout@v4
```

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
@ezhang6811
Copy link
Contributor Author

Note: tried to add #477 and #475 to unblock PR build, but requires us to pin commit SHAs for all workflows for PR to pass. Reverted, recommend overriding checks (since this is an old release branch and source code isn't changed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip changelog doesn't need a CHANGELOG entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants