Skip to content

Commit

Permalink
fixed message and var names
Browse files Browse the repository at this point in the history
  • Loading branch information
cmendible committed Jul 4, 2023
1 parent b543cb9 commit 787551d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions internal/scanners/vwan/vwan.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ func (c *VirtualWanScanner) Init(config *scanners.ScannerConfig) error {

// Scan - Scans all WebPubSub in a Resource Group
func (c *VirtualWanScanner) Scan(resourceGroupName string, scanContext *scanners.ScanContext) ([]scanners.AzureServiceResult, error) {
log.Info().Msgf("Scanning WebPubSub in Resource Group %s", resourceGroupName)
log.Info().Msgf("Scanning Virtual WAN in Resource Group %s", resourceGroupName)

WebPubSub, err := c.list(resourceGroupName)
vwans, err := c.list(resourceGroupName)
if err != nil {
return nil, err
}
engine := scanners.RuleEngine{}
rules := c.GetRules()
results := []scanners.AzureServiceResult{}

for _, w := range WebPubSub {
for _, w := range vwans {
rr := engine.EvaluateRules(rules, w, scanContext)

results = append(results, scanners.AzureServiceResult{
Expand All @@ -54,13 +54,13 @@ func (c *VirtualWanScanner) Scan(resourceGroupName string, scanContext *scanners
func (c *VirtualWanScanner) list(resourceGroupName string) ([]*armnetwork.VirtualWAN, error) {
pager := c.client.NewListByResourceGroupPager(resourceGroupName, nil)

vwas := make([]*armnetwork.VirtualWAN, 0)
vwans := make([]*armnetwork.VirtualWAN, 0)
for pager.More() {
resp, err := pager.NextPage(c.config.Ctx)
if err != nil {
return nil, err
}
vwas = append(vwas, resp.Value...)
vwans = append(vwans, resp.Value...)
}
return vwas, nil
return vwans, nil
}

0 comments on commit 787551d

Please sign in to comment.