Skip to content

Conversation

@hub-cap
Copy link
Contributor

@hub-cap hub-cap commented Jun 25, 2019

This commit adds permissions validation on the indices provided in the
enrich policy. These indices should be validated at store time so as not
to have cryptic error messages in the event the user does not have
permissions to access said indices.

This commit adds permissions validation on the indices provided in the
enrich policy. These indices should be validated at store time so as not
to have cryptic error messages in the event the user does not have
permissions to access said indices.
@hub-cap hub-cap added the :Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP label Jun 25, 2019
@hub-cap hub-cap requested a review from martijnvg June 25, 2019 15:45
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features

@hub-cap
Copy link
Contributor Author

hub-cap commented Jun 25, 2019

@elasticmachine run elasticsearch-ci/2

Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

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

LGTM. I left a note around the error message.


import java.nio.file.Path;

public class LocalStateEnrich extends LocalStateCompositeXPackPlugin {
Copy link
Member

Choose a reason for hiding this comment

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

lets hope this can be nuked soon (in master)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ugh yea... sins of my past

if (r.isCompleteMatch()) {
putPolicy(request, listener);
} else {
listener.onFailure(Exceptions.authorizationError("Could not store policy because an index specified {} did not" +
Copy link
Member

Choose a reason for hiding this comment

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

Maybe: unable to store policy, because no indices match with the specified index patterns [{}]
I don't think we have to include the fact that the user has no privileges to read specific indices,
because the user is unable to verify the existence of indices matching with the specified patterns.

@hub-cap
Copy link
Contributor Author

hub-cap commented Jul 1, 2019

@elasticmachine update branch

@hub-cap hub-cap merged commit b948d31 into elastic:enrich Jul 1, 2019
hub-cap added a commit that referenced this pull request Jul 10, 2019
This commit adds permissions validation on the indices provided in the
enrich policy. These indices should be validated at store time so as not
to have cryptic error messages in the event the user does not have
permissions to access said indices.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants