Skip to content

[scancode-next] add "find_vulnerabilities" workflow - #2508

Open
Samk1710 wants to merge 5 commits into
aboutcode-org:mainfrom
Samk1710:scancode-next_add_find_vulnerabilities_workflow
Open

Samk1710 wants to merge 5 commits into
aboutcode-org:mainfrom
Samk1710:scancode-next_add_find_vulnerabilities_workflow

Conversation

@Samk1710

Copy link
Copy Markdown
Contributor Author

@AyanSinhaMahapatra @ziadhany Could you kindly take a look.

@ziadhany ziadhany left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, @Samk1710. I added a few comments there.

Comment on lines +5 to +7
schedule:
# Run weekly
- cron: '0 0 * * 0'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

  • I didn't add on push since we are running on pull requests. But I can add it and it should be good since its a quick test.
  • schedule will catch new advisories that we collect in between commits.

@ziadhany Let me know what your thoughts are :>

- 'setup.cfg'
- 'requirements*.txt'
- 'pyproject.toml'
- '.github/workflows/find-vulnerabilities.yml'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do we need to run the pipeline if we edit this pipeline?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@ziadhany I added it to make it run on my fork and this PR initially. However I think we should keep it since we would want to run it again if we change this workflow anytime in future. That is why it is here. What are your thoughts?

@Samk1710
Samk1710 requested a review from ziadhany November 18, 2026 16:28

@keshav-space keshav-space left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Samk1710 I went over your workflow run here https://github.com/Samk1710/vulnerablecode/actions/runs/43901988661, and the reason we're not getting any vulnerabilities is that v0.1 of scancode-action uses v37.1.0 of scancode.io by default, which is not compatible with the current VulnerableCode API. So, either update scancode-action to the latest version or provide the latest scancode.io docker image via scancodeio-image.

persist-credentials: false # do not keep the token around

- name: Fail on known vulnerabilities
uses: aboutcode-org/scancode-action@76777db8400d719de67ba3e465c5881037b45cb9 # v0.1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is old version of scancode-action either update this to latest main or supply the latest scancode.io docker image here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

v0.1 is the latest release - https://github.com/aboutcode-org/scancode-action/releases/tag/v0.1

With the latest scio image:

scancodeio-image: "ghcr.io/aboutcode-org/scancode.io@sha256:496e9715e69ea6074483bb215bb4fb57fb9f3225108f9b56d83ca4e75c74d7f1"

https://github.com/Samk1710/vulnerablecode/blob/6799d38497adaa8ac5d052dffdbc244a4ca88b5d/.github/workflows/find-vulnerabilities.yml#L43

The workflow fails https://github.com/aboutcode-org/vulnerablecode/actions/runs/45787603889/job/139798245825
with

docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: exec: "scanpipe": executable file not found in $PATH

Investigating...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

scanpipe is presnt:

samk@samk1710:~$ IMAGE="ghcr.io/aboutcode-org/scancode.io@sha256:496e9715e69ea6074483bb215bb4fb57fb9f3225108f9b56d83ca4e75c74d7f1"
samk@samk1710:~$ docker run --rm "$IMAGE" which scanpipe
/opt/scancodeio/.venv/bin/scanpipe ✅

From
https://github.com/aboutcode-org/scancode-action/blob/main/action.yml#L101C6-L121C46

docker run --rm --network host --user "$(id -u):$(id -g)" --cap-drop ALL --security-opt no-new-privileges -e HOME=/tmp "$IMAGE" scanpipe --version
ScanCode.io version: 38.3.2
ScanCode-toolkit version: v32.5.0  ✅
samk@samk1710:~$ id -u
1000

Github workflow actually has UID 1001

Reproduce Error (Set uid to 1001)

samk@samk1710:~$ docker run --rm --network host --user 1001:1001 --cap-drop ALL --security-opt no-new-privileges -e HOME=/tmp "$IMAGE" scanpipe --version
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: exec: "scanpipe": executable file not found in $PATH

Run 'docker run --help' for more information

UID 1001(others) does not have permission:

samk@samk1710:~$ docker run --rm "$IMAGE" ls -ld /opt/scancodeio
drwx------ 1 app app 4096 Nov 25 03:27 /opt/scancodeio   <------v38.3.2 ie latest

In v37.1.0 that is in scancode-action v0.1

docker run --rm ghcr.io/aboutcode-org/scancode.io@sha256:6fc8023bc588602ef2ec2b699c2503d8771fe5ef16470475fe64b641f0955f5b ls -ld /opt/scancodeio
drwxr-xr-x 1 app app 4096 Apr  1  2026 /opt/scancodeio

This branch has not been deployed

No deployments
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.

3 participants