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: Clarify anonymous authentication details #10227

Merged
merged 5 commits into from
Mar 24, 2023

Conversation

bmorelli25
Copy link
Member

Summary

The docs should be updated to better reflect that, by default, RUM related auth handling is disabled, but enabled as soon as auth handling is generally enabled.

The goal of this PR is to better clarify when and why anonymous requests to the APM Server are accepted or rejected. Here's the thought process—and please correct me if I'm wrong:

We have two anonymous authentication pages in the docs. One is for the APM integration and one is for standalone APM Server. This PR updates these pages to clarify that the APM Server’s default response to anonymous requests depends on whether an API key or Secret Token has been configured. If and only if an API key or Secret token has been configured, you can enable anonymous authentication in the APM Server to allow the ingestion of unauthenticated client-side APM data while still requiring authentication for server-side services.

In addition to the above pages, the standalone APM Server documentation has a configuration reference for anonymous authentication. Previously, this page stated:

Anonymous authentication must be enabled to collect RUM data. For this reason, anonymous auth will be enabled automatically if apm-server.rum.enabled is set to true, and apm-server.auth.anonymous.enabled is not explicitly defined.

IIUC, this is only true if a secret token or API key has been configured. I've reworked the text on this page to better reflect this.

I think those are the important bits. Have a good weekend 👋

Related

@bmorelli25 bmorelli25 added Team:Docs Label for the Observability docs team backport-8.5 Automated backport with mergify backport-8.6 Automated backport with mergify backport-8.7 Automated backport with mergify labels Feb 10, 2023
@bmorelli25 bmorelli25 requested review from lucabelluccini and a team February 10, 2023 23:48
@bmorelli25 bmorelli25 self-assigned this Feb 10, 2023
@apmmachine
Copy link
Collaborator

apmmachine commented Feb 10, 2023

💚 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 preview

Expand to view the summary

Build stats

  • Start Time: 2023-03-24T00:16:52.318+0000

  • Duration: 12 min 28 sec

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate and publish the docker images.

  • /test windows : Build & tests on Windows.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

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.

Thank you!

Copy link
Contributor

@lucabelluccini lucabelluccini left a comment

Choose a reason for hiding this comment

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

I think the only point which is not clear now is explain what happens if APM Server/Integration allows both api key & secret token.

At least from elastic/apm#183 and from some tests we did: the api key is sent out by the agent if both are configured and so the event should be accepted/allowed

@simitt
Copy link
Contributor

simitt commented Feb 20, 2023

what happens if APM Server/Integration allows both api key & secret token.

The server behaves the same if only the api key or secret token or both are enabled. The differentiator is whether or not any auth is required by enabling at least one of them.

At least from elastic/apm#183 and from some tests we did: the api key is sent out by the agent if both are configured and so the event should be accepted/allowed

I'm not sure I follow; the apm agent will use whatever is configured for the agent (not in the apm-server) - api key, secret token or nothing, and this can be different between apm agents.

@bmorelli25
Copy link
Member Author

To add to Silvia's response, we mention in the docs that

If both API keys and a secret token are enabled, APM agents can choose whichever mechanism they support.

@bmorelli25 bmorelli25 enabled auto-merge (squash) March 12, 2023 21:25
@bmorelli25 bmorelli25 enabled auto-merge (squash) March 23, 2023 23:11
@apmmachine

This comment was marked as off-topic.

@bmorelli25 bmorelli25 enabled auto-merge (squash) March 24, 2023 00:17
@bmorelli25 bmorelli25 merged commit b6c8e12 into elastic:main Mar 24, 2023
mergify bot pushed a commit that referenced this pull request Mar 24, 2023
* docs: anon auth clarifications

* add yml file to trigger full ci

* test

* pls work

* test gpg

(cherry picked from commit b6c8e12)

# Conflicts:
#	docs/legacy/configuration-anonymous.asciidoc
mergify bot pushed a commit that referenced this pull request Mar 24, 2023
* docs: anon auth clarifications

* add yml file to trigger full ci

* test

* pls work

* test gpg

(cherry picked from commit b6c8e12)
mergify bot pushed a commit that referenced this pull request Mar 24, 2023
* docs: anon auth clarifications

* add yml file to trigger full ci

* test

* pls work

* test gpg

(cherry picked from commit b6c8e12)
@bmorelli25
Copy link
Member Author

@Mergifyio backport 8.7

@mergify
Copy link
Contributor

mergify bot commented Mar 24, 2023

backport 8.7

✅ Backports have been created

@bmorelli25
Copy link
Member Author

@Mergifyio backport 8.7

@mergify
Copy link
Contributor

mergify bot commented Mar 24, 2023

backport 8.7

✅ Backports have been created

bmorelli25 added a commit to bmorelli25/apm-server that referenced this pull request Mar 27, 2023
* docs: anon auth clarifications

* add yml file to trigger full ci

* test

* pls work

* test gpg

(cherry picked from commit b6c8e12)
bmorelli25 added a commit to bmorelli25/apm-server that referenced this pull request Mar 27, 2023
* docs: anon auth clarifications

* add yml file to trigger full ci

* test

* pls work

* test gpg

(cherry picked from commit b6c8e12)
bmorelli25 added a commit that referenced this pull request Mar 27, 2023
* docs: anon auth clarifications

* add yml file to trigger full ci

* test

* pls work

* test gpg

(cherry picked from commit b6c8e12)
bmorelli25 added a commit that referenced this pull request Mar 27, 2023
* docs: anon auth clarifications

* add yml file to trigger full ci

* test

* pls work

* test gpg

(cherry picked from commit b6c8e12)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.5 Automated backport with mergify backport-8.6 Automated backport with mergify backport-8.7 Automated backport with mergify Team:Docs Label for the Observability docs team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docs: clarify when auth is enabled/disabled in the anonymous auth guide
4 participants