Skip to content

Commit

Permalink
git pu
Browse files Browse the repository at this point in the history
  • Loading branch information
cmendible committed Jan 29, 2024
1 parent a88ec10 commit 0419a66
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions internal/scanners/ca/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (a *ContainerAppsScanner) GetRules() map[string]scanners.AzureRule {
Severity: scanners.SeverityLow,
Eval: func(target interface{}, scanContext *scanners.ScanContext) (bool, string) {
c := target.(*armappcontainers.ContainerApp)
if c.Properties.Configuration.Ingress != nil && c.Properties.Configuration.Ingress.AllowInsecure != nil {
if c.Properties.Configuration != nil && c.Properties.Configuration.Ingress != nil && c.Properties.Configuration.Ingress.AllowInsecure != nil {
return *c.Properties.Configuration.Ingress.AllowInsecure, ""
}
return false, ""
Expand Down Expand Up @@ -87,7 +87,7 @@ func (a *ContainerAppsScanner) GetRules() map[string]scanners.AzureRule {
Eval: func(target interface{}, scanContext *scanners.ScanContext) (bool, string) {
c := target.(*armappcontainers.ContainerApp)
ok := true
if c.Properties.Template.Volumes != nil {
if c.Properties.Template != nil && c.Properties.Template.Volumes != nil {
for _, v := range c.Properties.Template.Volumes {
if *v.StorageType != armappcontainers.StorageTypeAzureFile {
ok = false
Expand All @@ -107,9 +107,10 @@ func (a *ContainerAppsScanner) GetRules() map[string]scanners.AzureRule {
Severity: scanners.SeverityLow,
Eval: func(target interface{}, scanContext *scanners.ScanContext) (bool, string) {
c := target.(*armappcontainers.ContainerApp)
return c.Properties.Configuration.Ingress != nil &&
c.Properties.Configuration.Ingress.StickySessions != nil &&
c.Properties.Configuration.Ingress.StickySessions.Affinity != nil &&
return c.Properties.Configuration != nil &&
c.Properties.Configuration.Ingress != nil &&
c.Properties.Configuration.Ingress.StickySessions != nil &&
c.Properties.Configuration.Ingress.StickySessions.Affinity != nil &&
*c.Properties.Configuration.Ingress.StickySessions.Affinity == armappcontainers.AffinitySticky, ""
},
Url: "https://learn.microsoft.com/en-us/azure/container-apps/sticky-sessions?pivots=azure-portal",
Expand Down

0 comments on commit 0419a66

Please sign in to comment.