Skip to content

Commit

Permalink
Cover unguarded direct datastore access with unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Yevhen Zavhorodnii committed Jun 4, 2024
1 parent 6c3cdd9 commit 87b4108
Show file tree
Hide file tree
Showing 2 changed files with 416 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,12 @@ func (r *UnguardedDirectDatastoreAccessRule) GenerateRisks(input *types.Model) (
continue
}

acrossTrustBoundaryNetworkOnly := incomingAccess.IsAcrossTrustBoundaryNetworkOnly(input)
sharingSameParentTrustBoundary := isSharingSameParentTrustBoundary(input, technicalAsset, sourceAsset)

if technicalAsset.Confidentiality >= types.Confidential || technicalAsset.Integrity >= types.Critical {
if incomingAccess.IsAcrossTrustBoundaryNetworkOnly(input) && !fileServerAccessViaFTP(technicalAsset, incomingAccess) &&
incomingAccess.Usage != types.DevOps && !isSharingSameParentTrustBoundary(input, technicalAsset, sourceAsset) {
if acrossTrustBoundaryNetworkOnly && !fileServerAccessViaFTP(technicalAsset, incomingAccess) &&
incomingAccess.Usage != types.DevOps && !sharingSameParentTrustBoundary {
highRisk := technicalAsset.Confidentiality == types.StrictlyConfidential ||
technicalAsset.Integrity == types.MissionCritical
risks = append(risks, r.createRisk(technicalAsset, incomingAccess,
Expand Down
Loading

0 comments on commit 87b4108

Please sign in to comment.