-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
820 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
package it | ||
|
||
import ( | ||
"strings" | ||
|
||
"github.com/Azure/azqr/internal/azqr" | ||
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/virtualmachineimagebuilder/armvirtualmachineimagebuilder/v2" | ||
) | ||
|
||
// GetRules - Returns the rules for the ImageTemplateScanner | ||
func (a *ImageTemplateScanner) GetRecommendations() map[string]azqr.AzqrRecommendation { | ||
return map[string]azqr.AzqrRecommendation{ | ||
"it-006": { | ||
RecommendationID: "it-006", | ||
ResourceType: "Microsoft.VirtualMachineImages/imageTemplates", | ||
Category: azqr.CategoryGovernance, | ||
Recommendation: "Image Template Name should comply with naming conventions", | ||
Impact: azqr.ImpactLow, | ||
Eval: func(target interface{}, scanContext *azqr.ScanContext) (bool, string) { | ||
c := target.(*armvirtualmachineimagebuilder.ImageTemplate) | ||
caf := strings.HasPrefix(*c.Name, "it") | ||
return !caf, "" | ||
}, | ||
LearnMoreUrl: "https://learn.microsoft.com/en-us/azure/cloud-adoption-framework/ready/azure-best-practices/resource-abbreviations", | ||
}, | ||
"it-007": { | ||
RecommendationID: "it-007", | ||
ResourceType: "Microsoft.VirtualMachineImages/imageTemplates", | ||
Category: azqr.CategoryGovernance, | ||
Recommendation: "Image Template should have tags", | ||
Impact: azqr.ImpactLow, | ||
Eval: func(target interface{}, scanContext *azqr.ScanContext) (bool, string) { | ||
c := target.(*armvirtualmachineimagebuilder.ImageTemplate) | ||
return len(c.Tags) == 0, "" | ||
}, | ||
LearnMoreUrl: "https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/tag-resources?tabs=json", | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
package log | ||
|
||
import ( | ||
"strings" | ||
|
||
"github.com/Azure/azqr/internal/azqr" | ||
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationalinsights/armoperationalinsights/v2" | ||
) | ||
|
||
// GetRules - Returns the rules for the LogAnalyticsScanner | ||
func (a *LogAnalyticsScanner) GetRecommendations() map[string]azqr.AzqrRecommendation { | ||
return map[string]azqr.AzqrRecommendation{ | ||
"log-003": { | ||
RecommendationID: "log-003", | ||
ResourceType: "Microsoft.OperationalInsights/workspaces", | ||
Category: azqr.CategoryHighAvailability, | ||
Recommendation: "Log Analytics Workspace SLA", | ||
RecommendationType: azqr.TypeSLA, | ||
Impact: azqr.ImpactHigh, | ||
Eval: func(target interface{}, scanContext *azqr.ScanContext) (bool, string) { | ||
return false, "99.9%" | ||
}, | ||
LearnMoreUrl: "https://www.microsoft.com/licensing/docs/view/Service-Level-Agreements-SLA-for-Online-Services", | ||
}, | ||
"log-006": { | ||
RecommendationID: "log-006", | ||
ResourceType: "Microsoft.OperationalInsights/workspaces", | ||
Category: azqr.CategoryGovernance, | ||
Recommendation: "Log Analytics Workspace Name should comply with naming conventions", | ||
Impact: azqr.ImpactLow, | ||
Eval: func(target interface{}, scanContext *azqr.ScanContext) (bool, string) { | ||
c := target.(*armoperationalinsights.Workspace) | ||
caf := strings.HasPrefix(*c.Name, "log") | ||
return !caf, "" | ||
}, | ||
LearnMoreUrl: "https://learn.microsoft.com/en-us/azure/cloud-adoption-framework/ready/azure-best-practices/resource-abbreviations", | ||
}, | ||
"log-007": { | ||
RecommendationID: "log-007", | ||
ResourceType: "Microsoft.OperationalInsights/workspaces", | ||
Category: azqr.CategoryGovernance, | ||
Recommendation: "Log Analytics Workspace should have tags", | ||
Impact: azqr.ImpactLow, | ||
Eval: func(target interface{}, scanContext *azqr.ScanContext) (bool, string) { | ||
c := target.(*armoperationalinsights.Workspace) | ||
return len(c.Tags) == 0, "" | ||
}, | ||
LearnMoreUrl: "https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/tag-resources?tabs=json", | ||
}, | ||
} | ||
} |
Oops, something went wrong.