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

Secure vs insecure image pruning #4471

Merged
merged 1 commit into from
Oct 5, 2017

Conversation

miminar
Copy link

@miminar miminar commented May 24, 2017

Document new options related to secure connection to integrated docker registry and a mechanism that decides whether to fall-back to insecure connection.

Resolves #4232
Resolves bz#1469654

Is blocked on openshift/origin#14114? No longer blocked.

@miminar
Copy link
Author

miminar commented May 24, 2017

@legionus PTAL

@miminar
Copy link
Author

miminar commented May 31, 2017

@soltysh PTAL

used by {product-title}, it needs to be specified using
`--certificate-authority` flag. Otherwise, the prune command will fail with
error similar to
link:#using-insecure-connection-against-secured-registry[the one below].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xref:using-insecure-connection-against-secured-registry[the one below]

.^|`--force-insecure`
|Allow an insecure connection to the docker registry that is hosted
via HTTP or has an invalid HTTPS certificate. By default, insecure connection
is allowed only in case where neither certificate-authority nor registry-url is
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`certificate-authority`
`registry-url`

====
If the registry is secured by a certificate authority different from the one
used by {product-title}, it needs to be specified using
`--certificate-authority` flag. Otherwise, the prune command will fail with
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`prune` command

s/with error similar to/with an error similar to

It means that your registry is secured using a certificate signed by a
certificate authority other than the one used by `oadm prune images` client for
connection verification. By default, the certificate authority data stored in
user's config are used - the same for communication with the master API.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/config/configuration file
s/-/--


It means that your registry is secured using a certificate signed by a
certificate authority other than the one used by `oadm prune images` client for
connection verification. By default, the certificate authority data stored in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move the code block to just before "By default...." so that the first sentence does not get broken up.

@@ -188,14 +188,27 @@ particular namespace makes it impossible to calculate their current usage.

|Option |Description

.^|`--all`
|Include images that were not pushed to the registry but have been mirrored by
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

registry, but

@@ -283,9 +306,39 @@ $ oadm prune images --keep-tag-revisions=3 --keep-younger-than=60m --confirm
$ oadm prune images --prune-over-size-limit --confirm
----

.Using secure or insecure connection
Copy link
Contributor

@ahardin-rh ahardin-rh Jun 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we can use a discrete heading here instead?

|===

.Determining images and layers eligible for pruning
Copy link
Contributor

@ahardin-rh ahardin-rh Jun 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we can use a discrete heading here instead?

Copy link

@soltysh soltysh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left you some comments.

|Allow an insecure connection to the docker registry that is hosted
via HTTP or has an invalid HTTPS certificate. By default, insecure connection
is allowed only in case where neither certificate-authority nor registry-url is
specified. Whenever possible, use `--certificate-authority` instead of this
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd move the last sentence as a NOTE below. Additionally, reword this to something like:

Whenever possible use --certificate-authority, instead. Use of this option is strongly discouraged.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've ditched it. There is plenty of other places advocating the same. Instead, I've put (Dangerous) at the beginning.

use a cluster-internal URL determined from managed images and image streams. In
case it fails (the registry cannot be resolved or reached), an alternative route
that works needs to be provided using this flag. If provided, a secure
connection will be initiated. To allow a fall-back to insecure transport, use
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't encourage using --force-insecure anywhere, so drop the last sentence. It's already explained and that's it, it should not be used anywhere, though.

@@ -283,9 +306,39 @@ $ oadm prune images --keep-tag-revisions=3 --keep-younger-than=60m --confirm
$ oadm prune images --prune-over-size-limit --confirm
----

.Using secure or insecure connection

The secure connection is preferred for production use. It is done over HTTPS
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion:
The secure connection is the preferred and recommended approach.

It's the recommended as a rule, not only for production.

to insecure connection which is dangerous. In this case, either certificate
verification is skipped or plain HTTP protocol is used.

The fall-back to insecure connection is allowed in following cases unless
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/following/the following

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

following cases , unless

The fall-back to insecure connection is allowed in following cases unless
`--certicate-authority` is specified:

1. The prune command is run with `--force-insecure` option.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add info in parenthesis this is not recommended.

attempts to use secure connection. The recommened solution is to
xref:../install_config/registry/securing_and_exposing_registry.adoc#securing-the-registry[secure
the registry]. If that is not desired, you may force the client to use insecure
connection by appending `--force-insecure` to the command.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add not recommended at the end in parens.

@miminar miminar changed the title Secure vs insecure image pruning [DO NOT MERGE] Secure vs insecure image pruning Jun 5, 2017
@miminar
Copy link
Author

miminar commented Jun 5, 2017

Now blocked on openshift/origin#14405. I will need to update error messages once it lands.

@miminar
Copy link
Author

miminar commented Jun 27, 2017

Now blocked on openshift/origin#14914

@miminar miminar force-pushed the secure-image-pruning branch 2 times, most recently from 1bb8a53 to cecc1f6 Compare July 11, 2017 11:53
@miminar
Copy link
Author

miminar commented Jul 11, 2017

Thanks for all the comments. They should be addressed now. The dependency PR is still waiting for the unblocked merge queue.

@miminar miminar force-pushed the secure-image-pruning branch from cecc1f6 to d82651d Compare October 3, 2017 13:28
@miminar miminar changed the title [DO NOT MERGE] Secure vs insecure image pruning Secure vs insecure image pruning Oct 3, 2017
@miminar
Copy link
Author

miminar commented Oct 3, 2017

No longer blocked. @ahardin-rh could you please review once more?

@miminar miminar force-pushed the secure-image-pruning branch from d82651d to 3b0ca97 Compare October 3, 2017 13:30
@miminar
Copy link
Author

miminar commented Oct 3, 2017

I'd like to make some corrections for earlier releases. Shall I re-open this against enterprise-3.6 and enterprise-3.5?

@bparees
Copy link
Contributor

bparees commented Oct 3, 2017

@miminar if we label this PR for 3.5 and 3.6, the changes will be applied there.

if 3.5 and 3.6 need a different set of doc, then you'll need to open a separate PR and only label it for 3.5 and 3.6.

@bparees
Copy link
Contributor

bparees commented Oct 3, 2017

@miminar so which versions is this specific PR appropriate for?

@bparees bparees self-assigned this Oct 3, 2017
@miminar
Copy link
Author

miminar commented Oct 4, 2017

@bparees 3.6 - latest; I'll re-submit new PRs for 3.4 and 3.5

[[image-pruning-problems]]
=== Image Pruning Problems

[discrete]
==== Images not being pruned
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Images Not Being Pruned

@@ -342,6 +392,58 @@ them from ever being pruned.
xref:../dev_guide/managing_images.adoc#tag-naming[Learn more about _istag_
naming.]

[discrete]
[[using-secure-connection-against-insecure-registry]]
==== Using secure connection against insecure registry
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a Secure Connection Against an Insecure Registry

[[using-secure-connection-against-insecure-registry]]
==== Using secure connection against insecure registry

If you see similar message in the output of the `oadm prune images` command:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you see a message similar to the following in the output of the oadm prune images command, then your registry is not secured and the oadm prune images client will attempt to use a secure connection:

It means that your registry is not secured and the `oadm prune images` client
attempts to use secure connection. The recommened solution is to
xref:../install_config/registry/securing_and_exposing_registry.adoc#securing-the-registry[secure
the registry]. If that is not desired, you may force the client to use insecure
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can force the client to use an insecure

connection by appending `--force-insecure` to the command *(not recommended)*.

[[using-insecure-connection-against-secured-registry]]
==== Using insecure connection against secured registry
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using an Insecure Connection Against a Secured Registry

By default, the certificate authority data stored in user's configuration file
are used -- the same for communication with the master API.

Use `--certificate-authority` option to provide the right certificate authority
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use the


[discrete]
[[using-wrong-certificate-authority]]
==== Using wrong certificate authority
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the Wrong Certificate Authority

[[using-wrong-certificate-authority]]
==== Using wrong certificate authority

The following error means that certificate authority used to sign the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that the certificate

==== Using wrong certificate authority

The following error means that certificate authority used to sign the
certificate of the secured Docker registry is different from the authority used
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

different than

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docker registry


Make sure to provide the right one with the flag `--certificate-authority`.

As a work-around, the `--force-insecure` flag may be added instead *(not
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be added instead

`--registry-url`.

.^|`--force-insecure`
|*(Dangerous)* Allow an insecure connection to the docker registry that is
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docker registry


Use `--certificate-authority` option to provide the right certificate authority
for the docker registry server.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docker registry

@ahardin-rh
Copy link
Contributor

@miminar Thanks! Just a few minor comments from me.

Just a heads-up that, given our new docs workflow, if you want to submit separate PRs for 3.4 and 3.5, be sure to do so against enterprise-3.4-stage and enterprise-3.5-stage respectively. Thanks again!

@miminar
Copy link
Author

miminar commented Oct 5, 2017

@ahardin-rh thanks a lot! Comments should be addressed now.

Document new options related to secure connection to integrated docker
registry and a mechanism that decides whether to fall-back to insecure
connection.

Signed-off-by: Michal Minář <[email protected]>
@ahardin-rh
Copy link
Contributor

@miminar Excellent. Thank you!

@ahardin-rh ahardin-rh merged commit 999c346 into openshift:master Oct 5, 2017
@ahardin-rh
Copy link
Contributor

[rev_history]
|xref:../admin_guide/pruning_resources.adoc#admin-guide-pruning-resources[Pruning Objects]
|Added details on secure versus insecure image pruning.
%

@adellape adellape modified the milestones: Next Release, Staging Oct 9, 2017
@vikram-redhat vikram-redhat modified the milestones: Staging, Published - 10/11/2017 Oct 12, 2017
@miminar miminar deleted the secure-image-pruning branch December 3, 2017 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants