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

Find a lightweight and official image to import #259

Closed
4 tasks done
xr09 opened this issue Oct 1, 2019 · 7 comments
Closed
4 tasks done

Find a lightweight and official image to import #259

xr09 opened this issue Oct 1, 2019 · 7 comments
Assignees
Milestone

Comments

@xr09
Copy link
Contributor

xr09 commented Oct 1, 2019

Description

In order to comply with #252 we need to find an alternative image to use as a base.

The right image is lightweight, functional and most importantly, secure.

Tasks

  • Setup a testing environment with Docker and Snyk
  • Test official CentOS image
  • Test official Debian image
  • Test official Ubuntu image
@manuasir manuasir added this to the Sprint - 101 milestone Oct 2, 2019
@xr09
Copy link
Contributor Author

xr09 commented Oct 2, 2019

Hey team,

I'm currently doing some security testing with Snyk (same tool used to report #221 ).

This is the output from our current image wazuh/wazuh:latest:

Screenshot_20191002_183115

This is one of the high severity vulnerabilities on the image.

Screenshot_20191002_183422

Visiting that link we get this:

 Improper Data Handling

Affecting glibc package, versions debian:10: <2.28-1 || debian:8: * || debian:9: * 
|| debian:unstable: <2.28-1 || ubuntu:16.04: * || ubuntu:18.04: *

So according to Snyk only Debian and Ubuntu are affected.

But RedHat says otherwise.

https://access.redhat.com/security/cve/cve-2009-5155

Red Hat Enterprise Linux 7 | glibc | Affected

Let's check another one.

This report again says Debian and Ubuntu are the only vulnerable.

On the RedHat CVE Database says Under Investigation but let's test the exploit on a CentOS 7:

[root@e1cad4fb067f /]# echo D | grep -E "$(printf '(\0|)(\\1\\1)*')"
Segmentation fault (core dumped)

Again, vulnerable.

After this research I'm not sure about trusting Snyk as the only source of truth, we might spend a lot of man/hours moving away from the current image (or from Ubuntu) and end up in the blind, since Snyk is not reporting correctly. So this is one point to keep in mind.

I'm tempted to say currently their CVE database is much more accurate for Debian/Ubuntu than for CentOS/RedHat.

Regards.

@xr09
Copy link
Contributor Author

xr09 commented Oct 3, 2019

Another example:

https://snyk.io/vuln/SNYK-LINUX-TAR-441202

NULL Pointer Dereference

Affecting tar package, versions debian:10: * || debian:8: * || debian:9: * || debian:unstable: *

https://access.redhat.com/security/cve/cve-2019-9923

Screenshot_20191003_145724

@manuasir manuasir modified the milestones: Sprint - 101, Sprint - 102 Oct 21, 2019
@manuasir manuasir modified the milestones: Sprint - 102, Sprint - 103 Nov 11, 2019
@xr09
Copy link
Contributor Author

xr09 commented Nov 14, 2019

Base images size comparison

Currently testing 3 of the officially supported images on Docker Hub, adding our current base image for comparison.

This is a report from MicroBadger, a site which periodically inspects images from Docker Hub and reports its size (gzipped) and number of layers.

Base Image MicroBadger Report
CentOS 7
Debian 10
Ubuntu 18.04
phusion/baseimage
Wazuh

Mind these official images would require some modifications to allow a multi-process container.

@xr09
Copy link
Contributor Author

xr09 commented Nov 14, 2019

Testing a few modifications on our current Dockerfile and changing the base images to Debian Buster, CentOS 7 and Ubuntu Bionic we're getting these final sizes.

Wazuh Image Size
Debian 10 228MB
CentOS 7 195MB
Ubuntu 18.04 191MB

@xr09
Copy link
Contributor Author

xr09 commented Nov 18, 2019

After a few debates we're proposing CentOS 7 as our new base image due to its solid stability and long term support. Any comments would be appreciated.

@thiscantbeserious
Copy link

Any reason you didn't even gave Alpine a run? Unlike all of the above is by far more lightweight and faster to customize and also built with Docker in mind.

@xr09
Copy link
Contributor Author

xr09 commented Jan 20, 2020

Hi @thiscantbeserious, actually we thought about Alpine but this distro doesn't use the standard glibc like the rest (Alpine uses musl libc). This makes it unexplored territory for our core team (and packaging team as well) so we picked a distro with first class support instead.

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

3 participants