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

Commit

Permalink
Rename Target to Asset and ScanResult to AssetScan
Browse files Browse the repository at this point in the history
This aligns with the UX and also aligns better with the objects'
purposes. This is a breaking change with no migration, VMClarity will
need to be reinstalled after this change.
  • Loading branch information
Tehsmash committed Jun 30, 2023
1 parent a3ef86b commit f454d36
Show file tree
Hide file tree
Showing 90 changed files with 4,682 additions and 4,683 deletions.
10 changes: 5 additions & 5 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ The VMClarity infrastructure includes:
system. This is the only component in the system which talks to the DB.

- **Orchestrator**: Orchestrates and manages the life cycle of VMClarity scan
configs, scans and scan results. Within the Orchestrator there is a
configs, scans and asset scans. Within the Orchestrator there is a
pluggable "provider" which connects the orchstrator to the environment to be
scanned and abstracts target discovery, VM snapshotting as well as creation of
scanned and abstracts asset discovery, VM snapshotting as well as creation of
the scanner VMs. (**Note** The only supported provider today is AWS, other
hyperscalers are on the roadmap)

Expand Down Expand Up @@ -47,11 +47,11 @@ docker in an dedicated AWS Virtual Private Cloud (VPC).
Once the VMClarity server instance has been deployed, and the scan
configurations have been created, VMClarity will discover VM resources within
the scan range defined by the scan configuration (e.g., by region, instance
tag, and security group). Once the target list has been created, snapshots of
the targets are taken, and a new scanner VM are launched using the snapshots as
tag, and security group). Once the asset list has been created, snapshots of
the assets are taken, and a new scanner VM are launched using the snapshots as
attached volumes. The VMClarity CLI running within the scanner VM will perform
the configured analysis on the mounted snapshot, and report the results to the
VMClarity API. These results are then processed by the VMClarity backend into
findings.

![VMClarity Architecture Overview](img/vmclarity-arch-20230406.svg)
![VMClarity Architecture Overview](img/vmclarity-arch-20230406.svg)
2,328 changes: 1,164 additions & 1,164 deletions api/client/client.gen.go

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions api/models/scanresult.go → api/models/assetscan.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

package models

func (r *TargetScanResult) GetGeneralState() (TargetScanStateState, bool) {
var state TargetScanStateState
func (r *AssetScan) GetGeneralState() (AssetScanStateState, bool) {
var state AssetScanStateState
var ok bool

if r.Status != nil {
Expand All @@ -26,7 +26,7 @@ func (r *TargetScanResult) GetGeneralState() (TargetScanStateState, bool) {
return state, ok
}

func (r *TargetScanResult) GetGeneralErrors() []string {
func (r *AssetScan) GetGeneralErrors() []string {
var errs []string

if r.Status != nil {
Expand All @@ -36,7 +36,7 @@ func (r *TargetScanResult) GetGeneralErrors() []string {
return errs
}

func (r *TargetScanResult) GetID() (string, bool) {
func (r *AssetScan) GetID() (string, bool) {
var id string
var ok bool

Expand All @@ -47,7 +47,7 @@ func (r *TargetScanResult) GetID() (string, bool) {
return id, ok
}

func (r *TargetScanResult) GetScanID() (string, bool) {
func (r *AssetScan) GetScanID() (string, bool) {
var scanID string
var ok bool

Expand All @@ -58,30 +58,30 @@ func (r *TargetScanResult) GetScanID() (string, bool) {
return scanID, ok
}

func (r *TargetScanResult) GetTargetID() (string, bool) {
var targetID string
func (r *AssetScan) GetAssetID() (string, bool) {
var assetID string
var ok bool

if r.Target != nil {
targetID, ok = r.Target.Id, true
if r.Asset != nil {
assetID, ok = r.Asset.Id, true
}

return targetID, ok
return assetID, ok
}

func (r *TargetScanResult) IsDone() (bool, bool) {
func (r *AssetScan) IsDone() (bool, bool) {
var done bool
var ok bool
var state TargetScanStateState
var state AssetScanStateState

if state, ok = r.GetGeneralState(); ok && state == TargetScanStateStateDone {
if state, ok = r.GetGeneralState(); ok && state == AssetScanStateStateDone {
done = true
}

return done, ok
}

func (r *TargetScanResult) HasErrors() bool {
func (r *AssetScan) HasErrors() bool {
var has bool

if errs := r.GetGeneralErrors(); len(errs) > 0 {
Expand Down
Loading

0 comments on commit f454d36

Please sign in to comment.