Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Commit 926004c

Browse files
committed
#30 Use literal and source blocks for diagram
Asciidoc uses a different syntax for code or monospaced blocks. Also remove leading white spaces. Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
1 parent cd2b61c commit 926004c

File tree

1 file changed

+27
-22
lines changed

1 file changed

+27
-22
lines changed

docs/adr/adr_0001.adoc

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,28 @@
1616
| Author(s)
1717
| Jannik Hollenbach <Jannik.Hollenbach@iteratec.com>,
1818
Jorge Estigarribia <Jorge.Estigarribia@iteratec.com>,
19-
Robert Seedorff <Robert.Seedorff@iteratec.com>
19+
Robert Seedorff <Robert.Seedorff@iteratec.com>,
20+
Sven Strittmatter <Sven.Strittmatter@iteratec.com>
2021
|====
2122

2223
== Context
2324

2425
=== Status Quo
2526

2627
One major challenge implementing the _secureCodeBox_ is to provide a flexible and modular architecture, which enables the open source community to easily understand the concepts and especially to extend the _secureCodeBox_ with individual features. Therefore we decided to seperate the process stages of a single security scan (instance of scanType CRD) in 3 major phases:
27-
```
28-
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
29-
│ Scanning ├─────────▶│ Parsing ├─────────▶│ Persisting │
30-
│ (Phase 1) │ │ (Phase 2) │ │ (Phase 3) │
31-
└──────────────────┘ └──────────────────┘ └──────────────────┘
32-
```
28+
29+
....
30+
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
31+
│ Scanning ├─────────▶│ Parsing ├─────────▶│ Persisting │
32+
│ (Phase 1) │ │ (Phase 2) │ │ (Phase 3) │
33+
└──────────────────┘ └──────────────────┘ └──────────────────┘
34+
....
35+
3336
By now the "Persisting Phase 3" was implemented by so called _persistenceProviders_ e.g the *persistence-elastic* provider which is responsible for persisting all findings in a given elasticsearch database. The _secureCodeBox_ Operator is aware of this 3 phases and is responsible for the state model and execution of each security scan (instance of scanType CRD).
3437

3538
=== Problem and Question
3639

37-
We identified different additional UseCases with a more _data proccessing oriented_ pattern than the implemented _persisting phase3_ indicates. For example, we implemented a so called "MetaDataProvider" feature, which is responsible for enhancing each security finding with additional metadata. But the MetaDataProvider must be executed after the _parsing phase 2_ and before the _persisting phase 3_ because it depends on the parsed finding results (which will be enhanced) and the update findings should be also persisted.
40+
We identified different additional UseCases with a more _data proccessing oriented_ pattern than the implemented _persisting phase3_ indicates. For example, we implemented a so called "MetaDataProvider" feature, which is responsible for enhancing each security finding with additional metadata. But the MetaDataProvider must be executed after the _parsing phase 2_ and before the _persisting phase 3_ because it depends on the parsed finding results (which will be enhanced) and the update findings should be also persisted.
3841

3942

4043
To find a proper solution, we splitted the topic into the follwong two questions:
@@ -43,6 +46,7 @@ To find a proper solution, we splitted the topic into the follwong two questions
4346
* Question 2: How should the execution model look like for each concept?
4447

4548
==== Question 1: Should we unify the concepts MetaDataProvider and PersistenceProvider?
49+
4650
==== Solution approach 1: Unify
4751

4852
Both "modules" are "processing" the security findings, which are generated in the parsing phase.
@@ -68,7 +72,8 @@ These could be implemented with a `type` attribute, which declares if they are `
6872

6973
The operator would process all these resources in the namespace and execute the `ReadAndWrite` ones first (in serial: one at a time to avoid write conflicts) and then the `ReadOnly` ones (in parallel).
7074

71-
```yaml
75+
[source,yaml]
76+
----
7277
apiVersion: execution.experimental.securecodebox.io/v1
7378
kind: ScanCompletionHook
7479
metadata:
@@ -77,11 +82,11 @@ spec:
7782
type: ReadAndWrite
7883
# If implemented like the current persistence provider
7984
image: my-metadata:v2.0.0
80-
```
85+
----
8186

8287
The Execution Flow would then look something like this:
8388

84-
```
89+
....
8590
┌ ReadOnly─Hooks─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─
8691
┌ ReadAndWriteHooks ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┌────────────────────────────────┐ │
8792
┌───────────────────────┐ │ ┌──┼▶│ Elastic PersistenceProvider │
@@ -90,7 +95,7 @@ The Execution Flow would then look something like this:
9095
└──────────────────┘ └──────────────────┘ │ └───────────────────────┘ └───────────────────────┘ └───▶│ DefectDojo PersistenceProvider │ │
9196
─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘ │ └────────────────────────────────┘
9297
─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘
93-
```
98+
....
9499

95100
**Pros:**
96101

@@ -107,7 +112,7 @@ The Execution Flow would then look something like this:
107112

108113
Keep PersistenceProvider as they are and introduce new "MetaDataProvider" CRD which gets executed before the PersistenceProviders by the operator.
109114

110-
```
115+
....
111116
┌ Persistence Provider─ ─ ─ ─ ─ ─ ─ ─
112117
┌ MetaData Provider ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┌────────────────────────────────┐ │
113118
┌───────────────────────┐ │ ┌──┼▶│ Elastic PersistenceProvider │
@@ -116,7 +121,7 @@ Keep PersistenceProvider as they are and introduce new "MetaDataProvider" CRD wh
116121
└──────────────────┘ └──────────────────┘ │ └───────────────────────┘ └───────────────────────┘ └───▶│ DefectDojo PersistenceProvider │ │
117122
─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘ │ └────────────────────────────────┘
118123
─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘
119-
```
124+
....
120125

121126
**Pros:**
122127

@@ -180,17 +185,17 @@ Https server receiving findings and returning results.
180185

181186
Regarding the Question 1 it seems that both solution approaches are resulting in the same execution model. We descided to implement solution approach 1 and unify both concepts into a more general concept with the name _"hook concept"_. Therefore we exchange the existing name `persistenceProvider` for phase 3 in the excecution model with a more general term `DataProcessing`:
182187

183-
```
184-
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
185-
│ Scanning ├─────────▶│ Parsing ├─────────▶│ DataProcessing │
186-
│ (Phase 1) │ │ (Phase 2) │ │ (Phase 3) │
187-
└──────────────────┘ └──────────────────┘ └──────────────────┘
188-
```
188+
....
189+
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
190+
│ Scanning ├─────────▶│ Parsing ├─────────▶│ DataProcessing │
191+
│ (Phase 1) │ │ (Phase 2) │ │ (Phase 3) │
192+
└──────────────────┘ └──────────────────┘ └──────────────────┘
193+
....
189194

190195
Regarding the Question 2 we decided to implement the solution approach 1 with a job-based approach (no active service componend needed).
191196
The Phase 3 `DataProcessing` will be therefore splitt into to seperate phases named `ReadAndWriteHooks (3.1)` and `ReadOnlyHooks (3.2)`
192197

193-
```
198+
....
194199
┌ DataProcessing: ReadOnlyHooks ─ ─ ─
195200
┌ DataProcessing: ReadAndWriteHooks ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┌────────────────────────────────┐ │
196201
┌───────────────────────┐ │ ┌──┼▶│ Elastic PersistenceProvider │
@@ -199,7 +204,7 @@ The Phase 3 `DataProcessing` will be therefore splitt into to seperate phases na
199204
└──────────────────┘ └──────────────────┘ │ └───────────────────────┘ └───────────────────────┘ └───▶│ DefectDojo PersistenceProvider │ │
200205
─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘ │ └────────────────────────────────┘
201206
─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘
202-
```
207+
....
203208

204209
== Consequences
205210

0 commit comments

Comments
 (0)