Fix dynamic labels not being present on server access audit events#32326
Merged
gabrielcorado merged 1 commit intomasterfrom Sep 22, 2023
Merged
Fix dynamic labels not being present on server access audit events#32326gabrielcorado merged 1 commit intomasterfrom
gabrielcorado merged 1 commit intomasterfrom
Conversation
zmb3
approved these changes
Sep 21, 2023
ryanclark
approved these changes
Sep 22, 2023
|
@gabrielcorado See the table below for backport results.
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The SSH session uses the
TargetMetadatafunction to grab server metadata which is then used on audit logging. The issue was that this function only used the labels available atSetLabels(as it relied on thes.labelsattribute).This PR updates it to use a combination of static and dynamic labels (similar to the
GetAllLabelsfunction from resources).Audit logs example
SSH service configuration:
Before:
After:
{ "addr.local": "127.0.0.1:4443", "addr.remote": "127.0.0.1:50162", "cluster_name": "root.teleport.dev", "code": "T2000I", "ei": 0, "event": "session.start", "initial_command": [ "" ], "login": "gabrielcorado", "namespace": "default", "proto": "ssh", "server_addr": "[::]:3022", "server_hostname": "root.teleport.dev", "server_id": "b51ef330-73dd-4719-b8aa-8fb0c1c2dd65", + "server_labels": { + "OS": "Darwin" + }, "session_recording": "node", "sid": "46f82471-b834-41a9-a50b-6ee326a692af", "size": "141:22", "time": "2023-09-21T15:50:32.784Z", "uid": "5827ab06-f793-4fae-b680-b067aa02f1f0", "user": "alice" }