hasura / hasura/graphql-engine
Disable admin functionalilty if HASURA_GRAPHQL_ADMIN_SECRET is not set
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
### Is your proposal related to a problem?
To secure the GraphQL endpoint, I want to disable admin access.
### Describe the solution you'd like
By not setting the admin secret, admin functionality should be disabled.
### Describe alternatives you've considered
As a workaround, I'm removing the `x-hasura-admin-secret` header on my NGINX ingress controller if it's present, which breaks admin access on purpose.
For those interested:
```
nginx.ingress.kubernetes.io/configuration-snippet: |
more_set_input_headers "x-hasura-admin-secret: ";
```
### If the feature is approved, would you be willing to submit a PR?
I do not have enough understanding of the codebase to make a proper PR.
Contributor guide
Research direction
Start by locating the code that reads HASURA_GRAPHQL_ADMIN_SECRET and controls admin authorization, then trace how requests with the x-hasura-admin-secret header are handled. Done means leaving the secret unset disables admin functionality while ordinary GraphQL access remains available; add or update the relevant tests once their location is identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, nginx
- Domain
- api, authentication, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100