Skip to content

Conversation

@rjernst
Copy link
Member

@rjernst rjernst commented May 11, 2017

Specifying s3 access and secret keys inside repository settings are not
secure. However, until there is a way to dynamically update secure
settings, this is the only way to dynamically add repositories with
credentials that are not known at node startup time. This commit adds
back access_key and secret_key s3 repository settings, but protects
it with a required system property allow_insecure_settings.

Specifying s3 access and secret keys inside repository settings are not
secure. However, until there is a way to dynamically update secure
settings, this is the only way to dynamically add repositories with
credentials that are not known at node startup time. This commit adds
back `access_key` and `secret_key` s3 repository settings, but protects
it with a required system property `allow_insecure_settings`.
Copy link
Contributor

@dadoonet dadoonet left a comment

Choose a reason for hiding this comment

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

Left minor comments.
I think we may be need to warn when we start the node if allow_insecure_settings is set, no?

import java.util.EnumSet;
import java.util.Set;

import org.elasticsearch.cluster.routing.IllegalShardRoutingStateException;
Copy link
Contributor

Choose a reason for hiding this comment

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

Not needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed, removed in ad4c625

/**
* A setting which contains a sensitive string, but which for legacy reasons must be found outside secure settings.
* @see #secureString(String, Setting, Property...)
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Wrong name for the method?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ooops, thanks! Fixed in ad4c625

@rjernst
Copy link
Member Author

rjernst commented May 11, 2017

I think we may be need to warn when we start the node if allow_insecure_settings is set

For what purpose? Every insecure setting is automatically marked as deprecated, so simply using the setting will cause a deprecation warning.

@dadoonet
Copy link
Contributor

Every insecure setting is automatically marked as deprecated, so simply using the setting will cause a deprecation warning.

Ha that's right. But as it's up to the user to use that insecure setting when he registers a new repository, the admin guy who actually starts elasticsearch server might not be aware at startup time that someone else might use an insecure setting at some point.

@s1monw
Copy link
Contributor

s1monw commented May 11, 2017

@rjernst what happens if somebody has a insecure setting but then goes and sets the property to false will the node start? And if the node has started and recovers a cluster state with such a setting will it fail?

@rjernst
Copy link
Member Author

rjernst commented May 11, 2017

For both questions, constructing the S3Repository would fail. However, since the s3 repositories are not created within Node construction, I don't think the node will fail, just that repository would be unavailable.

@s1monw
Copy link
Contributor

s1monw commented May 11, 2017

@rjernst LGTM then

Copy link
Member

@jasontedor jasontedor left a comment

Choose a reason for hiding this comment

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

I didn't do a full review, I just left one comment about the name of the system property. We have somewhat of a convention that we prefix these with es. that I think we should follow here.

public abstract class SecureSetting<T> extends Setting<T> {

/** Determines whether legacy settings with sensitive values should be allowed. */
private static final boolean ALLOW_INSECURE_SETTINGS = Booleans.parseBoolean(System.getProperty("allow_insecure_settings", "false"));
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be pre-fixed with es. like we try to do with other custom system properties that we use. I'm not sure if we're 100% consistent, but we should aim to be when adding new ones.

@rjernst rjernst dismissed jasontedor’s stale review May 11, 2017 19:14

Ok, renamed the property as you suggested.

@rjernst rjernst merged commit 17d0155 into elastic:master May 11, 2017
@rjernst rjernst deleted the s3_repo_creds branch May 11, 2017 19:14
@clintongormley clintongormley added :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs and removed :Plugin Repository S3 labels Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs >enhancement v6.0.0-beta1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants