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

Indexing permissions as part of the Elastic Agent policy #187

Merged
merged 3 commits into from
Mar 30, 2021

Conversation

aleksmaus
Copy link
Member

What does this PR do?

Implements the Indexing permissions as part of the Elastic Agent policy
#101

  1. Adds a new field policy_output_permissions_hash into the Agent document that stores the hash of output_permissions from the policy.
  2. Retrieves the policy from .fleet-policies upon the agent enrollment and uses the output_permissions default namespace in order to create the role descriptors for the output API key generation.
  3. Checks the output_permissions upon every checking. If the hash doesn't match with the stored in the agent document the new key is generated.

This PR:

  1. doesn't invalidate the old API key see the comment for the next iteration [Discuss] Indexing permissions as part of the Elastic Agent policy #101 (comment)
  2. is not fully validated end-to-end with kibana for the output_permissions changes, pending on further kibana changes.

Should only be merged after the corresponding kibana changes:
elastic/kibana#94591

Why is it important?

Addresses: #101

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

Related issues

Screenshots

Screen Shot 2021-03-24 at 6 40 40 PM

@aleksmaus
Copy link
Member Author

This is the PR that was rolled back before, due to kibana changes not being merged. Now the kibana changes are merged and should be good to go.

@aleksmaus aleksmaus changed the title Feature/indexing permissions Indexing permissions as part of the Elastic Agent policy Mar 30, 2021
@aleksmaus aleksmaus added the enhancement New feature or request label Mar 30, 2021
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #187 opened

  • Start Time: 2021-03-30T15:35:53.271+0000

  • Duration: 5 min 33 sec

  • Commit: 98ccced

Test stats 🧪

Test Results
Failed 0
Passed 66
Skipped 0
Total 66

Trends 🧪

Image of Build Times

Image of Tests

@aleksmaus aleksmaus merged commit a743bad into elastic:master Mar 30, 2021
mergify bot pushed a commit that referenced this pull request Mar 30, 2021
* Indexing permissions as part of the Elastic Agent policy

* Delay the output key generation. Now it is dirven by the policy monitor policy updates.

(cherry picked from commit a743bad)

# Conflicts:
#	cmd/fleet/handleCheckin.go
#	cmd/fleet/handleEnroll.go
mergify bot added a commit that referenced this pull request Mar 30, 2021
* Indexing permissions as part of the Elastic Agent policy

* Delay the output key generation. Now it is dirven by the policy monitor policy updates.

(cherry picked from commit a743bad)

# Conflicts:
#	cmd/fleet/handleCheckin.go
#	cmd/fleet/handleEnroll.go

Co-authored-by: Aleksandr Maus <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v7.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants