Open
Description
I recently was warned about a security issue with one of the actions I used (tj-actions/changed-files). The action got hacked and could potentially retrieve tokens from actions logs.
I learned a few lessons from this which are good to share in a tutorial:
- avoid use of PAT (personal access tokens): GitHub now has short-lived permissions settings which can be used instead
- always use minimal required permissions (i.e. do not give write access if not needed)
- only use external actions from trusted sources (possibly a task for IT to set organisation level allowed/not-allowed actions)
- pinning an action by its version tag is not guaranteed to be safe: a hacker could point it to a different commit; to be safe, pin an action by the full SHA of the commit you want to use
Please leave comments in this thread if you know of other good practices.