Skip to content

Commit

Permalink
improve xcreate policy rule
Browse files Browse the repository at this point in the history
  • Loading branch information
attiasas committed Dec 15, 2024
1 parent efd7feb commit e1f513b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions xray/services/utils/policybody.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,19 @@ func CreateSeverityPolicyCriteria(minSeverity Severity) *PolicyCriteria {
}
}

func CreateExposuresPolicyCriteria(minSeverity Severity, secrets, applications, services, iac, maliciousCode bool) *PolicyExposureCriteria {
criteria := &PolicyExposureCriteria{MinSeverity: minSeverity}
func CreateExposuresPolicyCriteria(minSeverity Severity, secrets, applications, services, iac, maliciousCode bool) *PolicyCriteria {
criteria := &PolicyCriteria{Exposures: &PolicyExposureCriteria{MinSeverity: minSeverity}}
if secrets {
criteria.Secrets = &secrets
criteria.Exposures.Secrets = &secrets
}
if applications {
criteria.Applications = &applications
criteria.Exposures.Applications = &applications
}
if services {
criteria.Services = &services
criteria.Exposures.Services = &services
}
if iac {
criteria.IaC = &iac
criteria.Exposures.IaC = &iac
}
return criteria
}
Expand Down

0 comments on commit e1f513b

Please sign in to comment.