-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature firmwareanalysis ps (#24138)
* Onboard firmwareanalysis commands to powwershell * add test cases and doc * add docs * add outputs * update command * fix test * update doc * update doc * fix errors * add recording * remove command * update tests
- Loading branch information
1 parent
4c60f32
commit a2140dd
Showing
85 changed files
with
6,258 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto |
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,16 @@ | ||
bin | ||
obj | ||
.vs | ||
generated | ||
internal | ||
exports | ||
tools | ||
custom/*.psm1 | ||
custom/autogen-model-cmdlets | ||
test/*-TestResults.xml | ||
/*.ps1 | ||
/*.ps1xml | ||
/*.psm1 | ||
/*.snk | ||
/*.csproj | ||
/*.nuspec |
23 changes: 23 additions & 0 deletions
23
src/FirmwareAnalysis/FirmwareAnalysis.Autorest/Az.FirmwareAnalysis.psd1
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,23 @@ | ||
@{ | ||
GUID = 'e097ff3f-acb2-48da-86fe-937d86006ea5' | ||
RootModule = './Az.FirmwareAnalysis.psm1' | ||
ModuleVersion = '0.1.0' | ||
CompatiblePSEditions = 'Core', 'Desktop' | ||
Author = 'Microsoft Corporation' | ||
CompanyName = 'Microsoft Corporation' | ||
Copyright = 'Microsoft Corporation. All rights reserved.' | ||
Description = 'Microsoft Azure PowerShell: FirmwareAnalysis cmdlets' | ||
PowerShellVersion = '5.1' | ||
DotNetFrameworkVersion = '4.7.2' | ||
RequiredAssemblies = './bin/Az.FirmwareAnalysis.private.dll' | ||
FormatsToProcess = './Az.FirmwareAnalysis.format.ps1xml' | ||
FunctionsToExport = 'Get-AzFirmwareAnalysisBinaryHardening', 'Get-AzFirmwareAnalysisCryptoCertificate', 'Get-AzFirmwareAnalysisCryptoKey', 'Get-AzFirmwareAnalysisCve', 'Get-AzFirmwareAnalysisFirmware', 'Get-AzFirmwareAnalysisPasswordHash', 'Get-AzFirmwareAnalysisSbomComponent', 'Get-AzFirmwareAnalysisSummary', 'Get-AzFirmwareAnalysisWorkspace', 'New-AzFirmwareAnalysisFirmware', 'New-AzFirmwareAnalysisFirmwareFilesystemDownloadUrl', 'New-AzFirmwareAnalysisWorkspace', 'New-AzFirmwareAnalysisWorkspaceUploadUrl', 'Remove-AzFirmwareAnalysisFirmware', 'Remove-AzFirmwareAnalysisWorkspace', 'Update-AzFirmwareAnalysisFirmware', 'Update-AzFirmwareAnalysisWorkspace' | ||
PrivateData = @{ | ||
PSData = @{ | ||
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'FirmwareAnalysis' | ||
LicenseUri = 'https://aka.ms/azps-license' | ||
ProjectUri = 'https://github.com/Azure/azure-powershell' | ||
ReleaseNotes = '' | ||
} | ||
} | ||
} |
101 changes: 101 additions & 0 deletions
101
src/FirmwareAnalysis/FirmwareAnalysis.Autorest/README.md
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,101 @@ | ||
<!-- region Generated --> | ||
# Az.FirmwareAnalysis | ||
This directory contains the PowerShell module for the FirmwareAnalysis service. | ||
|
||
--- | ||
## Status | ||
[![Az.FirmwareAnalysis](https://img.shields.io/powershellgallery/v/Az.FirmwareAnalysis.svg?style=flat-square&label=Az.FirmwareAnalysis "Az.FirmwareAnalysis")](https://www.powershellgallery.com/packages/Az.FirmwareAnalysis/) | ||
|
||
## Info | ||
- Modifiable: yes | ||
- Generated: all | ||
- Committed: yes | ||
- Packaged: yes | ||
|
||
--- | ||
## Detail | ||
This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension. | ||
|
||
## Module Requirements | ||
- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater | ||
|
||
## Authentication | ||
AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent. | ||
|
||
## Development | ||
For information on how to develop for `Az.FirmwareAnalysis`, see [how-to.md](how-to.md). | ||
<!-- endregion --> | ||
|
||
### AutoRest Configuration | ||
> see https://aka.ms/autorest | ||
```yaml | ||
# pin the swagger version by using the commit id instead of branch name | ||
commit: ef348fed285ae01b78cf6afd394ad2c4c8b6da7e | ||
require: | ||
# readme.azure.noprofile.md is the common configuration file | ||
- $(this-folder)/../../readme.azure.noprofile.md | ||
#- $(repo)/specification/fist/resource-manager/readme.md | ||
|
||
# - /swagger/fist/resource-manager/readme.md | ||
# If the swagger has not been put in the repo, you may uncomment the following line and refer to it locally | ||
# - (this-folder)/relative-path-to-your-local-readme.md | ||
|
||
input-file: | ||
- $(repo)/specification/fist/resource-manager/Microsoft.IoTFirmwareDefense/stable/2024-01-10/firmwares.json | ||
- $(repo)/specification/fist/resource-manager/Microsoft.IoTFirmwareDefense/stable/2024-01-10/workspaces.json | ||
- $(repo)/specification/fist/resource-manager/Microsoft.IoTFirmwareDefense/stable/2024-01-10/binaryHardeningResults.json | ||
- $(repo)/specification/fist/resource-manager/Microsoft.IoTFirmwareDefense/stable/2024-01-10/sbomComponents.json | ||
- $(repo)/specification/fist/resource-manager/Microsoft.IoTFirmwareDefense/stable/2024-01-10/cves.json | ||
- $(repo)/specification/fist/resource-manager/Microsoft.IoTFirmwareDefense/stable/2024-01-10/cryptoCertificates.json | ||
- $(repo)/specification/fist/resource-manager/Microsoft.IoTFirmwareDefense/stable/2024-01-10/cryptoKeys.json | ||
- $(repo)/specification/fist/resource-manager/Microsoft.IoTFirmwareDefense/stable/2024-01-10/passwordHashes.json | ||
- $(repo)/specification/fist/resource-manager/Microsoft.IoTFirmwareDefense/stable/2024-01-10/summaries.json | ||
- $(repo)/specification/fist/resource-manager/Microsoft.IoTFirmwareDefense/stable/2024-01-10/common.json | ||
- $(repo)/specification/fist/resource-manager/Microsoft.IoTFirmwareDefense/stable/2024-01-10/operations.json | ||
|
||
try-require: | ||
- /swagger/fist/resource-manager/readme.powershell.md | ||
|
||
# For new RP, the version is 0.1.0 | ||
module-version: 0.1.0 | ||
# Normally, title is the service name | ||
title: FirmwareAnalysis | ||
subject-prefix: $(service-name) | ||
|
||
# The next three configurations are exclusive to v3, and in v4, they are activated by default. If you are still using v3, please uncomment them. | ||
# identity-correction-for-post: true | ||
# resourcegroup-append: true | ||
# nested-object-to-string: true | ||
|
||
directive: | ||
# Following are common directives which are normally required in all the RPs | ||
# 1. Remove the unexpanded parameter set | ||
# 2. For New-* cmdlets, ViaIdentity is not required | ||
# Following two directives are v4 specific | ||
- where: | ||
variant: ^(Create|Update)(?!.*?Expanded|JsonFilePath|JsonString) | ||
remove: true | ||
- where: | ||
variant: ^CreateViaIdentity.*$ | ||
remove: true | ||
# Follow directive is v3 specific. If you are using v3, uncomment following directive and comments out two directives above | ||
#- where: | ||
# variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$ | ||
# remove: true | ||
|
||
# Remove the set-* cmdlet | ||
- where: | ||
verb: Set | ||
remove: true | ||
|
||
- where: | ||
parameter-name: Id | ||
verb: New | ||
subject: AzFirmwareAnalysisFirmware | ||
set: | ||
default: | ||
name: Id | ||
description: Gets the Id from the current context. | ||
script: 'New-Guid' | ||
``` |
57 changes: 57 additions & 0 deletions
57
...wareAnalysis.Autorest/UX/Microsoft.IoTFirmwareDefense/workspaces-firmwares-summaries.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"resourceType": "workspaces/firmwares/summaries", | ||
"apiVersion": "2024-01-10", | ||
"learnMore": { | ||
"url": "https://learn.microsoft.com/powershell/module/az.firmwareanalysis" | ||
}, | ||
"commands": [ | ||
{ | ||
"name": "Get-AzFirmwareAnalysisSummary", | ||
"description": "Get an analysis result summary of a firmware by name.", | ||
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTFirmwareDefense/workspaces/{workspaceName}/firmwares/{firmwareId}/summaries/{summaryName}", | ||
"help": { | ||
"learnMore": { | ||
"url": "https://learn.microsoft.com/powershell/module/az.firmwareanalysis/get-azfirmwareanalysissummary" | ||
}, | ||
"parameterSets": [ | ||
{ | ||
"parameters": [ | ||
"-FirmwareId <String>", | ||
"-Name <String>", | ||
"-ResourceGroupName <String>", | ||
"[-SubscriptionId <String[]>]", | ||
"-WorkspaceName <String>" | ||
] | ||
} | ||
] | ||
}, | ||
"examples": [ | ||
{ | ||
"description": "Get an analysis result summary of a firmware by name.", | ||
"parameters": [ | ||
{ | ||
"name": "-FirmwareId", | ||
"value": "[Path.firmwareId]" | ||
}, | ||
{ | ||
"name": "-Name", | ||
"value": "[Path.summaryName]" | ||
}, | ||
{ | ||
"name": "-ResourceGroupName", | ||
"value": "[Path.resourceGroupName]" | ||
}, | ||
{ | ||
"name": "-SubscriptionId", | ||
"value": "[Path.subscriptionId]" | ||
}, | ||
{ | ||
"name": "-WorkspaceName", | ||
"value": "[Path.workspaceName]" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
95 changes: 95 additions & 0 deletions
95
...lysis/FirmwareAnalysis.Autorest/UX/Microsoft.IoTFirmwareDefense/workspaces-firmwares.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
{ | ||
"resourceType": "workspaces/firmwares", | ||
"apiVersion": "2024-01-10", | ||
"learnMore": { | ||
"url": "https://learn.microsoft.com/powershell/module/az.firmwareanalysis" | ||
}, | ||
"commands": [ | ||
{ | ||
"name": "Get-AzFirmwareAnalysisFirmware", | ||
"description": "Get firmware.", | ||
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTFirmwareDefense/workspaces/{workspaceName}/firmwares/{firmwareId}", | ||
"help": { | ||
"learnMore": { | ||
"url": "https://learn.microsoft.com/powershell/module/az.firmwareanalysis/get-azfirmwareanalysisfirmware" | ||
}, | ||
"parameterSets": [ | ||
{ | ||
"parameters": [ | ||
"-Id <String>", | ||
"-ResourceGroupName <String>", | ||
"[-SubscriptionId <String[]>]", | ||
"-WorkspaceName <String>" | ||
] | ||
} | ||
] | ||
}, | ||
"examples": [ | ||
{ | ||
"description": "Get firmware.", | ||
"parameters": [ | ||
{ | ||
"name": "-Id", | ||
"value": "[Path.firmwareId]" | ||
}, | ||
{ | ||
"name": "-ResourceGroupName", | ||
"value": "[Path.resourceGroupName]" | ||
}, | ||
{ | ||
"name": "-SubscriptionId", | ||
"value": "[Path.subscriptionId]" | ||
}, | ||
{ | ||
"name": "-WorkspaceName", | ||
"value": "[Path.workspaceName]" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "Remove-AzFirmwareAnalysisFirmware", | ||
"description": "The operation to delete a firmware.", | ||
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTFirmwareDefense/workspaces/{workspaceName}/firmwares/{firmwareId}", | ||
"help": { | ||
"learnMore": { | ||
"url": "https://learn.microsoft.com/powershell/module/az.firmwareanalysis/remove-azfirmwareanalysisfirmware" | ||
}, | ||
"parameterSets": [ | ||
{ | ||
"parameters": [ | ||
"-Id <String>", | ||
"-ResourceGroupName <String>", | ||
"[-SubscriptionId <String>]", | ||
"-WorkspaceName <String>" | ||
] | ||
} | ||
] | ||
}, | ||
"examples": [ | ||
{ | ||
"description": "The operation to delete a firmware.", | ||
"parameters": [ | ||
{ | ||
"name": "-Id", | ||
"value": "[Path.firmwareId]" | ||
}, | ||
{ | ||
"name": "-ResourceGroupName", | ||
"value": "[Path.resourceGroupName]" | ||
}, | ||
{ | ||
"name": "-SubscriptionId", | ||
"value": "[Path.subscriptionId]" | ||
}, | ||
{ | ||
"name": "-WorkspaceName", | ||
"value": "[Path.workspaceName]" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
85 changes: 85 additions & 0 deletions
85
...irmwareAnalysis/FirmwareAnalysis.Autorest/UX/Microsoft.IoTFirmwareDefense/workspaces.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{ | ||
"resourceType": "workspaces", | ||
"apiVersion": "2024-01-10", | ||
"learnMore": { | ||
"url": "https://learn.microsoft.com/powershell/module/az.firmwareanalysis" | ||
}, | ||
"commands": [ | ||
{ | ||
"name": "Get-AzFirmwareAnalysisWorkspace", | ||
"description": "Get firmware analysis workspace.", | ||
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTFirmwareDefense/workspaces/{workspaceName}", | ||
"help": { | ||
"learnMore": { | ||
"url": "https://learn.microsoft.com/powershell/module/az.firmwareanalysis/get-azfirmwareanalysisworkspace" | ||
}, | ||
"parameterSets": [ | ||
{ | ||
"parameters": [ | ||
"-Name <String>", | ||
"-ResourceGroupName <String>", | ||
"[-SubscriptionId <String[]>]" | ||
] | ||
} | ||
] | ||
}, | ||
"examples": [ | ||
{ | ||
"description": "Get firmware analysis workspace.", | ||
"parameters": [ | ||
{ | ||
"name": "-Name", | ||
"value": "[Path.workspaceName]" | ||
}, | ||
{ | ||
"name": "-ResourceGroupName", | ||
"value": "[Path.resourceGroupName]" | ||
}, | ||
{ | ||
"name": "-SubscriptionId", | ||
"value": "[Path.subscriptionId]" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "Remove-AzFirmwareAnalysisWorkspace", | ||
"description": "The operation to delete a firmware analysis workspace.", | ||
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTFirmwareDefense/workspaces/{workspaceName}", | ||
"help": { | ||
"learnMore": { | ||
"url": "https://learn.microsoft.com/powershell/module/az.firmwareanalysis/remove-azfirmwareanalysisworkspace" | ||
}, | ||
"parameterSets": [ | ||
{ | ||
"parameters": [ | ||
"-Name <String>", | ||
"-ResourceGroupName <String>", | ||
"[-SubscriptionId <String>]" | ||
] | ||
} | ||
] | ||
}, | ||
"examples": [ | ||
{ | ||
"description": "The operation to delete a firmware analysis workspace.", | ||
"parameters": [ | ||
{ | ||
"name": "-Name", | ||
"value": "[Path.workspaceName]" | ||
}, | ||
{ | ||
"name": "-ResourceGroupName", | ||
"value": "[Path.resourceGroupName]" | ||
}, | ||
{ | ||
"name": "-SubscriptionId", | ||
"value": "[Path.subscriptionId]" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
Oops, something went wrong.