Giter Club home page Giter Club logo

kaniko's Issues

Unprivileged & The usage of the root user

Congratulations on the launch, and thank you for investing in the direction of secure builds.

From the release's blog post:

an open-source tool for building container images from a Dockerfile even without privileged root access.

Since it doesn’t require any special privileges or permissions, you can run kaniko in a standard Kubernetes cluster, Google Kubernetes Engine, or in any environment that can’t have access to privileges or a Docker daemon.

Unfortunately, running a container as root inside a Kubernetes cluster, does indeed mean giving special privileges/permissions (e.g. PodSecurityPolicy). Under certain definitions of security where state/resourceful actors are involved, running any process (e.g. kaniko) as the root user inside a Docker container, and executing arbitrary code inside that process (e.g. kaniko doing executing a RUN statement that involve 3rd party dependencies), can be considered equivalent to giving root access to the underlying nodes. At least, until userns support is added to Kubernetes, or until alternative runtime become stable (e.g. Kata containers).

Therefore, I am saddened to notice that the previous statements are a bit misleading, and that kaniko will not help us get rid of the isolated nodes/VMs we must use for Gitlab/Jenkins CI.

As an actionable to this issue, I suggest adding relevant notes regarding the security aspects in the README.

Relationship to CBI?

A similar project called the "Container Builder Interface" (with more of a slant on defining an interface) was started a while ago. Have you looked a this, and is there any overlap that could result in a collaboration between the two projects?

https://github.com/containerbuilding/cbi

Dockerfile commands to implement

FROM

  • Add support for ARG with FROM

RUN

  • Run command in shell form -- RUN , default prefixed by "sh -c"
  • Run command in exec form
  • Change default shell for RUN command with the SHELL command

CMD

  • CMD in exec form
  • CMD as default parameters to entrypoint
  • CMD in shell form, default prefixed by "sh -c"
  • If multiple CMD calls in Dockerfile, only the last should be run

LABEL

  • Adds metadata to image (labels are inherited by parent/base images)

EXPOSE

  • Expose a port

ENV

  • Set environment variables as <key>:<value> pairs in image

ADD
Add has two forms:

  • ADD [--chown=<user>:<group>] <src>... <dest>

  • ADD [--chown=<user>:<group>] ["<src>",... "<dest>"]

  • Copy new files, directories, or remote URLs from <src> to the <dest>

  • Multiple sources may be specified, their paths are interpreted as relative to the context of the build

  • Support for any <src> to contain wildcards

  • <dest> is absolute path, or relative to WORKDIR command

  • Specify UID/GID with --chown flag

  • If <src> is local tar archive, it is unpacked to destination directory

COPY
COPY has two forms:
-COPY [--chown=<user>:<group>] <src>... <dest>
-COPY [--chown=<user>:<group>] ["<src>",... "<dest>"]

  • Allow copy from multiple sources to destination
  • Add support for wildcards in <src>
  • Specify UID/GID with --chown flag
  • Set source location to previous build stage with --from flag

ENTRYPOINT

  • Set entrypoint in exec and shell form

VOLUME

  • Create a mount point and mark it as holding externally mounted volumes

USER

  • Set UID/GID

WORKDIR

  • Set working directory

ARG

  • Implement ARG

ONBUILD

  • Add trigger to metadata of the image, under the key OnBuild

STOPSIGNAL

  • Implement stopsignal

HEALTHCHECK

  • Implement healthcheck

SHELL

  • Override default shell, can effect RUN/CMD/ENTRYPOINT commands

Integration test refactor.

We should scan a directory for Dockerfiles and create one test per Dockerfile instead of adding config.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.