Skip to content

Commit

Permalink
Fix code linter error
Browse files Browse the repository at this point in the history
The error was:
```
 src/pcluster/resources/batch/docker/alinux2/Dockerfile
   ❯❯❱ dockerfile.security.missing-user-entrypoint.missing-user-entrypoint
          By not specifying a USER, a program in the container may run as 'root'. This is a security hazard.
          If an attacker can control a process running as root, they may have control over the container.
          Ensure that the last USER in a Dockerfile is a USER other than 'root'.
          Details: https://sg.run/k281

           ▶▶┆ Autofix ▶ USER non-root ENTRYPOINT ["/parallelcluster/bin/entrypoint.sh"]
           60┆ ENTRYPOINT ["/parallelcluster/bin/entrypoint.sh"]

    src/pcluster/resources/batch/docker/alinux2023/Dockerfile
   ❯❯❱ dockerfile.security.missing-user-entrypoint.missing-user-entrypoint
          By not specifying a USER, a program in the container may run as 'root'. This is a security hazard.
          If an attacker can control a process running as root, they may have control over the container.
          Ensure that the last USER in a Dockerfile is a USER other than 'root'.
          Details: https://sg.run/k281

           ▶▶┆ Autofix ▶ USER non-root ENTRYPOINT ["/parallelcluster/bin/entrypoint.sh"]
           60┆ ENTRYPOINT ["/parallelcluster/bin/entrypoint.sh"]
```

Signed-off-by: Hanwen <[email protected]>
  • Loading branch information
hanwen-cluster authored and hanwen-pcluste committed Oct 1, 2024
1 parent 625d9e0 commit 96d9d05
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cli/src/pcluster/resources/batch/docker/alinux2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ ENV PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/lib6
# expose ssh port
EXPOSE 22

ENTRYPOINT ["/parallelcluster/bin/entrypoint.sh"]
USER root ENTRYPOINT ["/parallelcluster/bin/entrypoint.sh"]
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ ENV PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/lib6
# expose ssh port
EXPOSE 22

ENTRYPOINT ["/parallelcluster/bin/entrypoint.sh"]
USER root ENTRYPOINT ["/parallelcluster/bin/entrypoint.sh"]

0 comments on commit 96d9d05

Please sign in to comment.