dduportal-dockerfiles / oscap4docker

Run oscap for docker from docker !
6 stars 2 forks source link

OpenSCAP4Docker Docker image

Description

That image embed :

The idea is to use Docker's lightweight isolation to have an auto-sufficient image that embed OpenSCAP4Docker and its dependencies, even if it only need bash as dependency...

CircleCi Build Status

Usage

From here, just pre-download the image from the registry :

$ docker pull dduportal/oscap4docker:1.0.0

It is strongly recommended to use tags, even if dduportal/oscap4docker will work as latest tag is implied.

Then you have to choices : running directly your test or build your own, which enable you to embed your tests.

Inline run

To print out the usage of the embeded docker-oscap script, just run without arguments :

$ docker run dduportal/oscap4docker:1.0.0
...

Note that you have to provide to your container :

Exemple, sharing the Docker client binary (to ensure version) and the local Unix socket :

$ docker run \
    -v $(which docker):/usr/bin/docker \
    -v /var/run/docker.sock:/var/run/docker.sock \
    dduportal/oscap4docker:1.0.0 \
        image-cve dduportal/oscap4docker:1.0.0

If you want gather locally the results generated by docker-oscap, you can

Build your own testing image

The goal here is to embed to tests in order to version them or share them, and providing the 'all-in-one' box (e.g. OpenSCAP4Docker + deps. + your tests) as a Docker image artefact :

$ cat Dockerfile
FROM dduportal/oscap4docker:1.0.0
MAINTAINER <your name>
ADD ./your-tests /app/oscap4docker-tests
RUN yum install -y -q <your dependencies>
CMD ["/app/oscap4docker-tests/"]
$ docker build -t my-tests ./
...
$ docker run -t my-tests
...

Image content and considerations

Base image

Since this image just need bats and little dependencies, we use Centos Linux 7 as a base image.

Already installed package

We embed a set of basic packages :

Contributing

Do not hesitate to contribute by forking this repository

Pick at least one :

Finnaly, open the Pull Request : CircleCi will automatically build and test for you