Grafana OnCall engine fork — self-hosted on-call scheduler and alert router
Find a file
Joey Orlando 9e598385f4
Add RBAC Support (#777)
* Modify plugin.json to support RBAC role registration

* defines 26 new custom roles in plugin.json. The main roles are:

- Admin: read/write access to everything in OnCall
- Reader: read access to everything in OnCall
- OnCaller : read access to everything in OnCall + edit access to Alert Groups and Schedules
- <object-type> Editor: read/write access to everything related to <object-type>
- <object-type> Reader: read access for <object-type>
- User Settings Admin: read/write access to all user's settings, not just own settings. This is in comparison to User Settings Editor which can only read/write own settings

* update changelog and documentation (#686)

* implement RBAC for OnCall backend

This commit refactors backend authorization. It trys to use RBAC authorization if the org's grafana instance supports it, otherwise it falls back to basic role authorization.

* update RBAC backend tests

* add tests for RBAC changes
- run backend tests as matrix where RBAC is enabled/disabled. When RBAC is enabled, the permissions granted are read from the role grants in the frontend's plugin.json file (instead of relying what we specify in RBACPermission.Permissions)
- remove --reuse-db --nomigrations flags from engine/tox.ini
- minor autoformatting changes to docker-compose-developer.yml

* remove --ds=settings.ci-test from pytest CI command

DJANGO_SETTINGS_MODULE is already specified as an env var so this is just unecessary duplication

* update gitignore

* update github action job name for "test"

* RBAC frontend changes

* refactors the use of basic roles (ex. Viewer, Editor, Admin) use RBAC permissions (when supported), or falling back to basic roles when RBAC is not supported.

- updates the UserAction enum in grafana-plugin/src/state/userAction.ts. Previously this was hardcoded to a list of strings that were being returned by the OnCall API. Now the values here correspond to the permissions in plugin.json (plus a fallback role)

* changes per Gabriel's comments:
- get rid of group attribute in rbac roles
- remove displayName role attribute
- remove hidden role attribute
- add back role to includes section

* don't try to update user timezone if they don't have permission
2022-11-29 09:41:56 +01:00
.github Add RBAC Support (#777) 2022-11-29 09:41:56 +01:00
dev Add flag to debug logs (#912) 2022-11-29 11:16:42 +08:00
docs One startup command to rule them all (#760) 2022-11-07 16:34:43 +01:00
engine Add RBAC Support (#777) 2022-11-29 09:41:56 +01:00
examples/terraform Terraform examples 2022-08-11 14:32:39 +05:00
grafana-plugin Add RBAC Support (#777) 2022-11-29 09:41:56 +01:00
helm Merge pull request #883 from grafana/dev 2022-11-22 18:36:17 +00:00
tools PD migrator: add support for email notifications (#839) 2022-11-11 13:40:43 +00:00
.drone.yml Update .drone.yml signature 2022-11-09 14:53:35 -03:00
.gitignore enterprise dev changes + few other small changes (#802) 2022-11-09 07:21:33 +01:00
.nvmrc One startup command to rule them all (#760) 2022-11-07 16:34:43 +01:00
.pre-commit-config.yaml [UI] fix eslint/prettier warnings (#678) 2022-10-24 20:27:03 +08:00
CHANGELOG.md Add RBAC Support (#777) 2022-11-29 09:41:56 +01:00
CODE_OF_CONDUCT.md Updated GOVERNANCE, added Code Of Conduct 2022-06-06 21:54:15 +03:00
docker-compose-developer.yml Add RBAC Support (#777) 2022-11-29 09:41:56 +01:00
docker-compose-mysql-rabbitmq.yml Get rid of installation token + add a bunch of tests (#624) 2022-11-21 16:26:00 +01:00
docker-compose.yml Get rid of installation token + add a bunch of tests (#624) 2022-11-21 16:26:00 +01:00
GOVERNANCE.md Minor README and GOVERNANCE updates 2022-06-13 17:31:32 -03:00
LICENSE World, meet OnCall! 2022-06-03 08:09:47 -06:00
LICENSING.md Making LICENSING.md more explicit 2022-06-03 16:21:26 +02:00
MAINTAINERS.md Update maintainers.md 2022-06-22 15:04:21 -07:00
Makefile remove hostess tool + add extra_hosts entry to oncall backend containers 2022-11-23 19:31:26 +01:00
README.md Get rid of installation token + add a bunch of tests (#624) 2022-11-21 16:26:00 +01:00
screenshot.png Merge dev to main (#54) 2022-06-13 16:39:58 -06:00
SECURITY.md World, meet OnCall! 2022-06-03 08:09:47 -06:00

Latest Release License Docker Pulls Slack Discussion Build Status

Developer-friendly incident response with brilliant Slack integration.

  • Collect and analyze alerts from multiple monitoring systems
  • On-call rotations based on schedules
  • Automatic escalations
  • Phone calls, SMS, Slack, Telegram notifications

Getting Started

We prepared multiple environments:

  1. Download docker-compose.yml:
curl -fsSL https://raw.githubusercontent.com/grafana/oncall/dev/docker-compose.yml -o docker-compose.yml
  1. Set variables:
echo "DOMAIN=http://localhost:8080
COMPOSE_PROFILES=with_grafana  # Remove this line if you want to use existing grafana
SECRET_KEY=my_random_secret_must_be_more_than_32_characters_long" > .env
  1. Launch services:
docker-compose up -d
  1. Go to OnCall Plugin Configuration, using log in credentials as defined above: admin/admin (or find OnCall plugin in configuration->plugins) and connect OnCall plugin with OnCall backend:
OnCall backend URL: http://engine:8080
  1. Enjoy! Check our OSS docs if you want to set up Slack, Telegram, Twilio or SMS/calls through Grafana Cloud.

Update version

To update your Grafana OnCall hobby environment:

# Update Docker image
docker-compose pull engine

# Re-deploy
docker-compose up -d

After updating the engine, you'll also need to click the "Update" button on the plugin version page. See Grafana docs for more info on updating Grafana plugins.

Join community

Stargazers over time

Stargazers over time

Further Reading