Skip to content

add virustotal scan to CI release workflow #580

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Dec 24, 2020
Merged

add virustotal scan to CI release workflow #580

merged 14 commits into from
Dec 24, 2020

Conversation

umbynos
Copy link
Contributor

@umbynos umbynos commented Dec 21, 2020

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • What kind of change does this PR introduce?

CI

  • What is the current behavior?

Sometimes the windows binary is flagged as a virus by diffentent antivirus software.

  • What is the new behavior?

This contribution should upload automagically the binaries and installers to virustotal 🧙‍♂️

  • Does this PR introduce a breaking change?

no

  • Other information:

@umbynos umbynos self-assigned this Dec 21, 2020
@umbynos umbynos added the CI label Dec 21, 2020
@umbynos umbynos requested a review from luigigubello December 21, 2020 17:43
Copy link
Contributor Author

@umbynos umbynos left a comment

Choose a reason for hiding this comment

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

Apparently it won't work becasue github actions won't trigger other github action events (https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token)
This is to avoid recursive workflow runs

…DED]: Request body larger than maxBodyLength limit`, should be fixed in v2.3.0 (for ref crazy-max/ghaction-virustotal#60)
Comment on lines 413 to 422
- name: VirusTotal Scan
uses: crazy-max/ghaction-virustotal@v2
with:
vt_api_key: ${{ secrets.VIRUSTOTAL_API_KEY }}
vt_monitor: true
files: |
release/*.exe
arduino-create-agent-windows-2019-386/arduino-create-agent.exe
arduino-create-agent-windows-2019-amd64/arduino-create-agent.exe

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed in the release workflow because the workflow is not triggered by a release and so update_release_body: true cannot be used (not tested yet)

@umbynos
Copy link
Contributor Author

umbynos commented Dec 22, 2020

Maybe a solution would be to use a cli to upload the binaries?
I have posted a comment in the action repo regarding the error I'm getting

@@ -426,6 +426,7 @@ jobs:
id: release_body
run: |
vt_links="$(echo ${{ steps.virustotal_step.outputs.analysis}} | sed 's/release\///g' | sed 's/,/\n/g' | sed 's/^/- [/' | sed 's/=/](/' | sed 's/$/)/')"
vt_links="${vt_links//$'\n'/'%0A'}" # replace \n with a special character -> generates a single lines, \n will be reintroduced later
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@umbynos
Copy link
Contributor Author

umbynos commented Dec 23, 2020

Result produced:
image

@umbynos umbynos requested a review from zmoog December 23, 2020 14:20
Comment on lines 415 to 418
uses: crazy-max/ghaction-virustotal@v2
with:
vt_api_key: ${{ secrets.VIRUSTOTAL_API_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we trust this 3rd party action?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The only thing it does is uploading binaries to virustotal. I don't see the problem

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably the github token is not required

Copy link
Contributor

Choose a reason for hiding this comment

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

Is it used to update the release artifacts?

Copy link
Contributor Author

@umbynos umbynos Dec 23, 2020

Choose a reason for hiding this comment

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

Yeah, but it's not used because the workflow is not triggered by a release (The trigger is on:push:tags)

@umbynos
Copy link
Contributor Author

umbynos commented Dec 23, 2020

Added dropdown with virustotal link files. By default the dropdown is compressed
image
THE END 🎏

Copy link
Contributor

@zmoog zmoog left a comment

Choose a reason for hiding this comment

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

LGTM and kudos for the love you put in your craft.

@umbynos umbynos merged commit 6620a25 into devel Dec 24, 2020
@umbynos umbynos deleted the add_virustotal branch December 24, 2020 11:54
umbynos added a commit that referenced this pull request Dec 30, 2020
* add virustotal scan to CI release workflow

* use analysis output from virustotal action to put links in release body

* refactor release body (use dropdown: less confusing for the user)
@per1234 per1234 added the topic: infrastructure Related to project infrastructure label Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Related to project infrastructure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants