oppia / oppia/oppia-web-developer-docs
Document safe GitHub Actions scripting practices
Open
Nobody has claimed this yet.
enhancement
Impact: High
Work: Medium
- Dominant language
- Python
- Stars
- 18
- Forks
- 134
- PR merge metrics
- No merged PRs in 30d
Description
Here are some good development practice for GitHub Actions that we've found. These should be documented on the wiki and checked by reviewers.
- Principle of least privilege:
- When using
GITHUB_TOKEN: Top-level permissions should be{}. Minimal permissions should be granted job-by-job. A job with elevated permissions (anything with write permissions) should contain minimal code, and any logic that can be performed without elevated permissions should be in a separate job. - When using a custom token: Avoid classic personal access tokens, as these give broad permissions. Fine-grained tokens and GitHub App tokens are acceptable instead.
- When using
- Script Injection: Script injection is surprisingly easy in GitHub Actions because anything inside
${{...}}is evaluated and inserted with no validation checks. Carefully read GitHub's docs on this issue and follow their mitigation advice.- Validate all inputs.
- Add Dependencies Safely: All third-party GitHub Actions you call have full access to the CI environment, including to the
GITHUB_TOKEN. To minimize the risk of introducing malicious code this way, third-party actions should be vetted using our standard vetting procedures and should be pinned with a commit hash. Again, refer to GitHub's recommendations.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the repository wiki section for GitHub Actions or security guidance and review the existing contribution and review procedures. Document the listed least-privilege, script-injection, input-validation, token, and dependency-pinning practices, with the linked GitHub guidance, and make the reviewer checks explicit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions
- Domain
- ci-cd, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100