Skip to content

Commit

Permalink
Fixing #270 & #268
Browse files Browse the repository at this point in the history
  • Loading branch information
cmendible committed Nov 6, 2024
1 parent 35ca1eb commit 6552394
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
11 changes: 10 additions & 1 deletion internal/scanners/pip/pip.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (c *PublicIPScanner) Scan(scanContext *azqr.ScanContext) ([]azqr.AzqrServic
SubscriptionName: c.config.SubscriptionName,
ResourceGroup: azqr.GetResourceGroupFromResourceID(*w.ID),
ServiceName: *w.Name,
Type: *w.Type,
Type: parseType(w.Type),
Location: *w.Location,
Recommendations: rr,
})
Expand All @@ -67,3 +67,12 @@ func (c *PublicIPScanner) list() ([]*armnetwork.PublicIPAddress, error) {
func (a *PublicIPScanner) ResourceTypes() []string {
return []string{"Microsoft.Network/publicIPAddresses"}
}


func parseType(t *string) string {
if t == nil {
return "Microsoft.Network/publicIPAddresses"
}
return *t
}

8 changes: 7 additions & 1 deletion internal/scanners/rt/rt.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (c *RouteTableScanner) Scan(scanContext *azqr.ScanContext) ([]azqr.AzqrServ
ResourceGroup: azqr.GetResourceGroupFromResourceID(*w.ID),
ServiceName: *w.Name,
Type: *w.Type,
Location: *w.Location,
Location: parseLocation(w.Location),
Recommendations: rr,
})
}
Expand All @@ -68,3 +68,9 @@ func (a *RouteTableScanner) ResourceTypes() []string {
return []string{"Microsoft.Network/routeTables"}
}

func parseLocation(l *string) string {
if l == nil {
return ""
}
return *l
}

0 comments on commit 6552394

Please sign in to comment.