Skip to content

Commit 7adc905

Browse files
Add tailored STPA risk analysis - fixes
1 parent e9426c3 commit 7adc905

1 file changed

Lines changed: 32 additions & 24 deletions

File tree

TSF/docs/risk_analysis.rst

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,14 @@ The system boundary, environment, and boundary-crossing interactions assumed for
3535
The software under analysis (SUA) is the **header-only C++ JSON library `nlohmann/json` (v3.12.0)**, with:
3636

3737
- **Implementation**
38-
- primary include `include/nlohmann/json.hpp` (and internal headers under `include/nlohmann/detail/**`)
39-
- optional amalgamated single-include header `single_include/nlohmann/json.hpp`
38+
- `primary include <https://github.com/nlohmann/json/blob/develop/include/nlohmann/json.hpp>`_ (and internal headers under `include/nlohmann/detail <https://github.com/nlohmann/json/tree/develop/include/nlohmann/detail>`_)
39+
- optional amalgamated single-include header `single_include/nlohmann/json.hpp <https://github.com/nlohmann/json/blob/develop/single_include/nlohmann/json.hpp>`_
4040
- C++11, no external code dependencies
4141
- **Purpose**
4242
- provide JSON parsing and validation per **RFC 8259**
4343
- **Evidence**
44-
- captured extensively in `WFJ-*`, `TIJ-*`, `NJF-*`, `NPF-*`, and `PJD-*` statements, which are connected in the trustable graph to the expectation `JLEX-02`.
44+
- captured extensively in `WFJ-*`, `TIJ-*`, `NJF-*`, `NPF-*`, and `PJD-*` statements, which are connected in the trustable graph to the expectation `JLEX-02`. See `Trustable Graph (JLEX-02) <https://eclipse-score.github.io/nlohmann_json/main/_images/custom_JLEX-02_graph.svg>`_.
45+
Finding: the trustable graph contains JLEX-01, which is not a S-CORE requirement any more (to be fixed with `Bug #2686 <https://github.com/eclipse-score/score/issues/2686>`_).
4546

4647
1.2 System
4748
^^^^^^^^^^
@@ -54,7 +55,7 @@ It is typically an ECU containing driving functions and the necessary supporting
5455

5556
Assumptions of Use are captured in the TSF elements:
5657

57-
- `TA-CONSTRAINTS` → `AOU-01..AOU-31`
58+
- `TA-CONSTRAINTS` → `AOU-01..AOU-31` (see `Trustable Graph (TA-CONSTRAINTS) <https://eclipse-score.github.io/nlohmann_json/main/_images/custom_TA-CONSTRAINTS_graph.svg>`_.
5859

5960

6061

@@ -72,7 +73,8 @@ Two use cases should be considered:
7273

7374
Rationale for the chosen losses:
7475

75-
As the expected system the SUA is used in is a vehicle only the maximum possible loss is considered.
76+
As the expected system the SUA is used in is a vehicle control unit, the assumption is there are safety relevant functions in it.
77+
The loss(es) are constrained to the scope of S-CORE.
7678

7779
.. list-table:: Losses
7880
:header-rows: 1
@@ -81,7 +83,7 @@ As the expected system the SUA is used in is a vehicle only the maximum possible
8183
- Loss description
8284

8385
* - L1
84-
- Loss of life of people inside or outside of the vehicle.
86+
- Loss of safety related applications, realizing functions or parts of them e.g. for driving function..
8587

8688

8789
2.2 Hazards (System-Level Conditions that can lead to these Losses)
@@ -112,9 +114,9 @@ Using the Losses, we define **Hazards (H\*)** :
112114
2.3 System-level Constraints (system conditions or behaviours that need to be satisfied to prevent hazards)
113115
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
114116

115-
In RAFIA/STPA, constraints are “statements that must be true” to avoid a hazard, UCA, or causal scenario `RAFIA: Risk Analysis <https://pages.eclipse.dev/eclipse/tsf/tsf/extensions/rafia/risk-analysis.html>`_. In TSF terms, these constraints are captured as (or mapped onto existing) **Items**, and are supported by **Evidence**.
117+
In RAFIA/STPA, constraints are “statements that must be true” to avoid a hazard, Unsafe Control Actions (UCA), or causal scenario `RAFIA: Risk Analysis <https://pages.eclipse.dev/eclipse/tsf/tsf/extensions/rafia/risk-analysis.html>`_. In TSF terms, these constraints are captured as (or mapped onto existing) **Items**, and are supported by **Evidence**.
116118

117-
.. list-table:: SLCs
119+
.. list-table:: System Level Constraints (SLCs)
118120
:header-rows: 1
119121

120122
* - Constraint Id
@@ -143,12 +145,12 @@ In RAFIA/STPA, constraints are “statements that must be true” to avoid a haz
143145
- In case of safety relevant timing constraints are violated, the system is detecting this and will go to safe state.
144146
- H3
145147
- UCA-I1-TL; UCA-I3-TL
146-
- TBD
148+
- `Bug #2686 <https://github.com/eclipse-score/score/issues/2686>`_
147149

148150
Note: Column "Link to UCA" is filled in step 5.
149151

150152

151-
1. Control structure
153+
3. Control structure
152154
--------------------
153155

154156
Here, a control structure is defined:
@@ -195,7 +197,7 @@ This diagram is used both to define the **scope of analysis** (system boundary a
195197

196198
* - Interaction Id
197199
- Interaction description
198-
- Type
200+
- IType
199201
- Provider Id
200202
- Receiver Id
201203

@@ -223,8 +225,9 @@ This diagram is used both to define the **scope of analysis** (system boundary a
223225
- E2
224226
- E1
225227

228+
Note: In this and other tables definitions from `STPA results schema <https://pages.eclipse.dev/eclipse/tsf/tsf/extensions/stpa/schema.html>`_ are used, e.g. IType.
226229

227-
1. Unsafe Control Actions (UCAs)
230+
4. Unsafe Control Actions (UCAs)
228231
--------------------------------
229232

230233
Using the control structure, we identify **Unsafe Control Actions (UCA\*)**:
@@ -260,7 +263,7 @@ for the SUA provided feedback.
260263

261264
* - CA Analysis ID
262265
- CA Id
263-
- UCA Type
266+
- UCAType
264267
- UCA Context
265268
- Analysis Result
266269
- Hazard(s)
@@ -410,13 +413,14 @@ for the SUA provided feedback.
410413
- -
411414
- Sequence/order is not applicable to a single `parse` call in isolation, nlohman_json is a library so no influence from other callers.
412415

416+
Note: In this and other tables definitions from `STPA results schema <https://pages.eclipse.dev/eclipse/tsf/tsf/extensions/stpa/schema.html>`_ are used, e.g. UCAType.
413417

414418
4.3 UCAs
415419
^^^^^^^^
416420

417421
The UCA identified in the above analysis are:
418422

419-
.. list-table:: UCAs
423+
.. list-table:: Unsafe Control Actions (UCAs)
420424
:header-rows: 1
421425

422426
* - UCA Id
@@ -477,12 +481,12 @@ The UCA identified in the above analysis are:
477481

478482

479483

480-
1. Controller (Functional) Constraints
484+
5. Controller (Functional) Constraints
481485
--------------------------------------
482486

483487
This step records the **Controller (Functional) Constraints (CFC)** derived from the UCA results. This adds to the above constraint table
484488

485-
.. list-table:: CFCs
489+
.. list-table:: Controller (Functional) Constraints (CFCs)
486490
:header-rows: 1
487491

488492
* - Constraint Id
@@ -497,10 +501,10 @@ This step records the **Controller (Functional) Constraints (CFC)** derived from
497501
- Non availability of return data is treated by the caller (e.g. by default data, or safe state).
498502
- -
499503
- UCA-I1-ML; UCA-I3-ML
500-
- ?
504+
- `Bug #2686 <https://github.com/eclipse-score/score/issues/2686>`_
501505

502506

503-
1. Control Loops and Sequences
507+
6. Control Loops and Sequences
504508
------------------------------
505509

506510
This step is tailored out due to low complexity of the SUA (simple caller/callee interacttion).
@@ -523,26 +527,30 @@ This step is tailored out due to low complexity of the SUA (simple caller/callee
523527
^^^^^^^^^^^^^^^^^
524528

525529
In TSF terms, misbehaviours are **anything that can cause a deviation from Expected Behaviour** (`TA-MISBEHAVIOURS_CONTEXT.md`).
526-
JLS-24 partly but not fully covers C2. As this misbehaviour leads to an exception, this needs to be covered by the user (see AOU-04).
527-
But AOU-04 is formulated in a wrong way ("exceptions are ... turned off") and has to be corrected.
530+
531+
`JLS-24 <https://eclipse-score.github.io/nlohmann_json/main/generated/JLS.html#jls-24>`_ partly but not fully covers C2. As this misbehaviour leads to an exception, this needs to be covered by the user (see `AOU-04 <https://eclipse-score.github.io/nlohmann_json/main/generated/AOU.html#aou-04>`_).
532+
533+
But AOU-04 is formulated in a wrong way ("exceptions are ... turned off") and has to be corrected (to be fixed with `Bug #2686 <https://github.com/eclipse-score/score/issues/2686>`_)
528534

529535

530536
9.2 Expectations
531537
^^^^^^^^^^^^^^^^
532538

533-
Here, expectations are recorded as explicit, change-controlled statements about the SUA where it is responsible for preventing or mitigating a risk (Hazard, UCA, Causal Scenario) or Misbehaviour. The key SUA expectations already exist as TSF Expectation (`JLEX-02`).
539+
Here, expectations are recorded as explicit, change-controlled statements about the SUA where it is responsible for preventing or mitigating a risk (Hazard, UCA, Causal Scenario) or Misbehaviour.
540+
The key SUA expectations already exist as TSF Expectation (`JLEX-02 <https://eclipse-score.github.io/nlohmann_json/main/generated/JLEX.html#jlex-02>`_) covering C1.
534541

535542

536543
9.3 Assumptions
537544
^^^^^^^^^^^^^^^
538545

539-
Assumptions record conditions for integrators and other system elements (outside the SUA) that are responsible for preventing or mitigating a risk or misbehaviour. Again, assumptions are already covered under TSF as Assumptions of Use (AOU-23, AOU-24).
546+
Assumptions record conditions for integrators and other system elements (outside the SUA) that are responsible for preventing or mitigating a risk or misbehaviour.
547+
Again, assumptions are already covered under TSF as Assumptions of Use (`AOU-23 <https://eclipse-score.github.io/nlohmann_json/main/generated/AOU.html#aou-23>`_, `AOU-24 <https://eclipse-score.github.io/nlohmann_json/main/generated/AOU.html#aou-24>`_).
540548

541-
To make sure C3 is covered by the system a new AOU has to be formulated.
549+
To make sure C3 is covered by the system a new AOU has to be formulated (to be fixed with `Bug #2686 <https://github.com/eclipse-score/score/issues/2686>`_).
542550
It is not possible to be covered by the SUA, because it has no control over the size of the JSON data provided.
543551

544552
If the uses `accept` before using `parse` on a JSON to be deserialized he can avoid an exception due to mal-formed JSON, but he still needs to care for the missing
545-
deserialized data in a safe way. AOU for this is missing (which will cover C4).
553+
deserialized data in a safe way. AOU for this is missing which will cover C4 (to be fixed with `Bug #2686 <https://github.com/eclipse-score/score/issues/2686>`_).
546554

547555
10. Review STPA results
548556
-----------------------

0 commit comments

Comments
 (0)