Skip to content
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

Dockerfile vulnerability - Specify at least 1 USER command in Dockerfile with non-root user as argument #592

Open
thevirajshelke opened this issue Jun 13, 2022 · 1 comment

Comments

@thevirajshelke
Copy link

So apparently I am using this package and when I generate a final docker image of my project and use a Trivy to scan my container image I am getting the following issue/vulnerability - Specify at least 1 USER command in Dockerfile with non-root user as argument

Detailed Description

The Trivy scan of my project's container is giving the following issue,

app/node_modules/swagger2openapi/Dockerfile (dockerfile)
========================================================
Tests: 21 (SUCCESSES: 20, FAILURES: 1, EXCEPTIONS: 0)
Failures: 1 (MEDIUM: 0, HIGH: 1, CRITICAL: 0)
HIGH: Specify at least 1 USER command in Dockerfile with non-root user as argument
════════════════════════════════════════
Running containers with 'root' user can lead to a container escape situation. It is a best practice to run containers as non-root users, which can be done by adding a 'USER' statement to the Dockerfile.
See https://avd.aquasec.com/misconfig/ds002
────────────────────────────────────────

This issue is coming from the path app/node_modules/swagger2openapi/Dockerfile (dockerfile)
Ideally we should add the USER command and also do we really need to ship dockerfile as part of the final npm package?

Other stuff

The package version (swagger2openapi)- v7.0.8

@MikeRalphson
Copy link
Contributor

Thanks, I don't really use Docker (especially not for my own projects) but a PR to fix both issues would be welcome.

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

No branches or pull requests

2 participants