Skip to content

Emit an Audit log event when a Bot or Instance fails to join#40329

Merged
strideynet merged 9 commits intomasterfrom
strideynet/audit-join-failures
Apr 23, 2024
Merged

Emit an Audit log event when a Bot or Instance fails to join#40329
strideynet merged 9 commits intomasterfrom
strideynet/audit-join-failures

Conversation

@strideynet
Copy link
Copy Markdown
Contributor

@strideynet strideynet commented Apr 8, 2024

Currently, a failed join is not audit logged or even logged. This makes it really hard to determine why a join failed or to detect a malicious join attempt. This PR introduces an audit log event which is emitted when a join fails for any reason.

For join methods that support returning the attributes of the joining identity, these will also show in the audit log. Not all join methods support this yet, and we ought to return to those and add the appropriate methods so they do surface this information which is extremely useful in diagnosing problems with joining and allow rules.

image

image

changelog: Adds a new Audit log event that is emitted when an Agent or Bot request to join the cluster is denied.

Closes #17948

@strideynet strideynet marked this pull request as ready for review April 9, 2024 10:00
@github-actions github-actions Bot added audit-log Issues related to Teleports Audit Log size/md ui labels Apr 9, 2024
@github-actions github-actions Bot requested review from avatus and ibeckermayer April 9, 2024 10:01
Comment thread lib/auth/join.go Outdated
Comment thread lib/auth/join.go
Comment thread lib/events/codes.go Outdated
Comment thread lib/auth/join.go Outdated
@strideynet strideynet requested a review from ibeckermayer April 22, 2024 13:03
@strideynet strideynet added this pull request to the merge queue Apr 22, 2024
@rosstimothy
Copy link
Copy Markdown
Contributor

rosstimothy commented Apr 22, 2024

Currently, a failed join is not audit logged or even logged.

#40729 added some logging for failed join attempts. Are we now going to log things twice? Does this take any of those changes into account?

@strideynet strideynet removed this pull request from the merge queue due to a manual request Apr 22, 2024
@strideynet
Copy link
Copy Markdown
Contributor Author

@rosstimothy

#40729 added some logging for failed login attempts. Are we now going to log things twice? Does this take any of those changes into account?

I've already resolved the conflicts with this PR, I've removed those log lines in favour of my ones, and added any details that were missing from mine. I feel it still makes sense to move ahead with my PR since 40729 did not add an audit log event, and for our cloud customers, they do not have access to the logs of Teleport. The audit log is therefore the only way we can provide feedback about misconfigured joins.

I'll hold off merging until you've had a chance to see/respond to this :)

@strideynet strideynet added this pull request to the merge queue Apr 22, 2024
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 22, 2024
@strideynet strideynet added this pull request to the merge queue Apr 22, 2024
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 22, 2024
@strideynet strideynet added this pull request to the merge queue Apr 23, 2024
Merged via the queue into master with commit cea1425 Apr 23, 2024
@strideynet strideynet deleted the strideynet/audit-join-failures branch April 23, 2024 08:42
@public-teleport-github-review-bot
Copy link
Copy Markdown

@strideynet See the table below for backport results.

Branch Result
branch/v13 Failed
branch/v14 Failed
branch/v15 Failed

strideynet added a commit that referenced this pull request Apr 23, 2024
* Emit audit event on instance/bot join failure

* Add audit log on failure to azure and iam join methods

* Tidy up a lil bit

* Add missing icon to EventTypeCell.tsx

* Regenerate snapshot

* Correct status code

* Add host_id and node_name to the join audit log

* Remove "unknown" default values
strideynet added a commit that referenced this pull request Apr 23, 2024
* Emit audit event on instance/bot join failure

* Add audit log on failure to azure and iam join methods

* Tidy up a lil bit

* Add missing icon to EventTypeCell.tsx

* Regenerate snapshot

* Correct status code

* Add host_id and node_name to the join audit log

* Remove "unknown" default values
strideynet added a commit that referenced this pull request Apr 23, 2024
* Emit audit event on instance/bot join failure

* Add audit log on failure to azure and iam join methods

* Tidy up a lil bit

* Add missing icon to EventTypeCell.tsx

* Regenerate snapshot

* Correct status code

* Add host_id and node_name to the join audit log

* Remove "unknown" default values
github-merge-queue Bot pushed a commit that referenced this pull request Apr 23, 2024
…40329) (#40814)

* Emit an Audit log event when a Bot or Instance fails to join (#40329)

* Emit audit event on instance/bot join failure

* Add audit log on failure to azure and iam join methods

* Tidy up a lil bit

* Add missing icon to EventTypeCell.tsx

* Regenerate snapshot

* Correct status code

* Add host_id and node_name to the join audit log

* Remove "unknown" default values

* Fix broken snapshots
github-merge-queue Bot pushed a commit that referenced this pull request Apr 23, 2024
…40329) (#40816)

* Emit an Audit log event when a Bot or Instance fails to join (#40329)

* Emit audit event on instance/bot join failure

* Add audit log on failure to azure and iam join methods

* Tidy up a lil bit

* Add missing icon to EventTypeCell.tsx

* Regenerate snapshot

* Correct status code

* Add host_id and node_name to the join audit log

* Remove "unknown" default values

* Fix badly generatd snapshots
github-merge-queue Bot pushed a commit that referenced this pull request Apr 23, 2024
…40329) (#40815)

* Emit an Audit log event when a Bot or Instance fails to join (#40329)

* Emit audit event on instance/bot join failure

* Add audit log on failure to azure and iam join methods

* Tidy up a lil bit

* Add missing icon to EventTypeCell.tsx

* Regenerate snapshot

* Correct status code

* Add host_id and node_name to the join audit log

* Remove "unknown" default values

* fix backport

* Regenerate bad snapshot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

audit-log Issues related to Teleports Audit Log size/md ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Delegated Joining (GitHub & CircleCI) should be clearer about what claim did not match

5 participants