Skip to content

Commit d7206de

Browse files
authored
Quotes
1 parent 1c845e1 commit d7206de

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ varying ways.
1111

1212
## Introduction
1313

14-
After reading that "best practice" suggests that one should “Never put any
14+
After reading that "best practice" suggests that one should never put any
1515
secret or credentials in the Dockerfile instructions (environment variables,
16-
args, or hard coded into any command) (Álvaro Iradier, 2021)[^dockerfile-best-practices] and seeing how
16+
args, or hard coded into any command) (Álvaro Iradier, 2021)[^dockerfile-best-practices] and seeing how
1717
often this practice is ignored, I questioned how easy it would be to extract
1818
secrets from a Docker image.
1919

@@ -24,9 +24,9 @@ secrets from a Docker image.
2424
One way that secrets tend to be stored into a Docker image is through
2525
copying sensitive files into the image, whether by mistake, due to naivety, or
2626
for "ease of use". Fundamentally, this issue is described by [CWE-798: Use of
27-
Hard-coded Credentials][cwe-798-harcoded-credentials] in that “Hard-coded
27+
Hard-coded Credentials][cwe-798-harcoded-credentials] in that hard-coded
2828
credentials typically create a significant hole that allows an attacker to
29-
bypass the authentication that has been configured (Mitre.org, 2020)[^cwe-798].
29+
bypass the authentication that has been configured (Mitre.org, 2020)[^cwe-798].
3030

3131
Secrets could be stored into a Docker image by copying your `.env` file into the
3232
image, or by copying a private key, or other similar credentials, into the
@@ -49,14 +49,14 @@ Apigee][gcp-apigee-exploit].
4949
In the case of Codecov, credentials exported from a Docker image were used to
5050
launch a man-in-the-middle attack on Codecov's infrastructure and further
5151
exfiltrate the environment variables of some of Codecov's 23,000 customers
52-
(Jackson, 2021)[^codecov-breach] - and, consequentially, “Large organizations such as Twilio,
52+
(Jackson, 2021)[^codecov-breach] - and, consequentially, large organizations such as Twilio,
5353
Hashicorp, Rapid7, Confluent have released their own statements about how this
54-
has affected them. (Jackson, 2021)[^codecov-breach]
54+
has affected them. (Jackson, 2021)[^codecov-breach]
5555

56-
Similarly, in the case of Apigee it was found that Aside from a number of other
56+
Similarly, in the case of Apigee it was found that Aside from a number of other
5757
bugs found by analysing the source code (SSRFs, path traversals, authorization
5858
bypasses and more), the image included several hard-coded passwords, which
59-
turned out to be re-used in production. (August, 2023)‌‌‌[^apigee-case] As a result of these
59+
turned out to be re-used in production. (August, 2023)‌‌‌[^apigee-case] As a result of these
6060
findings, the researcher was able to gain access to Google's own Apigee
6161
instance.
6262

@@ -66,17 +66,17 @@ instance.
6666

6767
## Why It Matters
6868

69-
The security concept of Least Privilege asserts that a user or entity should
69+
The security concept of Least Privilege asserts that a user or entity should
7070
only have access to the specific data, resources and applications needed to
71-
complete a required task. (Palo Alto Networks, 2015)[^least-privilege-explanation] which,
71+
complete a required task. (Palo Alto Networks, 2015)[^least-privilege-explanation] which,
7272
consequentially, helps to reduce attack surface and attack spread. By storing
7373
secrets in Docker images, it becomes possible to bypass other security
7474
procedures without the need for them to be compromised, nor for the attacker to
7575
escalate their privileges.
7676

77-
Alongside this, a pillar of zero-trust security is the assumption that there
77+
Alongside this, a pillar of zero-trust security is the assumption that there
7878
are attackers both within and outside of the network, so no users or machines
79-
should be automatically trusted. (Cloudflare.com, 2021)[^zero-trust-explanation]
79+
should be automatically trusted. (Cloudflare.com, 2021)[^zero-trust-explanation]
8080

8181
By leaving such such a security hole in your application, any RBAC or other
8282
procedures that you have in place to protect your application are bypassed and
@@ -85,9 +85,9 @@ and infrastructure.
8585

8686
### My Docker Repository is Private, So It's Safe, Right?
8787

88-
In the case of Apigee, this was accidentally not the case - "a Docker registry
88+
In the case of Apigee, this was accidentally not the case - a Docker registry
8989
was available on docker.apigee.net, which allowed unauthenticated users to pull
90-
the Apigee Edge Docker image" (August, 2023)‌‌‌[^apigee-case]. This is the kind of small
90+
the Apigee Edge Docker image (August, 2023)‌‌‌[^apigee-case]. This is the kind of small
9191
oversight that can have large consequences. It is one issue to accidentally
9292
expose the source code of your application - whereas exposing the critical
9393
secrets of the application alongside it gives an attacker both the lock and the
@@ -115,16 +115,16 @@ use a secret management system to store and retrieve these secrets. This allows
115115
you to keep your Docker image free of sensitive information and allows you to
116116
rotate secrets without needing to rebuild your Docker image.
117117

118-
Ideally, secrets should be stored in a cryptographic secret vault and loaded
119-
when needed" (August, 2023)‌‌‌[^apigee-case] and such a solution can be implemented using
118+
Ideally, secrets should be stored in a cryptographic secret vault and loaded
119+
when needed (August, 2023)‌‌‌[^apigee-case] and such a solution can be implemented using
120120
tools such as [HashiCorp Vault][hashicorp-vault], [AWS Secrets
121121
Manager][aws-secrets-manager], [Google Cloud Secret
122122
Manager][gcp-secret-manager], or [Azure Key Vault][azure-key-vault].
123123

124-
As an additional preventative step, you can prevent files from accidentally
124+
As an additional preventative step, you can prevent files from accidentally
125125
winding up on your image by adding them to the `.dockerignore` file. For
126126
example, if you’re worried about accidentally adding SSH keys to your image, you
127-
can include: `*id_rsa*` (Cotton, 2023)[^protecting-docker-secrets]
127+
can include: `*id_rsa*` (Cotton, 2023)[^protecting-docker-secrets]
128128

129129
[hashicorp-vault]: https://www.hashicorp.com/products/vault
130130
[aws-secrets-manager]: https://aws.amazon.com/secrets-manager/

0 commit comments

Comments
 (0)