Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use only an allowed registry in the FROM image #431

Closed
avelino opened this issue Sep 12, 2020 · 0 comments · Fixed by #432
Closed

Use only an allowed registry in the FROM image #431

avelino opened this issue Sep 12, 2020 · 0 comments · Fixed by #432

Comments

@avelino
Copy link
Member

avelino commented Sep 12, 2020

Problematic code:

FROM randomguy/python:3.6
...

Correct code:

FROM my-registry.com/python:3.6
...

Rationale:

Using the FROM instruction is a huge exercise in trust, you have to trust that a particular version or an image is safe for you to use, and that it will never be retagged maliciously. In order to prevent that, some companies copy trusted images into their own repositories, and reference them directly.

For example, this would be an untrusted image:

FROM randomguy/fancy:10
...

But after an audit, the company decides to copy the image into their own repository, as it was deemed safe:

FROM my-registry.com/fancy:10
...

The idea is that hadolint can warn whenever an untrusted repo is used, you can use the --trusted-registry flag for that

hadolint --trusted-registry my-registry.com Dockerfile
avelino added a commit that referenced this issue Sep 13, 2020
fixed: #431

Signed-off-by: Avelino <t@avelino.xxx>
avelino added a commit that referenced this issue Sep 13, 2020
* set docker registry path
fixed: #431

Signed-off-by: Avelino <t@avelino.xxx>

* fixed travis PR test

Signed-off-by: Avelino <t@avelino.xxx>
avelino added a commit that referenced this issue Sep 13, 2020
* set docker registry path
fixed: #431

Signed-off-by: Avelino <t@avelino.xxx>

* fixed travis PR test

Signed-off-by: Avelino <t@avelino.xxx>
avelino added a commit that referenced this issue Sep 14, 2020
* refactor migrate commands

- remove create command and goto command, refactor migration to use
transaction to be able roolback when a file with multiple statements
fail

In case of goto we removed because it do the same of next.
Create: we need a command that just create a file?

Signed-off-by: Felipe Oliveira <fpo@felipeweb.dev>

* lint fix

Signed-off-by: Felipe Oliveira <fpo@felipeweb.dev>

* fix tests

Signed-off-by: Felipe Oliveira <fpo@felipeweb.dev>

* try to fix called twice on migration

Signed-off-by: Felipe Oliveira <fpo@felipeweb.dev>

* Revert "try to fix called twice on migration"

This reverts commit 8733843.

* try to fix called twice on migration

Signed-off-by: Felipe Oliveira <fpo@felipeweb.dev>

* update migration

Signed-off-by: Felipe Oliveira <fpo@felipeweb.dev>

* migration v3

Signed-off-by: Felipe Oliveira <fpo@felipeweb.dev>

* backwards compatible

Signed-off-by: Felipe Oliveira <fpo@felipeweb.dev>

* lint

Signed-off-by: Felipe Oliveira <fpo@felipeweb.dev>

* fix query

Signed-off-by: Felipe Oliveira <fpo@felipeweb.dev>

* set docker registry path (#432)

* set docker registry path
fixed: #431

Signed-off-by: Avelino <t@avelino.xxx>

* fixed travis PR test

Signed-off-by: Avelino <t@avelino.xxx>

* upgrade all go dep packages

Signed-off-by: Avelino <t@avelino.xxx>

Co-authored-by: Avelino <t@avelino.xxx>
@avelino avelino added this to the API Server - v1.0.5 milestone Dec 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant