Objective
Make API GET authentication production-aware so real cloud posture data is not public by default in deployed environments.
Why this matters
api/app.py currently treats every /api/* GET request as public. This is convenient for a public demo dashboard, but it is risky when the same backend is used with real Azure scan data.
Findings, resources, compliance status, drift events, CVE summaries, and prioritization output can reveal sensitive information about an organization's cloud environment. In production, those reads should require authentication unless the deployment explicitly opts into public demo mode.
Current behavior
In api/app.py, _is_public_get() returns true for all paths starting with /api/.
Docs also state that all /api/* GET routes are public.
Suggested implementation
- Keep
/health public.
- Add an explicit public-demo flag, for example
OPENSHIELD_PUBLIC_DEMO=true.
- In production (
OPENSHIELD_ENV=production or RENDER=true), require JWT auth for /api/* GET routes unless public demo mode is explicitly enabled.
- Update docs so demo and production auth behavior are clearly separated.
- Add tests for local demo, production authenticated GET, and production unauthenticated GET.
Files likely involved
api/app.py
docs/api-reference.md
docs/api-render-deploy.md
frontend/API_ENDPOINTS.txt
tests/
Acceptance criteria
Review pair
API and Backend: Safid + Ritik
Objective
Make API GET authentication production-aware so real cloud posture data is not public by default in deployed environments.
Why this matters
api/app.pycurrently treats every/api/*GET request as public. This is convenient for a public demo dashboard, but it is risky when the same backend is used with real Azure scan data.Findings, resources, compliance status, drift events, CVE summaries, and prioritization output can reveal sensitive information about an organization's cloud environment. In production, those reads should require authentication unless the deployment explicitly opts into public demo mode.
Current behavior
In
api/app.py,_is_public_get()returns true for all paths starting with/api/.Docs also state that all
/api/*GET routes are public.Suggested implementation
/healthpublic.OPENSHIELD_PUBLIC_DEMO=true.OPENSHIELD_ENV=productionorRENDER=true), require JWT auth for/api/*GET routes unless public demo mode is explicitly enabled.Files likely involved
api/app.pydocs/api-reference.mddocs/api-render-deploy.mdfrontend/API_ENDPOINTS.txttests/Acceptance criteria
/healthremains public in all environments/api/*GET routes return 401 without a valid JWT by defaultReview pair
API and Backend: Safid + Ritik