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

docs: Update security documentation #3799

Merged
merged 17 commits into from
May 28, 2020

Conversation

bmorelli25
Copy link
Member

@bmorelli25 bmorelli25 commented May 15, 2020

Depends on elastic/beats#18594.

Motivation/summary

This PR updates the security documentation for APM Server to better explain the roles and privileges required to perform certain tasks.

Additional information, including a few follow-up tasks, is outlined in #3596 (comment).

Doc preview

http://apm-server_3799.docs-preview.app.elstc.co/diff

Related issues

@apmmachine
Copy link
Contributor

apmmachine commented May 15, 2020

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #3799 updated]

  • Start Time: 2020-05-28T15:09:13.990+0000

  • Duration: 3 min 20 sec

Copy link
Contributor

@simitt simitt left a comment

Choose a reason for hiding this comment

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

I really like the new structure. Left a couple of comments, mainly concerning the idea of moving the Kibana parts out of the server documentation if possible.

+

If you use the built-in +{beat_monitoring_user}+ user,
make sure you set the password before assigning it to users that need to write monitoring data to {es}.
Copy link
Contributor

Choose a reason for hiding this comment

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

This sentence confused me a bit, as the user is not assigned to other users; how about something like If you use the built-in +{beat_monitoring_user}+ user, make sure you set the password before using it.

{es-security-features} provides {ref}/built-in-roles.html[built-in roles] that grant a
subset of the privileges needed by APM users.
When possible, use the built-in roles to minimize the affect of future changes on your security strategy.
If no built-in role is available, you can create a custom user and assign
Copy link
Contributor

Choose a reason for hiding this comment

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

%s/a custom user/a custom role/
A custom user would need to be created in both cases.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point


* **Elasticsearch cluster privileges**: Manage the actions a user can perform against your cluster.
* **Elasticsearch index privileges**: Control access to the data in specific indices your cluster.
* **Kibana space privileges**: Grant users write or read access to features and apps within Kibana.
Copy link
Contributor

Choose a reason for hiding this comment

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

💯 on this overview!

can be performed by dedicated users with stricter privileges.

[float]
===== Event writer role
Copy link
Contributor

Choose a reason for hiding this comment

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

Looking at this again, the section for Event writer roles doesn't make too much sense as it is the same privileges as the general ones. Maybe it is better to remove this section after all, and only keep the section for Sourcemap writer role as that actually needs less privileges.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed.

endif::apm-server[]
|Index
|`read` on +{beat_default_index_prefix}-*sourcemap+ indices
|Read sourcemaps from {es}
Copy link
Contributor

Choose a reason for hiding this comment

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

You could mention that this privilege is only required if RUM and sourcemap is enabled (apm-server.rum.enabled: true and apm-server.rum.source_mapping.enabled: true)

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm hesitant to add the config values here, but I've added links to each value. How does this change look to you?

|Role | Purpose

|`kibana_user`
|Use the APM UI
Copy link
Contributor

Choose a reason for hiding this comment

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

The kibana_user is deprecated (sorry forgot to mention that) and should be replaced by the kibana_admin. When granting the kibana_admin one already grants all the privileges for Kibana spaces. This makes for a nice getting-started experience.
In the section below, where pointing out more fine granular privileges, please ensure to note that those can be used combined with the apm_user instead of granting the whole kibana_user/kibana_admin role.

Copy link
Member Author

Choose a reason for hiding this comment

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

You did mention it, I just forgot 😨. Thanks for the reminder. Good point on the kibana_admin. I've clarified.

docs/copied-from-beats/docs/security/users.asciidoc Outdated Show resolved Hide resolved

. Assign the *writer role* to users who will index events into {es}.
[[privileges-agent-central-config-server]]
==== APM Server central configuration management
Copy link
Contributor

Choose a reason for hiding this comment

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

Users might not be super familiar with the internals, that an APM agent retrieves the updated agent configuration via APM Server when they change it in Kibana. Therefore some explanation about this would be great, something like: When configuring central configurations for your agents in Kibana, ensure the user that you configure in APM Server to talk to Kibana has this role.


To grant users the required privileges:
[[privileges-agent-central-config-kib]]
==== Kibana central configuration management
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for repeating myself, but this would also be a section worth moving to Kibana in the long run.

|====

[[privileges-agent-central-config-api]]
==== Central configuration management API
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

@bmorelli25 bmorelli25 May 21, 2020

Choose a reason for hiding this comment

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

Because I'm planning to move the APM app API content to the APM app docs but was just staging everything here to get it correct and see it all in one place :)

@bmorelli25 bmorelli25 marked this pull request as ready for review May 26, 2020 20:06
@bmorelli25 bmorelli25 requested a review from simitt May 26, 2020 20:06
@bmorelli25
Copy link
Member Author

@simitt, I believe this is finally ready for review. Sorry it took so long 😬. I've chosen not to tackle the Metricbeat monitoring role or monitoring writer role changes in this PR. I'll examine these in a follow-up PR.

Copy link
Contributor

@simitt simitt left a comment

Choose a reason for hiding this comment

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

Great changes, really looking forward to getting this in. Thanks for all the work on this.

Only left two minor comments.

+{beat_monitoring_user}+ {ref}/built-in-roles.html[built-in role] to send
monitoring information. You can use the built-in user, if it's available in your
environment, or create a user who has the privileges needed to send monitoring
information.
Copy link
Contributor

Choose a reason for hiding this comment

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

minor note: you don't touch on the beat_monitoring_user role any more. Should we change to something like:

You can use the built-in user, if it's available in your
environment, or create a user which has the built-in role assigned,
or create a user and manually assign the required privileges.
information.

information, and another for viewing it
* <<privileges-to-publish-events,Writer role>>: To publish events collected by {beatname_uc}.
* <<privileges-agent-central-config,Central configuration management role>>: To view, create,
update, and delete APM Agent central configurations.
Copy link
Contributor

Choose a reason for hiding this comment

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

The described role can only read from APM Agent central configurations, since everything else was moved to Kibana.

@bmorelli25 bmorelli25 merged commit ad56c42 into elastic:master May 28, 2020
@bmorelli25 bmorelli25 deleted the update-roles-and-docs branch May 28, 2020 15:17
bmorelli25 added a commit to bmorelli25/apm-server that referenced this pull request May 28, 2020
# Conflicts:
#	docs/copied-from-beats/docs/https.asciidoc
#	docs/copied-from-beats/docs/security/basic-auth.asciidoc
#	docs/copied-from-beats/docs/security/users.asciidoc
bmorelli25 added a commit to bmorelli25/apm-server that referenced this pull request May 28, 2020
# Conflicts:
#	docs/copied-from-beats/docs/https.asciidoc
#	docs/copied-from-beats/docs/security/basic-auth.asciidoc
#	docs/copied-from-beats/docs/security/users.asciidoc
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.

3 participants