mirror of
https://github.com/openfaas/faas.git
synced 2025-06-21 14:23:25 +00:00
Add basic auth to the system alert endpoint
**What** - Protect the `/system/alert` endpoint when basic auth is enabled - Update the alert manager config to send the basic auth credentials - Bump the gateway version Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
This commit is contained in:
committed by
Alex Ellis
parent
53645bb719
commit
f61735b155
@ -5,7 +5,7 @@ services:
|
|||||||
- "/var/run/docker.sock:/var/run/docker.sock"
|
- "/var/run/docker.sock:/var/run/docker.sock"
|
||||||
ports:
|
ports:
|
||||||
- 8080:8080
|
- 8080:8080
|
||||||
image: functions/gateway:0.7.0-arm64
|
image: functions/gateway:0.10.0-arm64
|
||||||
networks:
|
networks:
|
||||||
- functions
|
- functions
|
||||||
environment:
|
environment:
|
||||||
|
@ -3,7 +3,7 @@ services:
|
|||||||
gateway:
|
gateway:
|
||||||
ports:
|
ports:
|
||||||
- 8080:8080
|
- 8080:8080
|
||||||
image: openfaas/gateway:0.9.14-armhf
|
image: openfaas/gateway:0.10.0-armhf
|
||||||
networks:
|
networks:
|
||||||
- functions
|
- functions
|
||||||
environment:
|
environment:
|
||||||
@ -169,7 +169,8 @@ services:
|
|||||||
configs:
|
configs:
|
||||||
- source: alertmanager_config
|
- source: alertmanager_config
|
||||||
target: /alertmanager.yml
|
target: /alertmanager.yml
|
||||||
|
secrets:
|
||||||
|
- basic-auth-password
|
||||||
|
|
||||||
configs:
|
configs:
|
||||||
prometheus_config:
|
prometheus_config:
|
||||||
|
@ -3,7 +3,7 @@ services:
|
|||||||
gateway:
|
gateway:
|
||||||
ports:
|
ports:
|
||||||
- 8080:8080
|
- 8080:8080
|
||||||
image: openfaas/gateway:0.9.14
|
image: openfaas/gateway:0.10.0
|
||||||
networks:
|
networks:
|
||||||
- functions
|
- functions
|
||||||
environment:
|
environment:
|
||||||
@ -173,6 +173,8 @@ services:
|
|||||||
configs:
|
configs:
|
||||||
- source: alertmanager_config
|
- source: alertmanager_config
|
||||||
target: /alertmanager.yml
|
target: /alertmanager.yml
|
||||||
|
secrets:
|
||||||
|
- basic-auth-password
|
||||||
|
|
||||||
|
|
||||||
configs:
|
configs:
|
||||||
|
@ -126,6 +126,8 @@ func main() {
|
|||||||
faasHandlers.ScaleFunction = handlers.MakeForwardingProxyHandler(reverseProxy, forwardingNotifiers, urlResolver, nilURLTransformer)
|
faasHandlers.ScaleFunction = handlers.MakeForwardingProxyHandler(reverseProxy, forwardingNotifiers, urlResolver, nilURLTransformer)
|
||||||
|
|
||||||
if credentials != nil {
|
if credentials != nil {
|
||||||
|
faasHandlers.Alert =
|
||||||
|
auth.DecorateWithBasicAuth(faasHandlers.Alert, credentials)
|
||||||
faasHandlers.UpdateFunction =
|
faasHandlers.UpdateFunction =
|
||||||
auth.DecorateWithBasicAuth(faasHandlers.UpdateFunction, credentials)
|
auth.DecorateWithBasicAuth(faasHandlers.UpdateFunction, credentials)
|
||||||
faasHandlers.DeleteFunction =
|
faasHandlers.DeleteFunction =
|
||||||
|
@ -20,3 +20,7 @@ receivers:
|
|||||||
webhook_configs:
|
webhook_configs:
|
||||||
- url: http://gateway:8080/system/alert
|
- url: http://gateway:8080/system/alert
|
||||||
send_resolved: true
|
send_resolved: true
|
||||||
|
http_config:
|
||||||
|
basic_auth:
|
||||||
|
username: admin
|
||||||
|
password_file: /run/secrets/basic-auth-password
|
||||||
|
Reference in New Issue
Block a user