Skip to content

Commit 3f98052

Browse files
committed
reference cleanup
1 parent a7f4f94 commit 3f98052

File tree

8 files changed

+42
-42
lines changed

8 files changed

+42
-42
lines changed

cmd/azqr/rules.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ var rulesCmd = &cobra.Command{
2424
Args: cobra.NoArgs,
2525
Run: func(cmd *cobra.Command, args []string) {
2626
_, serviceScanners := scanners.GetScanners()
27-
aprlScanner := internal.AprlScanner{}
27+
aprlScanner := internal.NewAprlScanner(serviceScanners, nil, nil)
2828
aprl := aprlScanner.GetAprlRecommendations()
2929

30+
// Print count of aprl recommendations
31+
fmt.Println("## APRL Recommendations")
32+
fmt.Println("Total recommendations:", len(aprl))
33+
3034
fmt.Println("# | Id | Resource Type | Category | Impact | Recommendation | Learn")
3135
fmt.Println("---|---|---|---|---|---|---")
3236

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ require (
5050
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager v1.3.0
5151
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/virtualmachineimagebuilder/armvirtualmachineimagebuilder/v2 v2.3.0
5252
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/webpubsub/armwebpubsub v1.3.0
53-
github.com/google/uuid v1.6.0
5453
github.com/rs/zerolog v1.33.0
5554
github.com/spf13/cobra v1.9.1
5655
github.com/xuri/excelize/v2 v2.9.0
@@ -61,6 +60,7 @@ require (
6160
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
6261
github.com/AzureAD/microsoft-authentication-library-for-go v1.3.3 // indirect
6362
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
63+
github.com/google/uuid v1.6.0 // indirect
6464
github.com/inconshreveable/mousetrap v1.1.0 // indirect
6565
github.com/kylelemons/godebug v1.1.0 // indirect
6666
github.com/mattn/go-colorable v0.1.13 // indirect

internal/azure-orphan-resources/Compute/queries.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
potentialBenefits: Identifies unused resources
1111
pgVerified: false
1212
automationAvailable: false
13-
tags: null
13+
tags: []
1414
learnMoreLink:
1515
- name: Availability Sets
1616
url: "https://learn.microsoft.com/en-us/azure/virtual-machines/availability-set-overview"
@@ -27,7 +27,7 @@
2727
potentialBenefits: Identifies unused resources
2828
pgVerified: false
2929
automationAvailable: false
30-
tags: null
30+
tags: []
3131
learnMoreLink:
3232
- name: Managed Disks
3333
url: "https://learn.microsoft.com/en-us/azure/virtual-machines/managed-disks-overview"

internal/azure-orphan-resources/Network/queries.yaml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
potentialBenefits: Identifies unused resources
1111
pgVerified: false
1212
automationAvailable: false
13-
tags: null
13+
tags: []
1414
learnMoreLink:
1515
- name: Public IPs
1616
url: "https://learn.microsoft.com/en-us/azure/virtual-network/ip-services/public-ip-addresses"
@@ -27,7 +27,7 @@
2727
potentialBenefits: Identifies unused resources
2828
pgVerified: false
2929
automationAvailable: false
30-
tags: null
30+
tags: []
3131
learnMoreLink:
3232
- name: Network Interfaces
3333
url: "https://learn.microsoft.com/en-us/azure/virtual-network/ip-services/private-ip-addresses"
@@ -44,7 +44,7 @@
4444
potentialBenefits: Identifies unused resources
4545
pgVerified: false
4646
automationAvailable: false
47-
tags: null
47+
tags: []
4848
learnMoreLink:
4949
- name: Network Security Groups
5050
url: "https://learn.microsoft.com/en-us/azure/virtual-network/ip-services/private-ip-addresses"
@@ -61,7 +61,7 @@
6161
potentialBenefits: Identifies unused resources
6262
pgVerified: false
6363
automationAvailable: false
64-
tags: null
64+
tags: []
6565
learnMoreLink:
6666
- name: Route Tables
6767
url: "https://learn.microsoft.com/en-us/azure/virtual-network/virtual-networks-udr-overview"
@@ -78,7 +78,7 @@
7878
potentialBenefits: Identifies unused resources
7979
pgVerified: false
8080
automationAvailable: false
81-
tags: null
81+
tags: []
8282
learnMoreLink:
8383
- name: Load Balancers
8484
url: "https://learn.microsoft.com/en-us/azure/load-balancer/load-balancer-overview"
@@ -95,7 +95,7 @@
9595
potentialBenefits: Identifies unused resources
9696
pgVerified: false
9797
automationAvailable: false
98-
tags: null
98+
tags: []
9999
learnMoreLink:
100100
- name: Front Door WAF Policy
101101
url: "https://learn.microsoft.com/en-us/azure/web-application-firewall/afds/afds-overview"
@@ -112,7 +112,7 @@
112112
potentialBenefits: Identifies unused resources
113113
pgVerified: false
114114
automationAvailable: false
115-
tags: null
115+
tags: []
116116
learnMoreLink:
117117
- name: Traffic Manager
118118
url: "https://learn.microsoft.com/en-us/azure/traffic-manager/traffic-manager-overview"
@@ -129,7 +129,7 @@
129129
potentialBenefits: Identifies unused resources
130130
pgVerified: false
131131
automationAvailable: false
132-
tags: null
132+
tags: []
133133
learnMoreLink:
134134
- name: Application Gateways
135135
url: "https://learn.microsoft.com/azure/application-gateway/overview"
@@ -146,7 +146,7 @@
146146
potentialBenefits: Identifies unused resources
147147
pgVerified: false
148148
automationAvailable: false
149-
tags: null
149+
tags: []
150150
learnMoreLink:
151151
- name: Virtual Networks
152152
url: "https://learn.microsoft.com/azure/virtual-network/virtual-networks-overview"
@@ -163,7 +163,7 @@
163163
potentialBenefits: Identifies unused resources
164164
pgVerified: false
165165
automationAvailable: false
166-
tags: null
166+
tags: []
167167
learnMoreLink:
168168
- name: Subnets
169169
url: "https://learn.microsoft.com/azure/virtual-network/virtual-networks-overview"
@@ -180,7 +180,7 @@
180180
potentialBenefits: Identifies unused resources
181181
pgVerified: false
182182
automationAvailable: false
183-
tags: null
183+
tags: []
184184
learnMoreLink:
185185
- name: NAT Gateways
186186
url: "https://learn.microsoft.com/azure/nat-gateway/nat-overview"
@@ -197,7 +197,7 @@
197197
potentialBenefits: Identifies unused resources
198198
pgVerified: false
199199
automationAvailable: false
200-
tags: null
200+
tags: []
201201
learnMoreLink:
202202
- name: IP Groups
203203
url: "https://learn.microsoft.com/azure/firewall/ip-groups"
@@ -214,7 +214,7 @@
214214
potentialBenefits: Identifies unused resources
215215
pgVerified: false
216216
automationAvailable: false
217-
tags: null
217+
tags: []
218218
learnMoreLink:
219219
- name: Private DNS zones
220220
url: "https://learn.microsoft.com/en-us/azure/dns/private-dns-privatednszone"
@@ -231,7 +231,7 @@
231231
potentialBenefits: Identifies unused resources
232232
pgVerified: false
233233
automationAvailable: false
234-
tags: null
234+
tags: []
235235
learnMoreLink:
236236
- name: Private Endpoints
237237
url: "https://learn.microsoft.com/en-us/azure/private-link/private-endpoint-overview"
@@ -248,7 +248,7 @@
248248
potentialBenefits: Identifies unused resources
249249
pgVerified: false
250250
automationAvailable: false
251-
tags: null
251+
tags: []
252252
learnMoreLink:
253253
- name: Virtual Network Gateways
254254
url: "https://learn.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-about-vpngateways"
@@ -265,7 +265,7 @@
265265
potentialBenefits: Identifies unused resources
266266
pgVerified: false
267267
automationAvailable: false
268-
tags: null
268+
tags: []
269269
learnMoreLink:
270270
- name: DDoS protection
271271
url: "https://learn.microsoft.com/en-us/azure/ddos-protection/ddos-protection-overview"

internal/azure-orphan-resources/Resources/queries.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
potentialBenefits: Identifies unused resources
1111
pgVerified: false
1212
automationAvailable: false
13-
tags: null
13+
tags: []
1414
learnMoreLink:
1515
- name: Resource Groups
1616
url: "https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/overview"

internal/azure-orphan-resources/Sql/queries.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
potentialBenefits: Identifies unused resources
1111
pgVerified: false
1212
automationAvailable: false
13-
tags: null
13+
tags: []
1414
learnMoreLink:
1515
- name: SQL elastic pool
1616
url: "https://learn.microsoft.com/en-us/azure/azure-sql/database/elastic-pool-overview"

internal/azure-orphan-resources/Web/queries.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
potentialBenefits: Identifies unused resources
1111
pgVerified: false
1212
automationAvailable: false
13-
tags: null
13+
tags: []
1414
learnMoreLink:
1515
- name: App Service plans
1616
url: "https://learn.microsoft.com/en-us/azure/app-service/overview-hosting-plans"
@@ -27,7 +27,7 @@
2727
potentialBenefits: Identifies unused resources
2828
pgVerified: false
2929
automationAvailable: false
30-
tags: null
30+
tags: []
3131
learnMoreLink:
3232
- name: API Connections
3333
url: "https://learn.microsoft.com/en-us/azure/logic-apps/logic-apps-overview"
@@ -44,7 +44,7 @@
4444
potentialBenefits: Identifies expired certificates
4545
pgVerified: false
4646
automationAvailable: false
47-
tags: null
47+
tags: []
4848
learnMoreLink:
4949
- name: Certificates
5050
url: "https://learn.microsoft.com/en-us/azure/app-service/configure-ssl-certificate"

internal/scanners/azqr.go

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -105,20 +105,18 @@ type (
105105
}
106106

107107
AprlRecommendation struct {
108-
RecommendationID string `yaml:"aprlGuid"`
109-
Recommendation string `yaml:"description"`
110-
Category string `yaml:"recommendationControl"`
111-
Impact string `yaml:"recommendationImpact"`
112-
ResourceType string `yaml:"recommendationResourceType"`
113-
MetadataState string `yaml:"recommendationMetadataState"`
114-
LongDescription string `yaml:"longDescription"`
115-
PotentialBenefits string `yaml:"potentialBenefits"`
116-
PgVerified bool `yaml:"pgVerified"`
117-
PublishedToLearn bool `yaml:"publishedToLearn"`
118-
PublishedToAdvisor bool `yaml:"publishedToAdvisor"`
119-
AutomationAvailable string `yaml:"automationAvailable"`
120-
Tags string `yaml:"tags,omitempty"`
121-
GraphQuery string `yaml:"graphQuery,omitempty"`
108+
RecommendationID string `yaml:"aprlGuid"`
109+
Recommendation string `yaml:"description"`
110+
Category string `yaml:"recommendationControl"`
111+
Impact string `yaml:"recommendationImpact"`
112+
ResourceType string `yaml:"recommendationResourceType"`
113+
MetadataState string `yaml:"recommendationMetadataState"`
114+
LongDescription string `yaml:"longDescription"`
115+
PotentialBenefits string `yaml:"potentialBenefits"`
116+
PgVerified bool `yaml:"pgVerified"`
117+
AutomationAvailable string `yaml:"automationAvailable"`
118+
Tags []string `yaml:"tags,omitempty"`
119+
GraphQuery string `yaml:"graphQuery,omitempty"`
122120
LearnMoreLink []struct {
123121
Name string `yaml:"name"`
124122
Url string `yaml:"url"`
@@ -202,10 +200,8 @@ func (r *AzqrRecommendation) ToAzureAprlRecommendation() AprlRecommendation {
202200
LongDescription: r.Recommendation,
203201
PotentialBenefits: "",
204202
PgVerified: false,
205-
PublishedToLearn: false,
206-
PublishedToAdvisor: false,
207203
AutomationAvailable: "",
208-
Tags: "",
204+
Tags: nil,
209205
GraphQuery: "",
210206
LearnMoreLink: []struct {
211207
Name string "yaml:\"name\""

0 commit comments

Comments
 (0)