https://MY_ENV.MY_ORG.startree.cloud/auth/swagger-ui/index.html
.
Authorization policies have 4 important fields:
policyType
- This can be either ALLOW or DENY.namespaceSrn
- The namespace that this policy applies to.priority
- Policies are sorted in ascending order by priority. Smaller numbers take priority over higher numbers.rule
- The rule to match resources and users for this policy. This is where most of the action happens.^[a-z0-9-_]+$
.
Example SRN for an Alert:
default
. You can set the resource’s namespace by adding "auth": {"namespace": "my-namespace"}
to the resource’s configuration.
Anomalies are automatically assigned to the namespace of the alert or enumeration item that created it. Investigations are automatically assigned to the namespace of the anomaly it’s related to.
Example Alert:
Thirdeye Resource | SRN Resource Type | Example SRN |
---|---|---|
Data Source | thirdeye-data_source | srn:zone:thirdeye-data_source:default:105 |
Dataset | thirdeye-dataset | srn:zone:thirdeye-dataset:default:114 |
Alert Template | thirdeye-alert_template | srn:zone:thirdeye-alert_template:default:103 |
Alert | thirdeye-alert | srn:zone:thirdeye-alert:default:140 |
Enumeration Item | thirdeye-enumeration_time | srn:zone:thirdeye-enumeration_item:1776 |
Anomaly | thirdeye-anomaly | srn:zone:thirdeye-anomaly:default:1252 |
RCA Investigation | thirdeye-rca_investigation | srn:zone:thirdeye-rca_investigation:1343 |
default
namespace are ordered first, followed by policies in the resource’s namespace.
For example, if the auth service is checking authorization for resource SRN srn:zone:thirdeye-alert:regional_analysts_uk:140
, the policies are ordered like this:
User
SRN to the attributes sent by the OIDC provider when the user logged
into StarTree cloud. The auth service puts the user attributes, all the fields of the user SRN and resource SRN, and the action into the context map.
Example context map:
Resource | How is the namespace configured? |
---|---|
Data source | Namespace can only be set through the API. |
Dataset | Namespace can only be set through the API. |
Alert Template | Namespace is set in the UI by editing the config. |
Alert | Namespace is set in the UI by editing the config. |
Enumeration Item | Namespace is set in the Alert’s config block that creates the enumeration item. |
Anomaly | Namespace comes from the Alert or Enumeration Item that created it. If the anomaly was created by an enumeration item without an auth config, then the anomaly is assigned to the Alert’s namespace. Namespace can be overridden through the API. |
RCA Investigation | When created in the UI or without an auth config, the namespace is assigned to the Anomaly’s namespace. Namespace can be overridden through the API. |
Other resources | Always in the default namespace. |
default
.get all
requests?Request | Policy action | Notes |
---|---|---|
All Resources | ||
GET /api/{resource} | read | Only returns the resources that the user can read. |
GET /api/{resource}/{id} | read | |
GET /api/{resource}/name/{name} | read | |
POST /api/{resource} | write | Resource ID is always 0 when checking write permission for new resources. |
PUT /api/{resource} | write | The user must have write access for the resource’s current state and the new state. |
DELETE /api/{resource}/{id} | write | |
Alerts | ||
POST /api/alerts/evaluate (existing alert) | read | If the request body contains an alert id, ThirdEye evaluates the alert as it is stored in the database. |
POST /api/alerts/evaluate (new alert) | write | If the request body does not contain an alert id, ThirdEye evaluates the alert in the request body. |
POST /api/alerts/validate | write | |
POST /api/alerts/{id}/reset | write | |
Anomalies | ||
POST /api/anomalies/{id}/feedback | write |