Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
eb95cbb
feat(gitbook): build with gitbook
PauloASilva Apr 21, 2019
5e81543
Correct syntax in hyperlinks
drwetter Apr 23, 2019
4794bc5
Reorder logic for privileged containers
drwetter Apr 23, 2019
f0f995c
Complete second part
drwetter Apr 23, 2019
3303565
Polish a bit
drwetter Apr 23, 2019
00f216f
Renamed E11
drwetter Apr 25, 2019
5135336
rename
drwetter Apr 25, 2019
cc519db
Merge branch 'master' of github.com:OWASP/Docker-Security
drwetter Apr 25, 2019
0f4721f
fix: custom gitbook structure.readme and pdf.fontFamily
PauloASilva Apr 26, 2019
ac4e55b
Merge branch 'master' into feature-build
PauloASilva Apr 26, 2019
f412a07
fix: Markdown parsing issue at 'D04 - Secure Defaults and Hardening'
PauloASilva Apr 26, 2019
179b5bc
feat(gitbook): Allow manual page breaks
PauloASilva May 15, 2019
b680a30
better explain container scanning
drwetter May 27, 2019
331e92e
polishing expressions, make some points clearer
drwetter May 27, 2019
437422a
minor tweak in the intro
drwetter May 27, 2019
a3d25f5
First draft with memory only
drwetter Jun 14, 2019
493b87f
Push on-file changes: Typos corrected
drwetter Jun 18, 2019
c9c05b2
Push on-file changes: Make the points clearer
drwetter Jun 18, 2019
f95e1ff
Push on-file changes: rewriting some parts, make it clearer
drwetter Jun 18, 2019
91e18f2
Push on-file changes: another round of self review
drwetter Jun 18, 2019
3c50f93
Add docker threat overview mindmap
wurstbrot Jun 19, 2019
73d815a
Merge pull request #7 from wurstbrot/master
drwetter Jun 20, 2019
52167c5
feature(build): Add build system based on docker
PauloASilva Jun 21, 2019
798a866
fix: create container `/build` directory
PauloASilva Jun 24, 2019
783d852
Add problem with wrong mapping
drwetter Jun 25, 2019
c4a7235
Snappier, added section for automated vulnerability scanning
drwetter Jun 25, 2019
45479aa
Merge branch 'master' into feature-build
PauloASilva Jun 28, 2019
b85c064
refactor: move image from `assets` to `src/images` directory
PauloASilva Jun 28, 2019
d8575cd
chore: update PDF
PauloASilva Jun 28, 2019
591b1b4
chore: make repo directory structure flat
PauloASilva Jun 29, 2019
14f8ba5
Renaming of Separation into Segmentation
drwetter Aug 22, 2019
014b1be
Draft of (systems) security context's
drwetter Aug 23, 2019
e0f5e32
reordering minor points
drwetter Sep 13, 2019
33c0661
fix typos
drwetter Sep 13, 2019
8e5bf23
Typos, some paragraphs phrased better
drwetter Sep 14, 2019
8b923b1
mention scanning from the outside
drwetter Sep 14, 2019
1743a9d
Adding a references (Tesla incident)
drwetter Sep 14, 2019
38f6c30
Footnotes, clarify ransomware-->SMBv1, wording
drwetter Sep 20, 2019
d967d41
Wording, footnotes, (bad) design from orchestration tool interfaces
drwetter Sep 20, 2019
514ff21
Add cvedetails
drwetter Sep 20, 2019
4a6fdb8
Merge pull request #8 from PauloASilva/feature-build
drwetter Sep 20, 2019
d7eda99
Updated PDF
drwetter Sep 21, 2019
f4917dd
Dockerfile: Avoid outdated Docker cache for "apt-get install"
hartwork Nov 8, 2019
6426e6f
fix: cover typo
PauloASilva Nov 8, 2019
180069a
Merge pull request #19 from PauloASilva/fix/cover-typo
drwetter Nov 8, 2019
a653362
Partly fix License mentioning issue
drwetter Nov 9, 2019
484177d
Merge pull request #15 from hartwork/improve-dockerfile
drwetter Nov 9, 2019
96fdca2
Update D00 - Overview.md
dizzersee Feb 7, 2020
4064ca1
Merge pull request #21 from dizzersee/patch-1
drwetter Feb 7, 2020
28518cc
Practical hints
drwetter Feb 18, 2020
070f3f9
Use proper link to D03 in summary
Mar 2, 2020
a038db2
Merge pull request #22 from milansanders/master
drwetter Mar 3, 2020
92206d4
fix simple typos
lpmi-13 Sep 29, 2020
cce9cb5
Merge pull request #24 from lpmi-13/typo-fix
drwetter Sep 30, 2020
93d286f
fix typo, add okd
drwetter Sep 30, 2020
f17552d
Merge pull request #25 from OWASP/drwetter-patch-1
drwetter Sep 30, 2020
b15e5c0
clarify last line/paragraph
drwetter Sep 30, 2020
98731d3
Merge pull request #26 from OWASP/drwetter-patch-1
drwetter Sep 30, 2020
135265a
fix important typo
kauedg Dec 29, 2020
0b20544
Merge pull request #29 from kauedg/master
drwetter Dec 29, 2020
0cb4141
Update D03 - Network Segmentation and Firewalling.md
drwetter Dec 29, 2020
7134d76
Pod security policy added
drwetter Dec 29, 2020
fe1a8de
Remove docker compose + mesos
drwetter Dec 29, 2020
344fd00
version 3.6 is more compatible with Debian 10
drwetter Dec 29, 2020
58e0cc3
Revert the change for docker-compose
drwetter Dec 29, 2020
fd85cac
Save 1-2 layers & clean apt cache
drwetter Dec 29, 2020
e0bb9f9
Merge branch 'master' of github.com:OWASP/Docker-Security
drwetter Dec 29, 2020
2dda553
Add Contributing Guidelines
drwetter Dec 29, 2020
8085a88
Partly address "Cover should mention "CC-BY-NC-SA 4.0 International"
drwetter Dec 29, 2020
702fea8
fix: Lock docker base image (closes #32)
PauloASilva Dec 29, 2020
60086fb
Merge pull request #34 from PauloASilva/fix/issue-32
drwetter Dec 29, 2020
9e58a89
Newly generated
drwetter Dec 29, 2020
56b3df6
Merge pull request #35 from OWASP/new_pdf1
drwetter Dec 29, 2020
5e87607
Add hint for capabilities
drwetter Mar 6, 2021
d34b2a2
Merge pull request #41 from OWASP/drwetter-patch-1
drwetter Apr 2, 2021
199611f
Update note regarding user namespace limitations
vin01 Apr 21, 2021
11b03cf
Merge pull request #42 from vin01/master
drwetter Apr 22, 2021
8c9ffbe
Add doc structure
drwetter May 25, 2021
386bf35
Merge pull request #43 from OWASP/doc-structure
drwetter May 25, 2021
0b8ca68
Add doc structure
drwetter May 25, 2021
f041d62
Merge pull request #44 from OWASP/drwetter-patch-1
drwetter May 25, 2021
68adf5c
Explain the dev branches
drwetter Jun 7, 2021
e36d8c0
Merge pull request #47 from OWASP/make_dev_explaination
drwetter Jun 7, 2021
45a6097
Added ecxample for pdf build using pandoc
R3dIO Dec 13, 2021
1ab5e1f
Merge branch 'OWASP:main' into feature/md2pdf
R3dIO Dec 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
_book/

12 changes: 10 additions & 2 deletions 000 - Introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This document is helping you to secure your containerized environment and keep i

There are often misunderstandings of what the security impacts - negative or positive - are supposed to be when using Docker.

Docker as any other containerization technology doesn't solve application security problems. It doesn't help doing input validation and it doesn't provide protecting against SQL injection. For application security risks OWASP provides a lot of other useful documents, starting from the OWASP Top 10 over the [https://www.owasp.org/index.php/OWASP_Proactive_Controls OWASP Proactive Controls] to the [https://www.owasp.org/index.php/Category:OWASP_Application_Security_Verification_Standard_Project OWASP Application Security Verification standard] -- just to name a few.
Docker as any other containerization technology doesn't solve application security problems. It doesn't help doing input validation and it doesn't provide protecting against SQL injection. For application security risks OWASP provides a lot of other useful documents, starting from the OWASP Top 10 over the [OWASP Proactive Controls](https://www.owasp.org/index.php/OWASP_Proactive_Controls) to the [OWASP Application Security Verification standard]([https://www.owasp.org/index.php/Category:OWASP_Application_Security_Verification_Standard_Project) -- just to name a few.

Container Security is mostly about system and network security and a secure architectural design.

Expand All @@ -22,7 +22,7 @@ Looking at it from the perspective of the classical world, especially in system

Apart from these technical areas there are two non-technical points:

* Docker with its 5 years is a relatively new technology. Subtracting the time for maturing and adoption the time span is even shorter. Every new technology needs time until the knowledge of the technology and their best practices becomes common knowledge.
* Docker is not a new technology anymore but subtracting the time for maturing and adoption, its time span is shorter. Every technology needs time until the knowledge of the technology and their best practices becomes common knowledge.
* While container solutions might offer benefits for the developer, the technology is not simple from the security perspective. Not being simple is what makes security more difficult, a.k.a. the _KISS principle_ -- keep it simple and stupid.

This is what this document is trying to help you with: It provides you with the knowledge to avoid common pitfalls in the system and network area and it tries to get a handle on the complexity.
Expand All @@ -31,4 +31,12 @@ This is what this document is trying to help you with: It provides you with the

In order to achieve this, this document first does an analysis of the threats caused by the technology. This is the basis for the ten points to follow.

Each of those ten points has paragraphs in the following order:

* introduction,
* outline of threat scenarios,
* recommendation how to prevent the aforementioned threats,
* technical hint how to identify whether you might a problem here
* and eventually lists references (split in commercial and non-commercial ones)

It is mostly agnostic to any orchestration framework or any other specific product (OS, programming language).
11 changes: 7 additions & 4 deletions 001 - Threats.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ The classical approach how to secure an environment is looking at it from the at

Those vectors will help you to define what needs to be protected. With this definition one can put security controls in place to provide a baseline protection and beyond. This is what the ten controls in the following chapters are about.

The following image gives an overview of threats in docker.
![threat-overview](assets/threats.png)


### Threat 1: Container Escape (System)

Expand Down Expand Up @@ -35,17 +38,17 @@ This again has the same first vector as the one mentioned before. With his shell
### Threat 6: Resource Starvation

The underlying vector is due to a security condition from another container
running on the same host. The security condition could be either to the
running on the same host. The security condition could be due to the
fact that the other container is eating up resources which could be CPU cycles,
RAM, network or disk-I/O.

It could also be that the container has a host file system mounted which the
attacker has been filling up which causes problem on the host which in turn
attacker has been filling up which causes problems on the host which in turn
affects other containers.

### Threat 7: Host compromise

Whereas the previous threat the attacker managed indirectly over the host to affect
Whereas in the previous threat the attacker managed indirectly over the host to affect
another / other containers, here the attacker has compromised the host -- either through
another container or through the network.

Expand All @@ -56,7 +59,7 @@ The CD pipeline could involve several hops where the mini operating system image
been passed from one step to the next until it reaches the deployment.

Every hop is a potential attack surface for the attacker. If an attacker manages
to get foot into one step and there's no integrity check whether what will be
to get a foothold into one step and there's no integrity check whether what will be
deployed is what should be deployed there is the threat that on behalf of the
attacker images with his malicious payloads are being deployed.

Expand Down
27 changes: 27 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

## Contributions / participation

is always welcome!

Note please the following:

* One PR per feature or bug fix or improvement. Please do not mix issues.
* Document your PR in the commit message
* To lower the bar: For a few points being not yet complete we have dev branches like D06_dev, D07_dev. If your input is important but not complete or needs more or less polishing or amendments before being merged to main those branches are the ones you should issue use your PRs against.
* If your PR is a WIP, please mark it accordingly. Remove that when you think you're done.

## Document Structure

For an amendment or if you want to fill in blanks for one of the ten points please follow the document structure:

* Introduction
* Examples of threat scenarios
* Recommendation how to prevent the aforementioned threats
* Technical hints how to identify whether you might have a problem here
* References (split in commercial and non-commercial ones)

Try to be as non-specific with respect to orchestration frameworks or any other product (OS, programming language).


For questions just open an issue.

18 changes: 9 additions & 9 deletions D00 - Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

| Title | Description |
| -- | -- |
| D01 - Secure User Mapping | Often the main security advantage of Docker is neglected: The application within the container runs with administrative privileges: root. This violates the least privilege principle and gives an attacker better chances further extending his activities if he manages to break out of the application into the container. From the host perspective the application should never run as root. |
| D02 - Patch Management Strategy | The host, the containment technology, the orchestration solution and the minimal operating system images in the container will have security bugs. Once publicly known it is vital for your security posture to address the bugs. For all domains mentioned you need to decide when you apply regular and emergency patches. |
| D03 - Network Separation and Firewalling | You properly need to design your network upfront. Management interfaces from the orchestration tool as well as network services are crucial and need to be protected on a network level. Also make sure that all other network based microservices are only exposed to the legitimate consumer of this microservice and not to the whole network. |
| D01 - Secure User Mapping | Most often the application within the container runs with the default administrative privileges: root. This violates the least privilege principle and gives an attacker better chances further extending his activities if he manages to break out of the application into the container. From the host perspective the application should never run as root. |
| D02 - Patch Management Strategy | The host, the containment technology, the orchestration solution and the minimal operating system images in the container will have security bugs. Once publicly known it is vital for your security posture to address those bugs in a timely fashion. For all those components mentioned you need to decide when you apply regular and emergency patches before you put those into production. |
| D03 - Network Segmentation and Firewalling | You properly need to design your network upfront. Management interfaces from the orchestration tool and especially network services from the host are crucial and need to be protected on a network level. Also make sure that all other network based microservices are only exposed to the legitimate consumer of this microservice and not to the whole network. |
| D04 - Secure Defaults and Hardening | Depending on your choice of host and container operating system and orchestration tool you have to take care that no unneeded components are installed or started. Also all needed components need to be properly configured and locked down. |
| D05 - Maintain Security Contexts | Mixing production containers on one host with other stages of undefined or less secure containers may open a backdoor to your production. Also mixing e.g. frontend with backend services on one host may have a negative security impact. |
| D06 - Protect Secrets | Authentication and authorization of a microservice against a peer or a third party requires secrets to be provided. Also for an attacker those secrets potentially provide access to your data. Any passwords, tokens, private keys or certificates need to be protected as good as possible. |
| D07 - Resource Protection | As all containers share the same physical CPU, disks, memory and networks those physical resources need to be protected so that a single container running out of control -- deliberately or not -- doesn't affect any other container's resources. |
| D08 - Container Image Integrity and Origin | The minimal operating system in the container runs your code and needs to be fully trustworthy, starting from the origin up until the deployment. You need to make sure that all transfers as well as the images at rest are secure. |
| D09 - Follow Immutable Paradigm | Often container images don't need to write into their filesystem or a mounted filesystem, once set up and deployed. In those cases you have a extra security benefit if you start the containers in read-only mode. |
| D10 - Logging | For your container image, orchestration tool and host you need to log all security relevant events on a system and API level. All logs should be remote, they should contain a common timestamp and they should be tamper proof. Your application should also provide remote logging, not into the container.
| D05 - Maintain Security Contexts | Mixing production containers on one host with other stages of undefined or less secure containers may open a backdoor to your production. Also mixing e.g. frontend with backend services on one host may have negative security impacts. |
| D06 - Protect Secrets | Authentication and authorization of a microservice against a peer or a third party requires secrets to be provided. For an attacker those secrets potentially enable him to access more of your data or services. Thus any passwords, tokens, private keys or certificates need to be protected as good as possible. |
| D07 - Resource Protection | As all containers share the same physical CPU, disks, memory and networks. Those physical resources need to be protected so that a single container running out of control -- deliberately or not -- doesn't affect any other container's resources. |
| D08 - Container Image Integrity and Origin | The minimal operating system in the container runs your code and needs to be trustworthy, starting from the origin up until the deployment. You need to make sure that all transfers and images at rest haven't been tampered with. |
| D09 - Follow Immutable Paradigm | Often container images don't need to write into their filesystem or a mounted filesystem, once set up and deployed. In those cases you have an extra security benefit if you start the containers in read-only mode. |
| D10 - Logging | For your container image, orchestration tool and host you need to log all security relevant events on a system and API level. All logs should be remote, they should contain a common timestamp and they should be tamper proof. Your application should also provide remote logging.


Loading