Skip to content

[DO NOT MERGE] Race condition fix for update workflow#9389

Draft
spkane31 wants to merge 11 commits intomainfrom
spk/update-premature-eos
Draft

[DO NOT MERGE] Race condition fix for update workflow#9389
spkane31 wants to merge 11 commits intomainfrom
spk/update-premature-eos

Conversation

@spkane31
Copy link
Contributor

What changed?

WISOTT

Why?

To come later

How did you test it?

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)

Potential risks

Any change is risky. Identify all risks you are aware of. If none, remove this section.

Comment on lines +64 to +77
run: |
REF="${{ inputs.ref }}"
if [[ "$REF" == "spk/update-premature-eos" ]] || [[ "${{ inputs.push }}" == "true" ]]; then
echo "should-push=true" >> "$GITHUB_OUTPUT"
else
echo "should-push=false" >> "$GITHUB_OUTPUT"
fi
# Never tag as latest for the branch push
if [[ "$REF" == "spk/update-premature-eos" ]]; then
echo "effective-tag-latest=false" >> "$GITHUB_OUTPUT"
else
echo "effective-tag-latest=${{ inputs.tag-latest }}" >> "$GITHUB_OUTPUT"
fi

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Semgrep identified a blocking 🔴 issue in your code:
Using variable interpolation ${{...}} with github context data in a run: step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. github context data can have arbitrary user input and should be treated as untrusted. Instead, use an intermediate environment variable with env: to store the data and use the environment variable in the run: script. Be sure to use double-quotes the environment variable, like this: "$ENVVAR".

To resolve this comment:

🔧 No guidance has been designated for this issue. Fix according to your organization's approved methods.

💬 Ignore this finding

Reply with Semgrep commands to ignore this finding.

  • /fp <comment> for false positive
  • /ar <comment> for acceptable risk
  • /other <comment> for all other reasons

Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by run-shell-injection.

You can view more details about this finding in the Semgrep AppSec Platform.

Comment on lines 131 to +143
run: |
docker buildx bake \
--push \
-f docker/docker-bake.hcl \
server admin-tools
if [ -n "${{ inputs.platform }}" ]; then
docker buildx bake \
--push \
--set "*.platform=${{ inputs.platform }}" \
-f docker/docker-bake.hcl \
server admin-tools
else
docker buildx bake \
--push \
-f docker/docker-bake.hcl \
server admin-tools
fi

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Semgrep identified a blocking 🔴 issue in your code:
Using variable interpolation ${{...}} with github context data in a run: step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. github context data can have arbitrary user input and should be treated as untrusted. Instead, use an intermediate environment variable with env: to store the data and use the environment variable in the run: script. Be sure to use double-quotes the environment variable, like this: "$ENVVAR".

To resolve this comment:

🔧 No guidance has been designated for this issue. Fix according to your organization's approved methods.

💬 Ignore this finding

Reply with Semgrep commands to ignore this finding.

  • /fp <comment> for false positive
  • /ar <comment> for acceptable risk
  • /other <comment> for all other reasons

Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by run-shell-injection.

You can view more details about this finding in the Semgrep AppSec Platform.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant