Fix issues for the Security Scan Workflow #51
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of changes:
This PR fixes the following issues in the Security Scanning workflow.
pull_request
trigger is used for invoking a GitHub Action. This is because GitHub considers this unsafe as with thepull_request
trigger, the GitHub Action's.yaml
file that's used to invoke the workflow is from the PR branch. The trigger has now been updated topull_request_target
. Withpull_request_target
as the trigger, the GitHub Action's.yaml
file will be from the base branch of the PR. This is more secure as it doesn't allow untrusted code to invoke a workflow and will also grant access to GitHub repo secrets.main
branch to ensure latest changes in the script are used for running the scan. After downloading, the file needs "execute" permissions. This is fixed by updating file permissions usingsudo chmod +x
.1.95.x
branch for security scanning. The regex has been fixed, it will now considermain
and<digit>.<digit>
branches and will no longer consider*.*.x
branches as eligible for scanning.head_ref
as the branch name can be set by an external contributor and can be used to mount an injection attack. This is per a recommendation from CodeQL.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.