Commit Graph

70 Commits

Author SHA1 Message Date
coryb d82f2fd416
fix: update typo in audit log field (#12907) 2024-04-08 13:57:38 -05:00
Jon Ayers 951dfaa99c
feat: add workspace_id to workspace_build audit logs (#12718) 2024-03-22 15:10:32 -05:00
Asher f74532ff50
feat: audit oauth2 app management (#12275)
* Audit oauth2 app management
* Use 201 for creating secrets
2024-02-26 23:52:08 +00:00
Steven Masley f44c89d200
chore: enforce orgid in audit logs where required (#12283)
* chore: enforce orgid in audit logs where required
2024-02-26 08:27:33 -06:00
Cian Johnston 197cd935cf
chore(Makefile): use linter version from dogfood Dockerfile (#11147)
* chore(Makefile): use golangci-lint version from dogfood Dockerfile

* chore(dogfood/Dockerfile): update golangci-lint to latest version

* chore(coderd): address linter complaints
2023-12-12 10:02:32 +00:00
Jon Ayers ce49a55f56
chore: update build_reason 'autolock' -> 'dormancy' (#11074) 2023-12-07 17:11:57 -06:00
Marcin Tojek 19b6d194fc
feat: manage health settings using Coder API (#10861) 2023-11-28 18:15:17 +01:00
Cian Johnston 26c3c1226e
chore(coderd): add MockAuditor.Contains test helper (#10421)
* Adds a Contains() method on MockAuditor to help with asserting the presence of an audit log with specific fields.
* Updates existing usages of verifyAuditWorkspaceCreated to use the new helper
* Updates test referenced in PR#10396.
2023-11-06 09:17:07 +00:00
Colin Adler 1ad998ee3a
fix: add requester IP to workspace build audit logs (#10242) 2023-10-18 15:08:02 -05:00
Steven Masley 9e845213f5
chore: include organization id in workspace build audit log (#9905)
* chore: include organization id in workspace build audit log
* rename 'BuildAudit' to 'WorkspaceBuildAudit'
2023-09-28 11:29:12 -05:00
Mathias Fredriksson 19d7da3d24
refactor(coderd/database): split `Time` and `Now` into `dbtime` package (#9482)
Ref: #9380
2023-09-01 16:50:12 +00:00
Colin Adler 796a9754a9
feat(enterprise/audit): add user object to slog exporter (#9456) 2023-08-31 13:32:28 -05:00
Kyle Carberry 22e781eced
chore: add /v2 to import module path (#9072)
* chore: add /v2 to import module path

go mod requires semantic versioning with versions greater than 1.x

This was a mechanical update by running:
```
go install github.com/marwan-at-work/mod/cmd/mod@latest
mod upgrade
```

Migrate generated files to import /v2

* Fix gen
2023-08-18 18:55:43 +00:00
Muhammad Atif Ali ce114a7f9f
chore: upgrade sqlc to 1.19.1 (#8511) 2023-07-15 09:07:19 +03:00
Steven Masley b5f26d9bdf
feat: add ability for users to convert their password login type to oauth/github login (#8105)
* Currently toggled by experiment flag

---------

Co-authored-by: Bruno Quaresma <bruno@coder.com>
2023-06-30 08:38:48 -04:00
Steven Masley 3619a3a6dd
feat: add disabling of default 'everyone' group access to template (#7982)
* feat: add disabling of default 'everyone' group access to template
* add FE to disable everyone group
* require entitlement to uncheck box
2023-06-14 11:08:58 -05:00
Kira Pilot f6c89a2615
feat: differentiate new user registration from user login in the audit log (#7096)
* auditing register events

* fix tests

* update docs

* update comments

* Update coderd/audit/request.go

Co-authored-by: Colin Adler <colin1adler@gmail.com>

---------

Co-authored-by: Colin Adler <colin1adler@gmail.com>
2023-04-12 11:46:16 -07:00
Steven Masley b2892c3d17
test: Increase test coverage on auditable resources (#7038)
* test: Increase test coverage on auditable resources

When adding a new audit resource, we also need to add it to the
function switch statements. This is a likely mistake, now a unit
test will check this for you
2023-04-06 16:16:53 -05:00
Steven Masley b4afbe7720
feat: Implement experiment gated CRUD for workspace proxies (#6928)
* feat: Implement basic moon crud
* chore: Implement enterprise endpoints for moons
2023-04-04 15:07:29 -05:00
Kyle Carberry a63c97b8de
chore: wrap audit logs in a mutex to fix data race (#6898)
This was seen in `main`!
2023-03-30 12:13:03 -05:00
Kira Pilot 25e92fd2f4
fix(audit): audit login/logout for new 3rd-party auth (#6733)
* fix(audit): audit login/logout for new 3rd-party auth

* no longer auditing unknown users
2023-03-22 12:52:13 -07:00
Kira Pilot 090e37fc46
feat(audit): auditing token addition and removal (#6649)
* auditing tokens

* adding diffs for token auditing

* added test

* generating docs

* auditing owner field
2023-03-17 10:41:44 -07:00
Kyle Carberry 7eb2c2ff6d
Revert "chore: Implement joins with golang templates (#6429)" (#6560)
This reverts commit 8b125d6c5d.
2023-03-10 10:39:02 -06:00
Steven Masley 8b125d6c5d
chore: Implement joins with golang templates (#6429)
* feat: Implement view for workspace builds to include rbac info

* Removes the need to fetch the workspace to run an rbac check.
* chore: Use workspace build as RBAC object
* chore: Use golang templates instead of sqlc files
2023-03-10 09:44:38 -06:00
Ammar Bandukwala f05609b4da
chore: format Go more aggressively 2023-02-18 18:32:09 -06:00
Kira Pilot 5e60879fb8
feat: audit addition and removal of licenses (#6125)
* added license audit resource

* audit delete licenses

* added filtering

* remove logs

* making the best of the current UUID situation

* fixed lint

* fix tests

* regen docs

* PR feedback

* PR feedback
2023-02-14 16:34:13 -05:00
Kira Pilot 46fe59f5e7
feat: audit login (#5925)
* added migration for api key resource

* sort of working

* auditing login

* passing  the correct user id

* added and fixed tests

* gen documentation

* formatting and lint

* lint

* audit Github oauth and write tests

* audit oauth and write  tests

* added defer fn for login error auditing

* fixed test

* feat: audit logout (#5998)

* Update coderd/userauth.go

Co-authored-by: Steven Masley <Emyrk@users.noreply.github.com>

* fix test

* bypassing diff generation if login/logout

* lint

---------

Co-authored-by: Steven Masley <Emyrk@users.noreply.github.com>
2023-02-06 15:12:50 -05:00
Kira Pilot b31b0fd189
fix: audit log broken build links (#5895)
* pushing for guidance

* added test

* PR feedback

* fixed tests

* Update coderd/audit.go

Co-authored-by: Steven Masley <Emyrk@users.noreply.github.com>

* runnig make gen

---------

Co-authored-by: Steven Masley <Emyrk@users.noreply.github.com>
2023-01-30 18:43:29 +00:00
Kira Pilot 3d58e6912a
chore: removing unaudited resources (#5885)
* chore: removing unaudited resources

* cleaned up tests

* CI errors
2023-01-26 18:14:09 -05:00
Kira Pilot 1213162163
feat: adding template version id to workspace build diff (#5841)
* adding template-version-id to build diff

* fix tests
2023-01-24 10:53:04 -05:00
Kira Pilot 6b68fbbf18
feat: Auditing group members as part of group resource (#5730)
* added AuditableGroup type

* added json tags

* Anonymizing gGroup struct

* adding support on the FE for nested group diffs

* added type for GroupMember

* Update coderd/database/modelmethods.go

Co-authored-by: Steven Masley <Emyrk@users.noreply.github.com>

* Update coderd/database/modelmethods.go

Co-authored-by: Steven Masley <Emyrk@users.noreply.github.com>

* fetching group members in group.delete

* passing through right error

* broke out into util function and added tests

Co-authored-by: Steven Masley <Emyrk@users.noreply.github.com>
2023-01-18 15:13:39 -05:00
Steven Masley 5e540e3439
chore: Log out the failed audit log on failures (#5561) 2023-01-03 17:22:57 -06:00
Kyle Carberry 2a73362026
fix: add mutex to MockAuditor export to prevent race (#5189)
See: https://github.com/coder/coder/actions/runs/3575201153/jobs/6011435900.
2022-11-30 16:25:30 +00:00
Kira Pilot 6786ca2854
Audit build outcomes/kira pilot (#5143)
* auditing failed builds

* logging workspace build successes

* remove duplicate workspace build entry

* fixed workspacebuilds_test

* PR feedback

* lint and migrations

* fix nil auditors

* workspace_build test

* fixed workspaces_teest

Co-authored-by: Colin Adler <colin1adler@gmail.com>
2022-11-22 13:22:56 -05:00
Kira Pilot 8282e46813
chore: add audit log tests (#4764)
* added test for stopping a workspace build

* formatted sfriendly string; added tests

* logging unmarshal error in auditLogDescription

* prettier

* got rid of extra workspace word

* PR feedback

* fixed mistake; wrote tests in penance

* fix be
2022-10-27 15:57:41 -04:00
Kira Pilot 3c5e292c5a
feat: add workspace build start/stop to audit log (#4744)
* adding workspace_build resource

* added migration

* fix keyword

* got rid oof diffs for workspace builds

* adding workspace name to string

* renamed migrations

* fixed lint

* pass throough AdditionalFields and fix tests

* no need to pass through each handler

* cleaned up migrations

* generated types; fixed missing cases

* logging error
2022-10-25 15:34:48 -04:00
Kyle Carberry 7d04bf2abe
Revert "adding workspace_build resource (#4636)" (#4742)
This reverts commit 145faf4400.
2022-10-25 08:41:00 -05:00
Kira Pilot 145faf4400
adding workspace_build resource (#4636)
* adding workspace_build resource

* added migration

* added migration for audit_actions

* fix keyword

* got rid oof diffs for workspace builds

* adding workspace name to string

* renamed migrations

* fixed lint

* pass throough AdditionalFields and fix tests

* no need to pass through each handler

* cleaned up migrations
2022-10-25 09:27:50 -04:00
Kyle Carberry f75a54cd1e
feat: Support x-forwarded-for headers for IPs (#4684)
* feat: Support x-forwarded-for headers for IPs

Fixes #4430.

* Fix realip accepting headers

* Fix unused headers
2022-10-23 13:21:49 -05:00
Jon Ayers 0d1096da6c
feat: add auditing for groups (#4527)
- Clean up `database.TemplateACL` implementation.
2022-10-19 02:00:45 -05:00
Kira Pilot dd8ebf10db
fix: duplicate workspace update entries (#4513)
* fix: duplicate workspace update entries

* remove console log

* attempting to fix tests

* keep diffs with 0 changes

* cleaned up test
2022-10-14 14:39:20 -04:00
Colin Adler 6d2b7ea3ba
fix(audit): only generate diff on request success (#4253) 2022-09-28 17:28:33 -05:00
Kyle Carberry db0ba8588e
chore: Refactor Enterprise code to layer on top of AGPL (#4034)
* chore: Refactor Enterprise code to layer on top of AGPL

This is an experiment to invert the import order of the Enterprise
code to layer on top of AGPL.

* Fix Garrett's comments

* Add pointer.Handle to atomically obtain references

This uses a context to ensure the same value persists through
multiple executions to `Load()`.

* Remove entitlements API from AGPL coderd

* Remove AGPL Coder entitlements endpoint test

* Fix warnings output

* Add command-line flag to toggle audit logging

* Fix hasLicense being set

* Remove features interface

* Fix audit logging default

* Add bash as a dependency

* Add comment

* Add tests for resync and pubsub, and add back previous exp backoff retry

* Separate authz code again

* Add pointer loading example from comment

* Fix duplicate test, remove pointer.Handle

* Fix expired license

* Add entitlements struct

* Fix context passing
2022-09-19 23:11:01 -05:00
Colin Adler b340634aaa
feat: add rbac tracing (#4093) 2022-09-16 18:32:15 +00:00
Colin Adler 4e26e325a6
feat: add auditing to user routes (#3961) 2022-09-08 21:16:16 -05:00
Colin Adler 762063ed8f
fix: add `avatar_url` to user object in audit log response (#3939) 2022-09-07 19:22:04 +00:00
Colin Adler ff0aa8d742
feat: add unique ids to all HTTP requests (#3845) 2022-09-02 13:04:29 -05:00
Colin Adler 55c13c8ff9
chore: fully implement enterprise audit pkg (#3821) 2022-09-02 16:42:28 +00:00
Colin Adler 00da01fdf7
chore: rearrange audit logging code into enterprise folder (#3741) 2022-08-31 21:12:54 +00:00
Kyle Carberry b0fe9bcdd1
chore: Upgrade to Go 1.19 (#3617)
This is required as part of #3505.
2022-08-21 22:32:53 +00:00