Security: Add SECURITY.md, TLS 1.3 Enforcement, SCA & RBAC Support
📋 Summary
Add first-class security hardening to Context7 by providing:
- A
SECURITY.mdwith clear disclosure guidelines - Out-of-the-box TLS 1.3 enforcement
- Continuous dependency-scanning (npm audit, Snyk, Dependabot)
- Container-image scanning (Trivy)
- Optional RBAC middleware and structured logging
🛠 Background
Context7 powers LLM-based tooling, often in developer and corporate environments. At present:
- No published security policy or responsible-disclosure process
- HTTP/SSE endpoints default to unencrypted transport unless manually configured
- No built-in supply-chain or container image scanning workflows
- No role-based access control or centralized logging support
This leaves adopters to roll their own security measures, slowing integration and risking misconfiguration.
🎯 Goals
- Governance: Provide a standard
SECURITY.mdso users know how to report issues and which versions are supported. - Transport Security: Enforce TLS 1.3 by default in both Docker and local runs.
- Supply-Chain Protection: Integrate automated dependency-scanning in GitHub Actions (npm audit, Snyk or Dependabot) and container scanning via Trivy.
- Access Control & Auditing: Offer optional RBAC middleware (JWT or API-key based) and structured request logging for SIEM ingestion.
💡 Proposed Implementation
-
Add
SECURITY.md- Document reporting channels (
[email protected]), supported versions, and response SLA.
- Document reporting channels (
-
TLS 1.3 Enforcement
- Update startup script to detect certs in
/certsand launch HTTPS server withminVersion: 'TLSv1.3'. - Provide Dockerfile adjustments and sample
docker-compose.yml.
- Update startup script to detect certs in
-
GitHub Actions Workflows
-
Create
.github/workflows/security.ymlthat runs:npm audit --audit-level=highsnyk test(if Snyk token present)- Dependabot config in
.github/dependabot.yml
-
Add
.github/workflows/container-scan.ymlusingaquasecurity/trivy-action.
-
-
RBAC & Logging
- New optional middleware package in
@modelcontextprotocol/securitythat readsADMIN_ROLESfrom env, enforces on protected endpoints. - Hook into existing request pipeline to emit JSON logs (timestamp, route, principal) to stdout for collectors.
- New optional middleware package in
🚀 Benefits
- Faster, safer adoption in corporate environments
- Standardized process for vulnerability reporting and handling
- Reduced risk of supply-chain & MITM attacks out of the box
- Clear audit trail for compliance with security policies
Would love feedback on scope, naming, and any additional best practices!
this issue is a great contribution. on july we are planning a version open for enterprises. I will definitely check your list @Francescolatorre thank you!
@enesakar was there any updates here?
We added SECURITY.md https://github.com/upstash/context7/security/policy dependabot runs in the repo and we have RBAC in our dashboard.