Skip to content

Commit

Permalink
Remove authentication from dashboard queries endpoint and update trae…
Browse files Browse the repository at this point in the history
…fik rules
tahmidrahman-dsi committed May 23, 2024
1 parent e3253dd commit a4a37a5
Showing 2 changed files with 12 additions and 6 deletions.
17 changes: 11 additions & 6 deletions infrastructure/docker-compose.deploy.yml
Original file line number Diff line number Diff line change
@@ -554,7 +554,7 @@ services:
deploy:
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.countryconfig.rule=Host(`countryconfig.{{hostname}}`) && !Path(`/email`) && !Path(`/notification`)'
- 'traefik.http.routers.countryconfig.rule=Host(`countryconfig.{{hostname}}`) && !Path(`/email`) && !Path(`/notification`) &!Path(`/dashboards/queries.json`)'
- 'traefik.http.services.countryconfig.loadbalancer.server.port=3040'
- 'traefik.http.routers.countryconfig.tls=true'
- 'traefik.http.routers.countryconfig.tls.certresolver=certResolver'
@@ -567,13 +567,15 @@ services:
- 'traefik.http.middlewares.countryconfig.headers.stsseconds=31536000'
- 'traefik.http.middlewares.countryconfig.headers.stsincludesubdomains=true'
- 'traefik.http.middlewares.countryconfig.headers.stspreload=true'
# This is an invalid IP range, effectively blocking all IPs from accessing /email path.
# This is an invalid IP range, effectively blocking all IPs from accessing below paths.
# It's only meant to be accessed from the internal docker network.
- 'traefik.http.middlewares.block-email.ipwhitelist.sourcerange=255.255.255.255'
- 'traefik.http.middlewares.block-internal-routes.ipwhitelist.sourcerange=255.255.255.255'
- 'traefik.http.routers.block-email.rule=Host(`countryconfig.{{hostname}}`) && Path(`/email`)'
- 'traefik.http.routers.block-email.middlewares=block-email'
- 'traefik.http.routers.block-email.middlewares=block-internal-routes'
- 'traefik.http.routers.block-notification.rule=Host(`countryconfig.{{hostname}}`) && Path(`/notification`)'
- 'traefik.http.routers.block-notification.middlewares=block-email'
- 'traefik.http.routers.block-notification.middlewares=block-internal-routes'
- 'traefik.http.routers.block-dashboard-queries.rule=Host(`countryconfig.{{hostname}}`) && Path(`/dashboards/queries.json`)'
- 'traefik.http.routers.block-dashboard-queries.middlewares=block-internal-routes'
replicas: 1
environment:
- MONGO_URL=mongodb://mongo1/user-mgnt?replicaSet=rs0
@@ -848,7 +850,7 @@ services:
deploy:
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.config.rule=Host(`config.{{hostname}}`)'
- 'traefik.http.routers.config.rule=Host(`config.{{hostname}}`) && !Path(`/dashboardQueries`)'
- 'traefik.http.services.config.loadbalancer.server.port=2021'
- 'traefik.http.routers.config.tls=true'
- 'traefik.http.routers.config.tls.certresolver=certResolver'
@@ -860,6 +862,9 @@ services:
- 'traefik.http.middlewares.config.headers.stsseconds=31536000'
- 'traefik.http.middlewares.config.headers.stsincludesubdomains=true'
- 'traefik.http.middlewares.config.headers.stspreload=true'
- 'traefik.http.middlewares.block-internal-routes.ipwhitelist.sourcerange=255.255.255.255'
- 'traefik.http.routers.block-dashboard-queries.rule=Host(`countryconfig.{{hostname}}`) && Path(`/dashboardQueries`)'
- 'traefik.http.routers.block-dashboard-queries.middlewares=block-internal-routes'
replicas: 1
networks:
- overlay_net
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -374,6 +374,7 @@ export async function createServer() {
handler: dashboardQueriesHandler,
options: {
tags: ['api'],
auth: false,
description: 'Serves dashboard view refresher queries'
}
})

0 comments on commit a4a37a5

Please sign in to comment.