Draft: Use typed recursive security report values
Note
This MR was created as an exploratory proof-of-concept about rendering typed, recursive details from security reports.
This MR is superseded by gitlab-org/gitlab: Draft: Adds security report details field rendering , which is a more evolved/complete implementation of this concept.
What does this MR do?
This MR is a proof-of-concept of analyzers using core data types to describe their specific data. All required fields appear in the vulnerability details dialog as normal, with the analyzer-specific, potentially recursive, free-form data in the table below.
Supported core data types in this MR:
report_items
├── code.vue
├── file_location.vue
├── hex_int.vue
├── label_value.vue
├── label.vue
├── link.vue
├── list.vue
├── module_location.vue
├── named_list.vue
└── plain.vue
0 directories, 10 files
Screenshots
This screenshot reflects the current version of the code (and will be updated as new commits are pushed)
Notice the Hello World
value and other values below Hello World...
. These are generated from a report_data
field in a gl-sast-report.json
file:
"report_data": {
"Hello World": {
"type": "plain",
"value": "Testing"
},
"Relevant Links": {
"type": "list",
"items": [
{"type": "link", "url": "https://gitlab.com/1"},
{"type": "link", "url": "https://gitlab.com/2", "alt": "Alt Text"},
{"type": "link", "url": "https://gitlab.com/3", "alt": "Alt Text", "text": "GitLab.com"}
]
},
"A Code Block": {
"type": "code",
"code": "def hello_world()\n puts \"Hello World!\"\n\nhello_world"
},
"Nested Values": {
"type": "named-list",
"items": {
"Hello World Again": {
"type": "plain",
"value": "Nested List"
},
"File Location": {
"type": "file-location",
"path": "some_path.ext",
"lineStart": 5,
"lineEnd": 10,
"gitRef": "master"
},
"Module Location": {
"type": "module-location",
"module": "amodule",
"offset": 234234234
},
"Stack Trace": {
"type": "list",
"items": [
{
"type": "module-location",
"module": "amodule",
"offset": 12345
},
{
"type": "module-location",
"module": "amodule",
"offset": 12345
},
{
"type": "module-location",
"module": "amodule",
"offset": 12345
},
{
"type": "module-location",
"module": "amodule",
"offset": 12345
},
{
"type": "module-location",
"module": "amodule",
"offset": 12345
}
]
},
"Disassembly": {
"type": "code",
"code": "int3\nint3\nint3\nxor eax, eax\nmov [eax], 1"
},
"Registers": {
"type": "named-list",
"items": {
"rax": { "type": "hex-int", "value": 0 },
"rbx": { "type": "hex-int", "value": 1094795585 },
"rcx": { "type": "hex-int", "value": 4027448014 }
}
}
}
}
},
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team