- Do not commit
.env, local token caches, Microsoft client secrets, GreenNode credentials, Teams bot passwords, or API keys. - Store runtime values in local
.envfor development and GitHub Secrets for CI/CD. - Use
.env.examplefor placeholder names only. - If a secret is accidentally committed, rotate it immediately and remove it from the repository history where required.
- SharePoint is the source of truth for official ISMS, security, compliance, policy, procedure, and governance documents.
- Do not commit raw SharePoint downloads from
sharepoint_downloads/. - Treat
vector_db/as a generated and potentially sensitive artifact because embeddings can reveal information about source documents. - GitHub Actions does not access SharePoint and does not rebuild
vector_db/. - Refresh knowledge locally with
MS_AUTH_FLOW=device_code, then deploy an artifact that includes the refreshedvector_db/when needed.
Use:
python scripts/local_refresh_knowledge.py
python chatbot.pyLocal SharePoint sync uses MS_AUTH_FLOW=device_code. GitHub Actions must not run SharePoint sync or Microsoft Graph SharePoint calls.
- The web API endpoints
POST /chat,GET /documentsandGET /documents/countcan be protected with a shared access token. - Set
REQUIRE_APP_ACCESS_TOKEN=trueand a non-emptyAPP_ACCESS_TOKENto require the headerX-App-Access-Token: <APP_ACCESS_TOKEN>on those endpoints. - Missing token returns HTTP 401; an invalid token returns HTTP 403. Responses are
clean JSON (
{"error": ...}) and never include the token, other secrets, or env values. Token comparison uses a constant-time check. GET /,GET /health, static assets, and the TeamsPOST /api/messagesendpoint are not gated by this token (Teams keeps its Bot Framework JWT validation).- The web UI sends the token from
sessionStorageand prompts the user to set it when it receives 401/403. The token is never logged or hard-coded in the frontend. - When
REQUIRE_APP_ACCESS_TOKEN=false(default) local development works without a token. KeepAPP_ACCESS_TOKENout of Git; set it via.envlocally and Secrets in deployment.
Run before committing:
python scripts/security_audit.pyThe audit checks for tracked .env files, tracked generated knowledge artifacts, token caches, private keys, and high-confidence secret patterns. It never prints secret values.