openapi: 3.1.0 info: title: Api version: 0.4.0 description: Authentication Factor Threat Comparison API servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: factors description: Authentication factors - name: threats description: Threat definitions - name: mitigations description: Mitigation controls paths: /healthz: get: operationId: healthCheck tags: [health] summary: Health check responses: "200": description: Healthy content: application/json: schema: $ref: "#/components/schemas/HealthStatus" /factors: get: operationId: listFactors tags: [factors] summary: List all authentication factors responses: "200": description: List of authentication factors content: application/json: schema: type: array items: $ref: "#/components/schemas/AuthFactor" /threats: get: operationId: listThreats tags: [threats] summary: List all threats responses: "200": description: List of threats content: application/json: schema: type: array items: $ref: "#/components/schemas/Threat" /mitigations: get: operationId: listMitigations tags: [mitigations] summary: List all mitigations responses: "200": description: List of mitigations content: application/json: schema: type: array items: $ref: "#/components/schemas/Mitigation" /compare: post: operationId: compareFactors tags: [factors] summary: Compare authentication factors and compute risk scores requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CompareRequest" responses: "200": description: Comparison result with risk scores content: application/json: schema: $ref: "#/components/schemas/CompareResult" components: schemas: HealthStatus: type: object properties: status: type: string required: - status AuthFactor: type: object properties: id: type: string name: type: string shortName: type: string description: "Abbreviated display name for compact columns" matrixCategory: type: string enum: [knowledge, possession, inherence, identity-assurance] description: "Factor category for heat map column grouping" category: type: string enum: [first, second, recovery, multi] description: type: string longDescription: type: string description: "Extended security context: use cases, caveats, and NIST status (2–4 sentences)" threatIds: type: array items: type: string nistAal: type: string description: "NIST SP 800-63B Authenticator Assurance Level: AAL1, AAL2, or AAL3" baseRiskScore: type: number learnMoreUrl: type: string description: "URL to authoritative documentation (NIST, FIDO Alliance, RFC, etc.)" impactInRecovery: type: number description: "Recovery-context impact dimension (1–5 scale). Used in L×C recovery scoring." recoveryDifficulty: type: number description: "Explicit recovery difficulty for L×C scoring (1–5, 1=easy recovery, 5=very hard)." required: - id - name - shortName - matrixCategory - category - description - threatIds - nistAal - baseRiskScore Threat: type: object properties: id: type: string name: type: string description: type: string severity: type: string enum: [low, medium, high, critical] mitigationIds: type: array items: type: string easeOfExecution: type: number description: "1–5 scale (1=nation-state only, 5=any script kiddie). Likelihood sub-dimension." prevalence: type: number description: "1–5 scale (1=theoretical, 5=actively exploited at scale). Likelihood sub-dimension." impact: type: number description: "1–5 scale (1=minimal disruption, 5=full takeover / unrecoverable). Consequence sub-dimension." detectionProbability: type: number description: "1–5 scale (1=easily detected, 5=undetectable). Higher value increases Consequence score." epssScore: type: number description: "EPSS score from FIRST.org (0.0–1.0), used as Likelihood floor" cveIds: type: array items: type: string description: "CVE IDs associated with this threat vector" mitreAttackTechnique: type: string description: "MITRE ATT&CK technique ID (e.g. T1566)" cisaKev: type: boolean description: "True if listed in the CISA Known Exploited Vulnerabilities catalog" osiLayerLabel: type: string enum: ["L7 Application", "L4 Transport", "L3 Network", "Social–Physical"] description: "OSI layer label for heat map row grouping" attackFamily: type: string description: "Attack family tag — shared with other threats to indicate related vectors" sources: type: array items: type: string description: "References to NIST, OWASP, MITRE ATT&CK, CVE identifiers" learnMoreUrl: type: string description: "URL to the primary authoritative reference (MITRE ATT&CK, OWASP, NIST)" required: - id - name - description - severity - mitigationIds - easeOfExecution - prevalence - impact - detectionProbability - osiLayerLabel - sources MitigationDeltas: type: object description: "Dimensional deltas applied to L×C sub-dimensions. Each dimension is floored at 1 after applying deltas." properties: deltaE: type: number description: "Reduce ease-of-execution by this amount" deltaP: type: number description: "Reduce prevalence by this amount" deltaI: type: number description: "Reduce impact by this amount" deltaD: type: number description: "Reduce detection probability by this amount" Mitigation: type: object properties: id: type: string name: type: string description: type: string applicableThreatIds: type: array items: type: string learnMoreUrl: type: string description: "URL to authoritative guidance (NIST, OWASP, RFC, CISA)" signinDeltas: $ref: "#/components/schemas/MitigationDeltas" description: "Dimensional deltas applied in sign-in context" recoveryDeltas: $ref: "#/components/schemas/MitigationDeltas" description: "Dimensional deltas applied in recovery context" required: - id - name - description - applicableThreatIds CompareRequest: type: object properties: firstFactorId: type: string nullable: true secondFactorId: type: string nullable: true recoveryFactorId: type: string nullable: true enabledMitigationIds: type: array items: type: string required: - enabledMitigationIds ThreatRiskDetail: type: object description: "Evaluation context — determines which dimensions and mitigation deltas are used" properties: threat: $ref: "#/components/schemas/Threat" rawScore: type: number description: "Base L×C matrix cell score before mitigations (1–25)" effectiveScore: type: number description: "Mitigated L×C matrix cell score after applying active mitigation deltas (1–25)" likelihood: type: number description: "Raw Likelihood sub-score (1–5)" consequence: type: number description: "Raw Consequence sub-score (1–5)" likelihoodEff: type: number description: "Mitigated Likelihood sub-score (1–5)" consequenceEff: type: number description: "Mitigated Consequence sub-score (1–5)" isShared: type: boolean description: "True if this threat is shared across 2 or more selected factors" mitigatedBy: type: array items: type: string description: "IDs of active mitigations that reduce this threat" context: type: string enum: [signin, recovery] description: "Evaluation context — determines which dimensions and mitigation deltas are used" required: - threat - rawScore - effectiveScore - likelihood - consequence - likelihoodEff - consequenceEff - isShared - mitigatedBy - context FactorThreatBreakdown: type: object properties: factorId: type: string factorName: type: string threats: type: array items: $ref: "#/components/schemas/Threat" required: - factorId - factorName - threats RiskBreakdown: type: object properties: likelihoodContribution: type: number description: "Normalized 0–100 Likelihood contribution to overall score" consequenceContribution: type: number description: "Normalized 0–100 Consequence contribution to overall score" sharedThreatPenalty: type: number description: "Extra score points added by the ×1.5 shared-threat amplifier" easeContribution: type: number description: "Ease-of-execution share of Likelihood contribution (legacy, for backward compat)" prevalenceContribution: type: number description: "Prevalence share of Likelihood contribution (legacy, for backward compat)" impactContribution: type: number description: "Impact share of Consequence contribution (legacy, for backward compat)" required: - likelihoodContribution - consequenceContribution - sharedThreatPenalty - easeContribution - prevalenceContribution - impactContribution CompareResult: type: object properties: sharedThreats: type: array items: $ref: "#/components/schemas/Threat" factorBreakdowns: type: array items: $ref: "#/components/schemas/FactorThreatBreakdown" threatDetails: type: array items: $ref: "#/components/schemas/ThreatRiskDetail" baseRiskScore: type: number description: "Normalized 0–100 composite risk score (no mitigations)" mitigatedRiskScore: type: number description: "Normalized 0–100 composite risk score after applying active mitigations" riskBreakdown: $ref: "#/components/schemas/RiskBreakdown" appliedMitigations: type: array items: $ref: "#/components/schemas/Mitigation" required: - sharedThreats - factorBreakdowns - threatDetails - baseRiskScore - mitigatedRiskScore - riskBreakdown - appliedMitigations