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

Chore: reduce attack surface for Docker image #243

Closed
wants to merge 1 commit into from
Closed

Chore: reduce attack surface for Docker image #243

wants to merge 1 commit into from

Conversation

bqcuong
Copy link

@bqcuong bqcuong commented Apr 18, 2023

Hi,

This pull request includes a small improvement for the Dockerfile, which should help improve the security of container and reduce the risk of potential attacks.

In detail:

  • I added --no-install-recommends to remove unnecessary apt packages, that were not needed for the container's functionality.

As quoted from CIS Docker Benchmark v1.5.0:

4.3 Ensure that unnecessary packages are not installed in the container
Description:
Containers should have as small a footprint as possible, and should not contain unnecessary software packages which could increase their attack surface.
Rationale:
Unnecessary software should not be installed into containers, as doing so increases their attack surface. Only packages strictly necessary for the correct operation of the application being deployed should be installed.

I built the Dockerfile before and after the improvement, there are 3 unnecessary packages that are removed: libgpm2 psmisc publicsuffix.

I hope that you find them useful. Please let me know if you have any concerns.

Thank you.

@ghost ghost closed this by deleting the head repository Dec 19, 2023
This pull request was closed.
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