- Notifications
You must be signed in to change notification settings - Fork948
docs: improve audit logs copy#18807
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
56 changes: 28 additions & 28 deletionsdocs/admin/security/audit-logs.md
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 |
---|---|---|
@@ -1,6 +1,11 @@ | ||
#Audit Logs | ||
**Audit Logs** allows Auditors to monitor user operations in their deployment. | ||
>[!NOTE] | ||
>Audit logs require a | ||
>[Premium license](https://coder.com/pricing#compare-plans). | ||
>For more details,[contact your account team](https://coder.com/contact). | ||
##Tracked Events | ||
@@ -36,47 +41,43 @@ We track the following resources: | ||
<!-- End generated by 'make docs/admin/security/audit-logs.md'.--> | ||
##How to Filter Audit Logs | ||
ethanndickson marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
You can filter audit logs by the following parameters: | ||
-`resource_type` - The type of the resource, such as a workspace, template, | ||
or user. For more resource types, refer to the | ||
[CoderSDK package documentation](https://pkg.go.dev/github.com/coder/coder/v2/codersdk#ResourceType). | ||
-`resource_id` - The ID of the resource. | ||
-`resource_target` - The name of the resource. Can be used instead of | ||
`resource_id`. | ||
-`action`- The action applied to a resource, such as`create` or`delete`. | ||
For more actions, refer to the | ||
[CoderSDK package documentation](https://pkg.go.dev/github.com/coder/coder/v2/codersdk#AuditAction). | ||
-`username` - The username of the user who triggered the action. You can also | ||
use`me` as a convenient alias for the logged-in user. | ||
-`email` - The email of the user who triggered the action. | ||
-`date_from` - The inclusive start date with format`YYYY-MM-DD`. | ||
-`date_to` - The inclusive end date with format`YYYY-MM-DD`. | ||
-`build_reason` - The reason for the workspace build, if`resource_type` is | ||
`workspace_build`. Refer to the | ||
[CoderSDK package documentation](https://pkg.go.dev/github.com/coder/coder/v2/codersdk#BuildReason) | ||
for a list of valid build reasons. | ||
##Capturing/Exporting Audit Logs | ||
In addition to theCoder dashboard, there are multiple ways to consume or query | ||
audit trails. | ||
###REST API | ||
You can retrieve audit logs via the Coder API. | ||
Visit the | ||
[`get-audit-logs` endpoint documentation](../../reference/api/audit.md#get-audit-logs) | ||
for details. | ||
###Service Logs | ||
Audit trails are also dispatched as service logs and can be captured and | ||
categorized using any log management tool such as[Splunk](https://splunk.com). | ||
@@ -124,7 +125,6 @@ log entry: | ||
2023-06-13 03:43:29.233 [info] coderd: audit_log ID=95f7c392-da3e-480c-a579-8909f145fbe2 Time="2023-06-13T03:43:29.230422Z" UserID=6c405053-27e3-484a-9ad7-bcb64e7bfde6 OrganizationID=00000000-0000-0000-0000-000000000000 Ip=<nil> UserAgent=<nil> ResourceType=workspace_build ResourceID=988ae133-5b73-41e3-a55e-e1e9d3ef0b66 ResourceTarget="" Action=start Diff="{}" StatusCode=200 AdditionalFields="{\"workspace_name\":\"linux-container\",\"build_number\":\"7\",\"build_reason\":\"initiator\",\"workspace_owner\":\"\"}" RequestID=9682b1b5-7b9f-4bf2-9a39-9463f8e41cd6 ResourceIcon="" | ||
``` | ||
##How to Enable Audit Logs | ||
This feature is only available with a[Premium license](../licensing/index.md). |
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
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.