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

refactor: extend misconfiguration API and UI models #1172

Merged
merged 4 commits into from
Feb 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 19 additions & 13 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1677,7 +1677,7 @@ components:
state:
description: |
Describes the state of Scan.

| State | Description |
| ---------- | ----------------------------------------------------------------------------- |
| Pending | The initial state when the scan is created, and is working to discover assets |
Expand All @@ -1704,7 +1704,7 @@ components:
reason:
description: |
Machine readable reason for state transition.

| State | Reason | Description |
| ---------- | ----------------- | ---------------------------------------------------------- |
| Pending | Created | Scan is pending as it has been newly created |
Expand Down Expand Up @@ -2037,7 +2037,7 @@ components:
description: 'Runtime schedule scan configuration.
If only operationTime is set, it will be a single scan scheduled for the operationTime.
If only cronLine is set, the current time will be the "from time" to start the scheduling according to the cronLine.
If both operationTime and cronLine are set, the first scan will run at operationTime
If both operationTime and cronLine are set, the first scan will run at operationTime
and the operationTime will be the first time that the cronLine will be effective from.'
properties:
cronLine:
Expand Down Expand Up @@ -2252,7 +2252,7 @@ components:
location:
type: string
image:
$ref: '#/components/schemas/ContainerImageInfo'
$ref: '#/components/schemas/ContainerImageInfo'
containerID:
type: string
createdAt:
Expand Down Expand Up @@ -2335,7 +2335,7 @@ components:
state:
description: |
Describes the state of resource cleanup.

| State | Description |
| ------- | ---------------------------------------------------------- |
| Pending | Initial state for cleaning up resources |
Expand Down Expand Up @@ -2535,7 +2535,7 @@ components:
state:
description: |
Describes the state of a scanner on the asset.

| State | Description |
| ----------- | ------------------------------------------------------------------------ |
| Pending | Scanner is pending and waits for state transition to InProgress state |
Expand Down Expand Up @@ -3086,20 +3086,26 @@ components:
properties:
scannerName:
type: string
scannedPath:
type: string
testCategory:
id:
type: string
testID:
description: Check or test ID, if applicable (e.g. Lynis TestID, CIS Docker Benchmark checkpoint code, etc)
location:
type: string
testDescription:
description: Location within the asset where the misconfiguration was recorded (e.g. filesystem path)
category:
type: string
severity:
$ref: '#/components/schemas/MisconfigurationSeverity'
description: Specifies misconfiguration impact category
message:
type: string
description: Short info about the misconfiguration
description:
type: string
description: Additional context such as the potential impact
remediation:
type: string
description: Possible fix for the misconfiguration
severity:
$ref: '#/components/schemas/MisconfigurationSeverity'

Secret:
type: object
Expand Down
34 changes: 17 additions & 17 deletions api/server/database/gorm/odata.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,14 +364,14 @@ var schemaMetas = map[string]odatasql.SchemaMeta{
},
"Misconfiguration": {
Fields: odatasql.Schema{
"scannerName": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"scannedPath": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"testCategory": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"testID": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"testDescription": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"severity": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"message": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"remediation": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"scannerName": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"location": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"category": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"id": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"description": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"severity": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"message": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"remediation": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
},
},
"RootkitScan": {
Expand Down Expand Up @@ -985,15 +985,15 @@ var schemaMetas = map[string]odatasql.SchemaMeta{
},
"MisconfigurationFindingInfo": {
Fields: odatasql.Schema{
"objectType": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"scannerName": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"scannedPath": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"testCategory": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"testID": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"testDescription": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"severity": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"message": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"remediation": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"objectType": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"scannerName": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"location": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"category": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"id": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"description": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"severity": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"message": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
"remediation": odatasql.FieldMeta{FieldType: odatasql.StringFieldType},
},
},
"InfoFinderFindingInfo": {
Expand Down
Loading
Loading