Skip to content

Commit

Permalink
added csv reports and fixed #198 y #199
Browse files Browse the repository at this point in the history
  • Loading branch information
cmendible committed Apr 15, 2024
1 parent d049ebc commit bfe70ca
Show file tree
Hide file tree
Showing 106 changed files with 2,593 additions and 3,377 deletions.
58 changes: 40 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,51 @@

## Scan Results

The output generated by **Azure Quick Review (azqr)** is presented in the form of an Excel file, which consists of several sheets including **Overview**, **Recommendations**, **Services**, **Defender**, **Advisor** and **Costs**. Additionally, when running the tool on a Windows system, it also generates a Power BI Desktop Template for further analysis and visualization of the Azure resource data.

The **Overview** sheet provides a summary of the Azure resources scanned by the tool, including the following information:

* **SubscriptionID**: This is the unique identifier for the Azure subscription under which the resource is deployed.
* **ResourceGroup**: The resource group where the resource is deployed.
* **Location**: The geographical region where the resource is deployed.
* **Type**: The specific type or category of the Azure resource.
* **Name**: The name assigned to the resource, providing a human-readable identifier for easy reference and management.
* **SKU**: The SKU represents the specific variant or configuration of the Azure resource. It defines the characteristics and capabilities of the resource.
* **SLA**: The Service Level Agreement (SLA) represents the agreed-upon performance and availability guarantees for the Azure service based on its current configuration.
* **AZ**: A Boolean value indicating whether the service is "Availability Zone aware." Availability Zones are physically separate datacenters within an Azure region, providing increased resiliency and fault tolerance for critical services.
* **PVT**: A Boolean value indicating whether the service has a private IP address. Private IP addresses are used for internal communication within Azure Virtual Networks.
* **DS**: A Boolean value indicating whether diagnostic settings are enabled for the service. Diagnostic settings allow you to collect logs, metrics, and other monitoring data for Azure resources.
* **CAF**: A Boolean value indicating whether the service is compliant with the [Cloud Adoption Framework](https://learn.microsoft.com/en-us/azure/cloud-adoption-framework/ready/azure-best-practices/resource-abbreviations) (CAF) naming convention. The CAF provides best practices and guidance for organizations adopting Azure.
The output generated by **Azure Quick Review (azqr)** is presented by default in four `csv` files:

* **azqr-YYYY-MM-DD-HH-MM-SS.services.csv:** This file contains the details of the Azure services scanned by the tool, including:
* Subscription: The unique identifier for the Azure subscription under which the resource is deployed.
* Resource Group: The resource group where the resource is deployed.
* Location: The geographical region where the resource is deployed.
* Type: The specific type or category of the Azure resource.
* Service Name: The name assigned to the service, providing a human-readable identifier for easy reference and management.
* Compliant: A Boolean value indicating whether the service is compliant with Azure's best practices and recommendations.
* Impact: The potential impact of non-compliance on the service.
* Category: The category or type of recommendation.
* Recommendation: The specific recommendation or best practice.
* Result: The result or value resulting from the evaluation of the recommendation (i.e. Service SLA or SKU).
* Learn: A link to additional information or documentation related to the recommendation.
* **azqr-YYYY-MM-DD-HH-MM-SS.defender.csv:**
* Subscription: The unique identifier for the Azure subscription under which the resource is deployed.
* Name: Microsoft Defender for Cloud plan name.
* Tier: The tier of the plan.
* Deprecated: a Boolean value indicating whether the plan is deprecated.
* **azqr-YYYY-MM-DD-HH-MM-SS.advisor.csv:**
* Subscription: The unique identifier for the Azure subscription under which the resource is deployed.
* Name: The name of the resource identified by Advisor.
* Type: The resource type of the resource identified by Advisor.
* Category: The category of the recommendation.
* Description: The description of the recommendation.
* PotentialBenefits: The potential benefits of the recommendation.
* Risk: Risk related to the recommendation.
* LearnMoreLink: A link to additional information or documentation related to the recommendation.
* **azqr-YYYY-MM-DD-HH-MM-SS.costs.csv:**
* From: the start date of the cost analysis period.
* To: the end date of the cost analysis period.
* Subscription: The unique identifier for the Azure subscription under which the resource is deployed.
* ServiceName: The type of the Azure service for which the cost is calculated.
* Value: The cost value associated with the service.
* Currency: The currency in which the cost is calculated.

> By default, Azure Quick Review (azqr) masks the Subscription Ids in the spreadsheet, ensuring that they are not directly visible in the output. This helps protect sensitive information and maintain data privacy and security. To view the Subscription Ids, you can use the `--mask=false` flag when running the tool.
To learn more about the **Recommendations**, **Services**, **Defender**, **Advisor** and **Costs** sheets, check the [Scan Results](https://azure.github.io/azqr/docs/results) documentation.
> Azure Quick Review can also generate an Excel file with the same information as the CSV files. To generate the Excel file, you can use the `--excel` (or `-x`) flag when running the tool.
## Azure Quick Review Rules
> A Power BI template is also available to help you visualize the results generated by Azure Quick Review. You can create the template running Azure Quick Review with the `pbi` command.
To learn more about the rules used by **Azure Quick Review (azqr)** for generating recommendations, you can refer to the documentation available [here](https://azure.github.io/azqr/docs/rules).
## Azure Quick Review Recommendations

To learn more about the recommendations used by **Azure Quick Review (azqr)**, you can refer to the documentation available [here](https://azure.github.io/azqr/recommendations).

## Supported Azure Services

Expand Down
12 changes: 6 additions & 6 deletions cmd/azqr/pbi.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@
package azqr

import (
"github.com/Azure/azqr/internal/renderers"
"github.com/Azure/azqr/internal/renderers/pbi"
"github.com/spf13/cobra"
)

func init() {
pbiCmd.PersistentFlags().StringP("excel-report", "x", "", "Path to azqr Excel report file")
pbiCmd.PersistentFlags().StringP("template-path", "p", "", "Path were the PowerBI template will be created")
rootCmd.AddCommand(pbiCmd)
}

var pbiCmd = &cobra.Command{
Use: "pbi",
Short: "Creates PowerBI desktop dashboard template",
Long: "Creates PowerBI desktop dashboard template",
Short: "Creates Power BI Desktop dashboard template",
Long: "Creates Power BI Desktop dashboard template",
Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
xlsx, _ := cmd.Flags().GetString("excel-report")
renderers.CreatePBIReport(xlsx)
path, _ := cmd.Flags().GetString("template-path")
pbi.CreatePBIReport(path)
},
}
6 changes: 3 additions & 3 deletions cmd/azqr/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ var rulesCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
serviceScanners := internal.GetScanners()

fmt.Println("# | Id | Category | Subcategory | Name | Severity | More Info")
fmt.Println("---|---|---|---|---|---|---")
fmt.Println("# | Category | Impact | Recommendation | More Info")
fmt.Println("---|---|---|---|---")

i := 0
for _, scanner := range serviceScanners {
Expand All @@ -45,7 +45,7 @@ var rulesCmd = &cobra.Command{
for _, k := range keys {
rule := rules[k]
i++
fmt.Printf("%s | %s | %s | %s | %s | %s | [Learn](%s)", fmt.Sprint(i), rule.Id, rule.Category, rule.Subcategory, rule.Description, rule.Severity, rule.Url)
fmt.Printf("%s | %s | %s | %s | [Learn](%s)", fmt.Sprint(i), rule.Category, rule.Impact, rule.Recommendation, rule.Url)
fmt.Println()
}
}
Expand Down
5 changes: 4 additions & 1 deletion cmd/azqr/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ func init() {
scanCmd.PersistentFlags().BoolP("defender", "d", true, "Scan Defender Status")
scanCmd.PersistentFlags().BoolP("advisor", "a", true, "Scan Azure Advisor Recommendations")
scanCmd.PersistentFlags().BoolP("costs", "c", false, "Scan Azure Costs")
scanCmd.PersistentFlags().StringP("output-name", "o", "", "Output file name")
scanCmd.PersistentFlags().BoolP("excel", "x", false, "Create excel report")
scanCmd.PersistentFlags().StringP("output-name", "o", "", "Output file name without extension")
scanCmd.PersistentFlags().BoolP("mask", "m", true, "Mask the subscription id in the report")
scanCmd.PersistentFlags().BoolP("azure-cli-credential", "f", false, "Force the use of Azure CLI Credential")
scanCmd.PersistentFlags().BoolP("debug", "", false, "Set log level to debug")
Expand All @@ -42,6 +43,7 @@ func scan(cmd *cobra.Command, serviceScanners []scanners.IAzureScanner) {
defender, _ := cmd.Flags().GetBool("defender")
advisor, _ := cmd.Flags().GetBool("advisor")
cost, _ := cmd.Flags().GetBool("costs")
xlsx, _ := cmd.Flags().GetBool("excel")
mask, _ := cmd.Flags().GetBool("mask")
debug, _ := cmd.Flags().GetBool("debug")
forceAzureCliCredential, _ := cmd.Flags().GetBool("azure-cli-credential")
Expand All @@ -53,6 +55,7 @@ func scan(cmd *cobra.Command, serviceScanners []scanners.IAzureScanner) {
Defender: defender,
Advisor: advisor,
Cost: cost,
Xlsx: xlsx,
Mask: mask,
Debug: debug,
ServiceScanners: serviceScanners,
Expand Down
1 change: 0 additions & 1 deletion docs/content/en/docs/Install/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ $latest_azqr=$(iwr https://api.github.com/repos/Azure/azqr/releases/latest).cont
iwr https://github.com/Azure/azqr/releases/download/$latest_azqr/azqr-windows-latest-amd64.exe -OutFile azqr.exe
```


## Install on Mac

Download the latest release from [here](https://github.com/Azure/azqr/releases).
60 changes: 42 additions & 18 deletions docs/content/en/docs/Overview/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,51 @@ weight: 1

## Scan Results

The output generated by **Azure Quick Review (azqr)** is presented in the form of an Excel file, which consists of several sheets including **Overview**, **Recommendations**, **Services**, **Defender**, **Advisor** and **Costs**. Additionally, when running the tool on a Windows system, it also generates a Power BI Desktop Template for further analysis and visualization of the Azure resource data.

The **Overview** sheet provides a summary of the Azure resources scanned by the tool, including the following information:

* **SubscriptionID**: This is the unique identifier for the Azure subscription under which the resource is deployed.
* **ResourceGroup**: The resource group where the resource is deployed.
* **Location**: The geographical region where the resource is deployed.
* **Type**: The specific type or category of the Azure resource.
* **Name**: The name assigned to the resource, providing a human-readable identifier for easy reference and management.
* **SKU**: The SKU represents the specific variant or configuration of the Azure resource. It defines the characteristics and capabilities of the resource.
* **SLA**: The Service Level Agreement (SLA) represents the agreed-upon performance and availability guarantees for the Azure service based on its current configuration.
* **AZ**: A Boolean value indicating whether the service is "Availability Zone aware." Availability Zones are physically separate datacenters within an Azure region, providing increased resiliency and fault tolerance for critical services.
* **PVT**: A Boolean value indicating whether the service has a private IP address. Private IP addresses are used for internal communication within Azure Virtual Networks.
* **DS**: A Boolean value indicating whether diagnostic settings are enabled for the service. Diagnostic settings allow you to collect logs, metrics, and other monitoring data for Azure resources.
* **CAF**: A Boolean value indicating whether the service is compliant with the [Cloud Adoption Framework](https://learn.microsoft.com/en-us/azure/cloud-adoption-framework/ready/azure-best-practices/resource-abbreviations) (CAF) naming convention. The CAF provides best practices and guidance for organizations adopting Azure.
The output generated by **Azure Quick Review (azqr)** is presented by default in four `csv` files:

* **azqr-YYYY-MM-DD-HH-MM-SS.services.csv:** This file contains the details of the Azure services scanned by the tool, including:
* Subscription: The unique identifier for the Azure subscription under which the resource is deployed.
* Resource Group: The resource group where the resource is deployed.
* Location: The geographical region where the resource is deployed.
* Type: The specific type or category of the Azure resource.
* Service Name: The name assigned to the service, providing a human-readable identifier for easy reference and management.
* Compliant: A Boolean value indicating whether the service is compliant with Azure's best practices and recommendations.
* Impact: The potential impact of non-compliance on the service.
* Category: The category or type of recommendation.
* Recommendation: The specific recommendation or best practice.
* Result: The result or value resulting from the evaluation of the recommendation (i.e. Service SLA or SKU).
* Learn: A link to additional information or documentation related to the recommendation.
* **azqr-YYYY-MM-DD-HH-MM-SS.defender.csv:**
* Subscription: The unique identifier for the Azure subscription under which the resource is deployed.
* Name: Microsoft Defender for Cloud plan name.
* Tier: The tier of the plan.
* Deprecated: a Boolean value indicating whether the plan is deprecated.
* **azqr-YYYY-MM-DD-HH-MM-SS.advisor.csv:**
* Subscription: The unique identifier for the Azure subscription under which the resource is deployed.
* Name: The name of the resource identified by Advisor.
* Type: The resource type of the resource identified by Advisor.
* Category: The category of the recommendation.
* Description: The description of the recommendation.
* PotentialBenefits: The potential benefits of the recommendation.
* Risk: Risk related to the recommendation.
* LearnMoreLink: A link to additional information or documentation related to the recommendation.
* **azqr-YYYY-MM-DD-HH-MM-SS.costs.csv:**
* From: the start date of the cost analysis period.
* To: the end date of the cost analysis period.
* Subscription: The unique identifier for the Azure subscription under which the resource is deployed.
* ServiceName: The type of the Azure service for which the cost is calculated.
* Value: The cost value associated with the service.
* Currency: The currency in which the cost is calculated.

> By default, Azure Quick Review (azqr) masks the Subscription Ids in the spreadsheet, ensuring that they are not directly visible in the output. This helps protect sensitive information and maintain data privacy and security. To view the Subscription Ids, you can use the `--mask=false` flag when running the tool.
To learn more about the **Recommendations**, **Services**, **Defender**, **Advisor** and **Costs** sheets, check the [Scan Results](https://azure.github.io/azqr/results) documentation.
> Azure Quick Review can also generate an Excel file with the same information as the CSV files. To generate the Excel file, you can use the `--excel` (or `-x`) flag when running the tool.
## Azure Quick Review Rules
> A Power BI template is also available to help you visualize the results generated by Azure Quick Review. You can create the template running Azure Quick Review with the `pbi` command.
To learn more about the rules used by **Azure Quick Review (azqr)** for generating recommendations, you can refer to the documentation available [here](https://azure.github.io/azqr/rules).
## Azure Quick Review Recommendations

To learn more about the recommendations used by **Azure Quick Review (azqr)**, you can refer to the documentation available [here](https://azure.github.io/azqr/recommendations).

## Supported Azure Services

Expand All @@ -43,6 +65,7 @@ To learn more about the rules used by **Azure Quick Review (azqr)** for generati
* Azure Application Insights
* Azure Cache for Redis
* Azure Cognitive Services Account
* Azure Container Apps Environment
* Azure Container Apps
* Azure Container Instances
* Azure Container Registry
Expand All @@ -68,6 +91,7 @@ To learn more about the rules used by **Azure Quick Review (azqr)** for generati
* Azure SignalR Service
* Azure SQL Database
* Azure Storage Account
* Azure Traffic Manager
* Azure Virtual Machine
* Azure Virtual Network
* Azure Virtual WAN
Expand Down
Loading

0 comments on commit bfe70ca

Please sign in to comment.