crashappsec / chalk

Chalk allows you to follow code from development, through builds and into production.
https://crashoverride.com/
GNU General Public License v3.0
322 stars 11 forks source link

fix(docker): non-chalked build from wrapped chalked base image #322

Closed miki725 closed 3 weeks ago

miki725 commented 3 weeks ago

Issue

fixes https://github.com/crashappsec/chalk/issues/305

Description

Wrapped chalk build does a couple of things:

As such whenever a non-chalk-wrapped docker build would build an image based on chalked base image it:

As a result chalk exec would report chalk mark of the base image hence loosing any context that in reality a child image is actually running.

This adds ONBUILD directives in docker while building base image which ensure that /chalk.json is mutated when a child image is built. This ensures that we can report base image METADATA_ID however indicating that another image is actually running.

This is a first step in the image lineage feature.

Testing

➜ make tests args="test_docker.py::test_onbuild --pdb --logs"