Commit Graph

39 Commits

Author SHA1 Message Date
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
Bruno Quaresma 80f042f01b feat: Add icon to templates (#3561) 2022-08-19 13:17:35 +00:00
Jon Ayers c3eea98db0 fix: use unique ID for linked accounts (#3441)
- move OAuth-related fields off of api_keys into a new user_links table
- restrict users to single form of login
- process updates to user email/usernames for OIDC
- added a login_type column to users
2022-08-17 18:00:53 -05:00
Ammar Bandukwala 19fcf60864 ci: add typo detection (#3327)
And fix them.
2022-08-01 09:29:52 -04:00
Abhineet Jain d04ba2cc02 feat: add template version creator (#3001) 2022-07-15 14:12:39 -07:00
Colin Adler 680e24a14b Revert "feat: add template version creator (#2991)" (#2999)
This reverts commit aea3b3b83e.
2022-07-14 21:57:42 +00:00
Abhineet Jain aea3b3b83e feat: add template version creator (#2991) 2022-07-14 20:44:33 +00:00
Abhineet Jain a91482cb25 fix: populate default created_by and add not-null constraint in templates (#2290) 2022-06-13 17:25:06 +00:00
Abhineet Jain 02d2aea7f2 feat: store and display template creator (#2228)
* design commit

* add owner_id to templates table

* add owner information in apis and ui

* update minWidth for statItem

* rename owner to created_by

* missing refactor to created_by

* handle errors in fetching created_by names
2022-06-10 19:24:21 +00:00
Cian Johnston 3e419ddb3d feat: enforce template-level constraints for TTL and autostart (#2018)
This PR adds fields to templates that constrain values for workspaces derived from that template.

- Autostop: Adds a field max_ttl on the template which limits the maximum value of ttl on all workspaces derived from that template. Defaulting to 168 hours, enforced on edits to workspace metadata. New workspaces will default to the templates's `max_ttl` if not specified.
- Autostart: Adds a field min_autostart_duration which limits the minimum duration between successive autostarts of a template, measured from a single reference time. Defaulting to 1 hour, enforced on edits to workspace metadata.
2022-06-07 13:37:45 +01:00
Mathias Fredriksson 608eb322a8 chore: Add .editorconfig, shfmt, shellcheck and subshell dir changes (#1649) 2022-05-27 20:15:19 +03:00
Cian Johnston d72c45e483 refactor: workspace autostop_schedule -> ttl (#1578)
Co-authored-by: G r e y <grey@coder.com>
2022-05-19 15:09:27 -04:00
Colin Adler 98ccd0eb89 feat: add README parsing to template versions (#1500) 2022-05-17 15:00:48 -05:00
Colin Adler e925818526 feat: add template description (#1489) 2022-05-16 20:56:11 +00:00
Colin Adler e990a9ac28 feat: add audit diffing for all user editable types (#1413) 2022-05-16 11:20:11 -05:00
Colin Adler f816bbe801 feat: add codegen for audit.AuditableResources entries (#1370) 2022-05-10 21:27:45 +00:00
Colin Adler 97a95f1377 chore: upgrade golangci-lint to v1.46.0 (#1373) 2022-05-10 16:04:23 -05:00
Colin Adler 20caee1502 feat: add audit exporting and filtering (#1314) 2022-05-09 22:05:01 +00:00
Steven Masley 35211e2190 feat: Add user roles, but do not yet enforce them (#1200)
* chore: Rework roles to be expandable by name alone
2022-04-29 09:04:19 -05:00
Bruno Quaresma 441ffd6a0b feat: add PUT /api/v2/users/:user-id/suspend endpoint (#1154) 2022-04-26 09:00:07 -05:00
Colin Adler 2a57ea757a feat: add audit package (#1046) 2022-04-25 18:57:59 +00:00