Rootless Docker Containers in Continuous Integration
Rapatti, Alex (2021)
Rapatti, Alex
2021
All rights reserved. This publication is copyrighted. You may download, display and print it for Your own personal use. Commercial use is prohibited.
Julkaisun pysyvä osoite on
https://urn.fi/URN:NBN:fi:amk-2021052110279
https://urn.fi/URN:NBN:fi:amk-2021052110279
Tiivistelmä
Tämä opinnäytetyö tilattiin Nokia Oyj:n toimesta. Yksi opinnäytetyön päätoiveista on kerätä tietoa uudesta konttimenetelmästä, juurettomista konteista, ja mahdollisesti integroida tai korvata niillä käytössä olevat Docker kontit. Docker kontteja hyödynnetään yrityksen ohjelmistokehitykseen liittyvissä työympäristöissä, kuten jatkuvan integraation automatisoiduissa testaus putkissa. Juurettomien konttien käyttöönotto edistäisi turvallisuutta ja mahdollistaisi konttien käyttöönoton kaikille yrityksen ohjelmistokehittäjille. Kontit ylläpitävät johdonmukaista ja tehokasta työntekoa takaamalla ohjelmistokehittäjille saman työympäristön.
Opinnäytetyön päämääränä on analysoida ja muokata Docker kontteja käynnistäviä ja konfiguroivia skriptejä. Ideana on mahdollistaa, että Linux-jakelupaketteihin perustuva käyttäjä voisi ilman juurioikeuksia kirjautua kontin sisälle. Juurioikeudet vastaavat Linux ympäristössä kaikkia hallinnollisia oikeuksia, minkä vuoksi niiden pois ottaminen käytöstä on suotuisaa kontin turvallisuuden kannalta. Opinnäytetyön tutkimusvaiheet perustuvat käytännön kokeiluihin ja opiskeluihin konttiteknologiasta, jatkuvasta kehityksestä, Linux-jakelupaketeista, juurettomista konteista ja Dockerista.
Vaikka skriptien muutokset ja tavallisen käyttäjän implementointi Docker kontteihin huomattiin olevan mahdollista, haasteita ilmeni siksi koska alkuperäiset skriptit toimivat ja ajoivat Docker kontteja juurioikeuksilla. Lisätutkimuksia ja testejä vaaditaan, jotta muutoksia voidaan harkita yrityksen viralliseen käyttöön. Ohjelmistokehittäjät Nokia Oyj:n puolella pystyvät kuitenkin hyödyntämään opinnäytetyöstä saatua teoreettista ja käytännöllistä tietoa skripteihin liittyvien muutosten perusteella. Teos saattaa myös olla hyödyllinen ohjelmistokehittäjille, jotka haluavat tehdä lisätutkimuksia Docker kontteihin liittyen ja haluavat mahdollisesti implementoida juurettomia kontteja omiin työympäristöihin. This thesis is a commission made by Nokia Corporation. The aim of the thesis is to collect information on a new container practice, Rootless containers, and integrate or replace Docker containers. These containers are used for software development environments, such as continuous integration pipelines. The change to rootless containers would improve the accessibility and security aspect of the containerized work environments of the developer teams, as they need to maintain the same work environments for efficiency and consistency.
The goal of the thesis is to inspect if the scripts that configure and run Docker containers with Linux distributions can be modified to have non-privileged users inside them, to ensure no user is required to have the administrative privileges to run and access them. This would be a major improvement in security, as having root privileges meant that a user could access anything inside the system with administrative rights. The research of the thesis is conducted from practical viewpoint and online sources and classes were used to gather knowledge on containers, continuous integration, Linux distributions, rootless containers and Docker.
While the implementations of modifying the Docker containers to run a non-root user inside the containers was deemed to be possible through trial and error, challenges were presented by the original scripts having and requiring root access in order to complete them. Further tests need to be conducted in order to integrate the changes into the official development work environments of the company. The developer teams of Nokia Corporation, however, can still utilize the information and practical knowledge gathered in this thesis and from the code modifications. It may also be useful for developers that inspect the Docker containers further and want to implement rootless containers for their own development work environments.
Opinnäytetyön päämääränä on analysoida ja muokata Docker kontteja käynnistäviä ja konfiguroivia skriptejä. Ideana on mahdollistaa, että Linux-jakelupaketteihin perustuva käyttäjä voisi ilman juurioikeuksia kirjautua kontin sisälle. Juurioikeudet vastaavat Linux ympäristössä kaikkia hallinnollisia oikeuksia, minkä vuoksi niiden pois ottaminen käytöstä on suotuisaa kontin turvallisuuden kannalta. Opinnäytetyön tutkimusvaiheet perustuvat käytännön kokeiluihin ja opiskeluihin konttiteknologiasta, jatkuvasta kehityksestä, Linux-jakelupaketeista, juurettomista konteista ja Dockerista.
Vaikka skriptien muutokset ja tavallisen käyttäjän implementointi Docker kontteihin huomattiin olevan mahdollista, haasteita ilmeni siksi koska alkuperäiset skriptit toimivat ja ajoivat Docker kontteja juurioikeuksilla. Lisätutkimuksia ja testejä vaaditaan, jotta muutoksia voidaan harkita yrityksen viralliseen käyttöön. Ohjelmistokehittäjät Nokia Oyj:n puolella pystyvät kuitenkin hyödyntämään opinnäytetyöstä saatua teoreettista ja käytännöllistä tietoa skripteihin liittyvien muutosten perusteella. Teos saattaa myös olla hyödyllinen ohjelmistokehittäjille, jotka haluavat tehdä lisätutkimuksia Docker kontteihin liittyen ja haluavat mahdollisesti implementoida juurettomia kontteja omiin työympäristöihin.
The goal of the thesis is to inspect if the scripts that configure and run Docker containers with Linux distributions can be modified to have non-privileged users inside them, to ensure no user is required to have the administrative privileges to run and access them. This would be a major improvement in security, as having root privileges meant that a user could access anything inside the system with administrative rights. The research of the thesis is conducted from practical viewpoint and online sources and classes were used to gather knowledge on containers, continuous integration, Linux distributions, rootless containers and Docker.
While the implementations of modifying the Docker containers to run a non-root user inside the containers was deemed to be possible through trial and error, challenges were presented by the original scripts having and requiring root access in order to complete them. Further tests need to be conducted in order to integrate the changes into the official development work environments of the company. The developer teams of Nokia Corporation, however, can still utilize the information and practical knowledge gathered in this thesis and from the code modifications. It may also be useful for developers that inspect the Docker containers further and want to implement rootless containers for their own development work environments.
