Skip to content

fix: tara closed impact/risk enums per x-FuSa spec v1.14.1 (v0.41.0) - #69

Merged
SoundMatt merged 1 commit into
mainfrom
fix/tara-enum-vocabulary
Jul 28, 2026
Merged

fix: tara closed impact/risk enums per x-FuSa spec v1.14.1 (v0.41.0)#69
SoundMatt merged 1 commit into
mainfrom
fix/tara-enum-vocabulary

Conversation

@SoundMatt

Copy link
Copy Markdown
Owner

Summary

x-FuSa spec §9.2 ("Closed enums MUST — clarifies a gap found during rollout") requires:

  • impact.{safety,financial,operational,privacy}: critical | major | moderate | negligible — explicitly not high|medium|low, even though that vocabulary is used for attackFeasibility.
  • risk: critical | high | medium | low, derived via a stated risk combination table (highest SFOP impact × attackFeasibility).

tara.go implemented neither: deriveSFOP only ever produced high/medium/low for the four SFOP axes (confirmed against this repo's own 319 generated threats — critical/negligible never appeared), and deriveRisk's "worse of the two inputs" heuristic could only ever produce high/medium since both its inputs were drawn from the same three-value vocabulary.

  • deriveSFOP now maps onto the closed enum via new legacyImpactToSFOP (escalates to critical for the most severe IEC 62443 SL3 rules, major otherwise).
  • deriveRisk is reimplemented as an actual lookup against the x-FuSa spec's own published risk combination table (riskTable), rather than a generic heuristic.

Closes #58.

Test plan

  • go build ./...
  • go vet ./...
  • go test -race -count=1 ./... (88.7% total coverage)
  • golangci-lint run ./... (0 issues)
  • go generate ./... (no diff)
  • Regenerated tara.json against this repo's own CYBER findings — risk now includes critical (2/319 threats) alongside medium/low; impact.safety includes critical alongside moderate; neither reachable before this fix
  • New tests: TestScan_AllRules_UseClosedImpactAndRiskEnums (all 20 CYBER rules, asserts every impact/risk value is in the closed enum and the legacy vocabulary never appears, and that critical/major/moderate all genuinely occur) and TestScan_RiskCombinationTable (hand-verified lookups against the spec's table)

x-FuSa spec §9.2 ("Closed enums (MUST — clarifies a gap found during
rollout)") requires impact.{safety,financial,operational,privacy} to use
critical|major|moderate|negligible — never high|medium|low, even though
that vocabulary is used for attackFeasibility — and risk to use
critical|high|medium|low. tara.go implemented neither: deriveSFOP only
ever produced high/medium/low for the SFOP axes, and deriveRisk's coarse
"worse of feasibility vs. highest impact" heuristic could only ever
produce high/medium, never critical or low, because its two inputs were
themselves drawn from the same three-value vocabulary (go-FuSa#58).

deriveSFOP now maps onto the closed critical/major/moderate/negligible
vocabulary via the new legacyImpactToSFOP: a "high" rating escalates to
"critical" for the most severe (IEC 62443 SL3) rules, "major" otherwise,
preserving genuinely distinct tiers rather than collapsing every "high"
rule onto one value regardless of actual severity. deriveRisk is
reimplemented as an actual lookup against the x-FuSa spec's own
published risk combination table (highest SFOP impact axis ×
attackFeasibility → risk, via the new riskTable) rather than a generic
heuristic, so critical and low are both reachable outcomes.

Regenerated tara.json against this repo's own CYBER findings: risk now
includes "critical" (2 threats) alongside medium/low; impact.safety
includes "critical" alongside "moderate" — neither value was reachable
before this fix.

Signed-off-by: Matt Jones <matt@jellybaby.com>
Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
Comment thread tara/tara.go
// convention (documented in the spec) rather than a normative external
// table — every value is taken verbatim from the spec's published table so
// cross-tool risk values stay comparable.
var riskTable = map[[2]string]string{
Comment thread tara/tara_test.go

// ─── x-FuSa spec §9.2 closed impact/risk enums ─────────────────────────────────

var closedImpactValues = map[string]bool{"critical": true, "major": true, "moderate": true, "negligible": true}
Comment thread tara/tara_test.go
// ─── x-FuSa spec §9.2 closed impact/risk enums ─────────────────────────────────

var closedImpactValues = map[string]bool{"critical": true, "major": true, "moderate": true, "negligible": true}
var closedRiskValues = map[string]bool{"critical": true, "high": true, "medium": true, "low": true}
Comment thread tara/tara_test.go

var closedImpactValues = map[string]bool{"critical": true, "major": true, "moderate": true, "negligible": true}
var closedRiskValues = map[string]bool{"critical": true, "high": true, "medium": true, "low": true}
var legacyVocabValues = map[string]bool{"high": true, "medium": true, "low": true}
@SoundMatt
SoundMatt merged commit 86618e2 into main Jul 28, 2026
16 checks passed
@SoundMatt
SoundMatt deleted the fix/tara-enum-vocabulary branch July 28, 2026 22:27
SoundMatt added a commit that referenced this pull request Jul 28, 2026
…-forward-v2

Resolves version-bump conflicts (fusa.go, README.md, docs/tool-safety-manual.md,
CHANGELOG.md) against main after #69 (tara enum vocabulary, v0.41.0) merged.
Bumped this branch's own release to v0.42.0 and moved its CHANGELOG entry to
the top of the file.

Signed-off-by: Matt Jones <matt@jellybaby.com>
Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
SoundMatt added a commit that referenced this pull request Jul 28, 2026
Resolves conflicts against main after #73 (hara, v0.42.0) merged on top of
#69 (tara enum vocabulary, v0.41.0). Bumped this branch's own release to
v0.43.0, reordered CHANGELOG.md entries to reflect actual merge order, and
regenerated fmea.json/fmea.csv/tara.json/tara.md with the fully-merged
binary so they reflect the path-relativization fix, the widened FMEA
templates, and the (already-merged) closed impact/risk enums together.

Signed-off-by: Matt Jones <matt@jellybaby.com>
Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tara.json impact/risk use non-conformant high|medium|low vocabulary instead of x-FuSa spec v1.14.1 closed enums

2 participants