diskimage-builder/elements/ubuntu-core
Ian Wienand 672705831f Add a best-effort sudo safety check
As motivation for this; we have had two breakouts of dib in recent
memory.  One was a failure to unmount through symlinks in the core
code (I335316019ef948758392b03e91f9869102a472b9) and the other was
removing host keys on the build-system
(Ib01d71ff9415a0ae04d963f6e380aab9ac2260ce).

For the most part, dib runs unprivileged.  Bits of the core code are
hopefully well tested (modulo bugs like the first one!).  We give free
reign inside the chroot (although there is still some potential there
for adverse external affects via bind mounts).  Where we could be a
bit safer (and could have prevented at least the second of these
breakouts) is with some better checking that the "sudo" calls
*outside* the chroot at least looked sane.

This adds a basic check that we're using chroot or image paths when
calling sudo in those parts of elements that run *outside* the chroot.
Various files are updated to accomodate this check; mostly by just
ignoring it for existing code (I have not audited these calls).

Nobody is pretending this type of checking makes dib magically safe,
or removes the issues with it needing to do things as root during the
build.  But this can help find egregious errors like the key removal.

Change-Id: I161a5aea1d29dcdc7236f70d372c53246ec73749
2016-05-09 15:41:38 +10:00
..
environment.d Add element for ubuntu-core 2014-12-11 18:04:58 -08:00
root.d Add a best-effort sudo safety check 2016-05-09 15:41:38 +10:00
README.rst Create docs site containing element READMEs 2015-02-10 11:45:35 -08:00
element-deps Add element for ubuntu-core 2014-12-11 18:04:58 -08:00
element-provides Add element for ubuntu-core 2014-12-11 18:04:58 -08:00
package-installs.yaml Add element for ubuntu-core 2014-12-11 18:04:58 -08:00

README.rst

ubuntu-core

Use Ubuntu Core cloud images as the baseline for built disk images.

Overrides:

  • To use a non-default URL for downloading base Ubuntu cloud images, use the environment variable DIB_CLOUD_IMAGES
  • To download a non-default release of Ubuntu cloud images, use the environment variable DIB_RELEASE
  • To use different mirrors rather than the default of archive.ubuntu.com and security.ubuntu.com, use the environment variable DIB_DISTRIBUTION_MIRROR