Skip to content

Commit

Permalink
slack alert viewable by all project users (#5389)
Browse files Browse the repository at this point in the history
* make slack channel alert viewable to all project users

* docs warning
  • Loading branch information
pjain1 authored Aug 5, 2024
1 parent 92ab0cc commit f9deffb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/docs/explore/alerts/slack.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ Sending notifications to a specific channel (public or private) requires the [`c
The application will also need to be added to the channel for the notification to be sent.
:::

:::warning
Any alert configured to be sent to a Slack channel will be viewable by all project viewers.
:::

### Direct messages

Sending notifications via a direct message requires the [`chat:write`](https://api.slack.com/scopes/chat:write), [`users:read`](https://api.slack.com/scopes/users:read), and [`users:read.email`](https://api.slack.com/scopes/users:read.email) scopes.
Expand Down
4 changes: 4 additions & 0 deletions runtime/security.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,10 @@ func (p *securityEngine) builtInAlertSecurityRule(spec *runtimev1.AlertSpec, cla
return allowAccessRule
}
}
// Note - A hack to allow slack channel users to access the alert. This also means that any alert configured with a slack channel will be viewable by any user part of the project and will appear in their alert list.
if len(props.Channels) > 0 {
return allowAccessRule
}
}
}

Expand Down

0 comments on commit f9deffb

Please sign in to comment.