-
Notifications
You must be signed in to change notification settings - Fork 148
docs/security-and-lb: illustrate topologies with images #1474
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
Open
hagen1778
wants to merge
4
commits into
master
Choose a base branch
from
docs-auth-lb-images
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file added
BIN
+65.5 KB
docs/victorialogs/security-and-lb-access-control-inside-a-single-tenant.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+76.8 KB
docs/victorialogs/security-and-lb-proxying-requests-to-the-given-tenants.webp
|
hagen1778 marked this conversation as resolved.
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,6 +61,9 @@ users: | |
|
|
||
| This config instructs `vmauth` accepting requests for the Basic Auth user `foo` with the password `bar`. | ||
|
|
||
|  | ||
| {width="600"} | ||
|
|
||
| Successfully authenticated requests are proxied (load balanced) to one of the VictoriaLogs instances specified in the `url_prefix` list, | ||
| if these requests match the `src_paths` regexp, i.e. if they start with `/select/` path prefix. | ||
| See [these docs](https://docs.victoriametrics.com/victoriametrics/vmauth/#routing-by-path) for details about the `src_path`. | ||
|
|
@@ -97,6 +100,9 @@ and requests with the path prefix `/hot/select/` to the backend at `http://victo | |
| The backends can be either single-node instances of VictoriaLogs or `vmauth` in front of `vlselect` nodes in [VictoriaLogs cluster](https://docs.victoriametrics.com/victorialogs/cluster/). | ||
| See [how to set up `vmauth` in front on multiple `vlselect` nodes](https://docs.victoriametrics.com/victorialogs/security-and-lb/#search-authorization). | ||
|
|
||
|  | ||
| {width="600"} | ||
|
|
||
| This approach is useful when applying different retention policies for various types of logs. | ||
| For example, you might store warn-level and higher severity logs in the cold instance/cluster with longer retention, | ||
| while keeping debug-level and lower severity logs only in the hot instance/cluster with shorter retention. | ||
|
|
@@ -140,6 +146,9 @@ unauthorized_user: | |
| This allows building a VictoriaLogs storage system with distinct per-tenant retention configs | ||
| similar to [this one](https://github.com/VictoriaMetrics/VictoriaLogs/issues/15#issuecomment-3043557052). | ||
|
|
||
|  | ||
| {width="600"} | ||
|
|
||
| See [these docs](https://docs.victoriametrics.com/victoriametrics/vmauth/#routing-by-header) on how to setup request routing in `vmauth` by request headers. | ||
| See [these docs](https://docs.victoriametrics.com/victoriametrics/vmauth/#modifying-http-headers) on how to modify request headers before proxying the requests to backends. | ||
|
|
||
|
|
@@ -208,6 +217,8 @@ users: | |
| This configuration allows user `foo` to access 3 different tenants, and user `admin` to access all tenants. | ||
| The user `admin` needs to set the required `AccountID` or `ProjectID` headers, because `vmauth` doesn't set them. | ||
|
|
||
|  | ||
|
|
||
| In Grafana you need to create a separate data source for each tenant and user, an example of such an address is: `http://vmauth:8427/my-account/mobile-logs/`. | ||
| Using the configuration above, you do not need to set the tenant in the Grafana data source settings because `vmauth` overrides it to `AccountID: 1`, `ProjectID: 6`. | ||
| Each tenant exposes [`vmui`](https://docs.victoriametrics.com/victorialogs/querying/#web-ui) at `/select/vmui/`, for example: `http://vmauth:8427/my-account/mobile-logs/select/vmui/`. | ||
|
|
@@ -294,6 +305,8 @@ users: | |
| `extra_filters` and `extra_stream_filters` should be [percent-encoded](https://en.wikipedia.org/wiki/Percent-encoding) when they include characters that are not URL-safe. | ||
| For example, the query `_stream:{service=frontend-logs}` should be written as `_stream%3A%7Bservice%3Dfrontend-logs%7D`. | ||
|
|
||
|  | ||
|
|
||
| Prefer using `extra_stream_filters` over `extra_filters` whenever possible. | ||
| See [LogsQL performance optimization tips](https://docs.victoriametrics.com/victorialogs/logsql/#performance-tips). | ||
|
|
||
|
|
@@ -364,7 +377,7 @@ users: | |
|
|
||
| Below is a diagram of this configuration: | ||
|
|
||
|  | ||
|  | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This diagram shows a tenant assignment based on request path. But the config above assigns a tenant based on Basic auth credentials. |
||
| {width="600"} | ||
|
|
||
| See [how to override http request headers before proxying the requests to backends](https://docs.victoriametrics.com/victoriametrics/vmauth/#modifying-http-headers). | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure that every user will understand curl flags like
-uand-H? 😁Probably it is better to just use username, without password and route details, like:
I think the config above this diagram makes the details clear enough. The diagram itself should just show high-level routing without the extra details
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change the text as suggested and we can see how it looks. If we're not convinced we can change it further.