You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 14, 2020. It is now read-only.
Copy file name to clipboardExpand all lines: docs/adr/adr_0001.adoc
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@
23
23
24
24
=== Status Quo
25
25
26
-
One major challange implementing the _secureCodeBox_ is to provide an 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 an single security scan (instance of scanType CRD) in 3 major phases:
26
+
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:
@@ -34,18 +34,18 @@ By now the "Persisting Phase 3" was implemented by so called _persistenceProvide
34
34
35
35
=== Problem and Question
36
36
37
-
We identified different additional UseCases with a are 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 persisted also.
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.
38
38
39
39
40
-
To find a proper solution we splitted the topic into the follwong two questions:
40
+
To find a proper solution, we splitted the topic into the follwong two questions:
41
41
42
42
* Question 1: Should we unify the concepts MetaDataProvider and PersistenceProvider?
43
-
* Question 2: How should the execution model look like for each?
43
+
* Question 2: How should the execution model look like for each concept?
44
44
45
45
==== Question 1: Should we unify the concepts MetaDataProvider and PersistenceProvider?
46
46
==== Solution approach 1: Unify
47
47
48
-
Both "modules" are "processing" the security findings which are generated in the parsing phase.
48
+
Both "modules" are "processing" the security findings, which are generated in the parsing phase.
49
49
But there is one larger difference between them:
50
50
51
51
* `PersistenceProvider` is proccesing the findings with a *ReadOnly* pattern
We could do a similar thing and introduce CRD which allows to execute "custom code" (generally speaking, depends on the second question) after a scan has completed (meaning scan and parser phase are done). Some name ideas:
61
+
We could do a similar thing and introduce CRD which allows to execute "custom code" (generally speaking, depends on the second question) after a scan has completed (meaning both scan and parser phases are done). Some name ideas:
62
62
63
63
- `ScanHooks`
64
64
- `ScanCompletionHooks`
65
65
- `FindingProcessors`
66
66
67
-
These could than have a `type` attribute which declares if they are `ReadOnly` or `ReadAndWrite`.
67
+
These could be implemented with a `type` attribute, which declares if they are `ReadOnly` or `ReadAndWrite`.
68
68
69
69
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).
70
70
@@ -99,9 +99,9 @@ The Execution Flow would then look something like this:
99
99
100
100
**Cons:**
101
101
102
-
- Possible "overabstraction"?
102
+
- Possible "over-abstraction"?
103
103
- Need to refactor the ElasticSearch PersistenceProvider
104
-
- The "General Implementation" will be harder than the individual ones -
104
+
- The "General Implementation" will be harder than the individual ones
105
105
106
106
==== Solution approach 1: Keep Split between Persistence Provider and MetaData Provider
107
107
@@ -187,7 +187,7 @@ Regarding the Question 1 it seems that both solution approaches are resulting in
Regarding the question 2 we descided to implement the solution approach 1 with a jobbased approach (no active service componend needed).
190
+
Regarding the Question 2 we decided to implement the solution approach 1 with a job-based approach (no active service componend needed).
191
191
The Phase 3 `DataProcessing` will be therefore splitt into to seperate phases named `ReadAndWriteHooks (3.1)` and `ReadOnlyHooks (3.2)`
192
192
193
193
```
@@ -203,11 +203,11 @@ The Phase 3 `DataProcessing` will be therefore splitt into to seperate phases na
203
203
204
204
== Consequences
205
205
206
-
With the new `Hook Concept` we open the `DataProcessing` Phase 3 to a more intuitive and flexible architecture. It is easier to understand because _WebHooks_ are already a well known concept. It is possible to keep the existing implementation of the `persistenceProviders` and to integrate them with a lot of other possible data processing components in a more general fashion. In the end this step will result in a lot of additional feature possibilities which go fare beyond the existing ones. Therefore we only need to implement this concept once in the secureCodeBox Operator and new ideas for extending the DataProcessing will not enforce conceptual or architectural changes.
206
+
With the new `Hook Concept` we open the `DataProcessing` Phase 3 to a more intuitive and flexible architecture. It is easier to understand because _WebHooks_ are already a well known concept. It is possible to keep the existing implementation of the `persistenceProviders` and to integrate them with a lot of other possible data processing components in a more general fashion. In the end, this step will result in a lot of additional feature possibilities, which go fare beyond the existing ones. Therefore we only need to implement this concept once in the secureCodeBox Operator and new ideas for extending the DataProcessing will not enforce conceptual or architectural changes.
207
207
208
208
Ideas for additional data processing hooks:
209
209
* Notifier-Hooks (ReadOnlyHook) e.g. for chat systems (slack, teams...) or metric / alerting systems
0 commit comments