caelum0x 514086bdda feat: Phase 3 enterprise hardening — gateway chain, XDR threat detection, compliance ops, plan tiers
- lib/security/gatewayChain.ts: composable ordered front-door (ip-allowlist -> authN -> authZ ->
  provenance -> rate/quota) as an additive primitive + docs/gateway-rollout.md (BUILD not fork Envoy)
- XDR: 0064 security_events + lib/security/threatDetection.ts (4 deterministic detectors) +
  securityScan + /console/admin/security dashboard
- Compliance ops: retention purge (with SQL-identifier guard), nightly chain-integrity verifyChain,
  access-review snapshot; folded into the daily /api/cron/tick (one Vercel-Hobby cron)
- Plan tiers: 0065 Researcher/Team/Pharma-Enterprise + plan_features entitlements + requireFeature +
  /console/billing/tier (Part-11 e-sign, audit export, SSO/SCIM gated to Enterprise)
- docs/compliance-controls.md (SOC2/HIPAA/21 CFR Part 11 controls matrix)
- Fixed: honest new-active-key threat description; removed duplicate /security page

migrations 0064/0065/0066 applied to Neon; tsc + build green.
2026-07-11 00:18:36 +03:00

25 lines
802 B
TypeScript

export type Severity = "low" | "medium" | "high" | "critical";
// Fixed severity -> Tailwind class map so a finding's band is instantly legible
// and never built from raw input. Colors escalate low -> critical.
const SEVERITY_CLASS: Record<Severity, string> = {
low: "bg-ink/5 text-ink/60 border-ink/10",
medium: "bg-amber-50 text-amber-700 border-amber-200",
high: "bg-orange-50 text-orange-700 border-orange-200",
critical: "bg-red-50 text-red-700 border-red-200",
};
interface SeverityBadgeProps {
severity: Severity;
}
export function SeverityBadge({ severity }: SeverityBadgeProps) {
return (
<span
className={`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium capitalize ${SEVERITY_CLASS[severity]}`}
>
{severity}
</span>
);
}