Skip to content

Commit a2140dd

Browse files
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
1 parent 4c60f32 commit a2140dd

File tree

85 files changed

+6258
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+6258
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
bin
2+
obj
3+
.vs
4+
generated
5+
internal
6+
exports
7+
tools
8+
custom/*.psm1
9+
custom/autogen-model-cmdlets
10+
test/*-TestResults.xml
11+
/*.ps1
12+
/*.ps1xml
13+
/*.psm1
14+
/*.snk
15+
/*.csproj
16+
/*.nuspec
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@{
2+
GUID = 'e097ff3f-acb2-48da-86fe-937d86006ea5'
3+
RootModule = './Az.FirmwareAnalysis.psm1'
4+
ModuleVersion = '0.1.0'
5+
CompatiblePSEditions = 'Core', 'Desktop'
6+
Author = 'Microsoft Corporation'
7+
CompanyName = 'Microsoft Corporation'
8+
Copyright = 'Microsoft Corporation. All rights reserved.'
9+
Description = 'Microsoft Azure PowerShell: FirmwareAnalysis cmdlets'
10+
PowerShellVersion = '5.1'
11+
DotNetFrameworkVersion = '4.7.2'
12+
RequiredAssemblies = './bin/Az.FirmwareAnalysis.private.dll'
13+
FormatsToProcess = './Az.FirmwareAnalysis.format.ps1xml'
14+
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'
15+
PrivateData = @{
16+
PSData = @{
17+
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'FirmwareAnalysis'
18+
LicenseUri = 'https://aka.ms/azps-license'
19+
ProjectUri = 'https://github.com/Azure/azure-powershell'
20+
ReleaseNotes = ''
21+
}
22+
}
23+
}
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
<!-- region Generated -->
2+
# Az.FirmwareAnalysis
3+
This directory contains the PowerShell module for the FirmwareAnalysis service.
4+
5+
---
6+
## Status
7+
[![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/)
8+
9+
## Info
10+
- Modifiable: yes
11+
- Generated: all
12+
- Committed: yes
13+
- Packaged: yes
14+
15+
---
16+
## Detail
17+
This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.
18+
19+
## Module Requirements
20+
- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater
21+
22+
## Authentication
23+
AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent.
24+
25+
## Development
26+
For information on how to develop for `Az.FirmwareAnalysis`, see [how-to.md](how-to.md).
27+
<!-- endregion -->
28+
29+
### AutoRest Configuration
30+
> see https://aka.ms/autorest
31+
32+
```yaml
33+
# pin the swagger version by using the commit id instead of branch name
34+
commit: ef348fed285ae01b78cf6afd394ad2c4c8b6da7e
35+
require:
36+
# readme.azure.noprofile.md is the common configuration file
37+
- $(this-folder)/../../readme.azure.noprofile.md
38+
#- $(repo)/specification/fist/resource-manager/readme.md
39+
40+
# - /swagger/fist/resource-manager/readme.md
41+
# If the swagger has not been put in the repo, you may uncomment the following line and refer to it locally
42+
# - (this-folder)/relative-path-to-your-local-readme.md
43+
44+
input-file:
45+
- $(repo)/specification/fist/resource-manager/Microsoft.IoTFirmwareDefense/stable/2024-01-10/firmwares.json
46+
- $(repo)/specification/fist/resource-manager/Microsoft.IoTFirmwareDefense/stable/2024-01-10/workspaces.json
47+
- $(repo)/specification/fist/resource-manager/Microsoft.IoTFirmwareDefense/stable/2024-01-10/binaryHardeningResults.json
48+
- $(repo)/specification/fist/resource-manager/Microsoft.IoTFirmwareDefense/stable/2024-01-10/sbomComponents.json
49+
- $(repo)/specification/fist/resource-manager/Microsoft.IoTFirmwareDefense/stable/2024-01-10/cves.json
50+
- $(repo)/specification/fist/resource-manager/Microsoft.IoTFirmwareDefense/stable/2024-01-10/cryptoCertificates.json
51+
- $(repo)/specification/fist/resource-manager/Microsoft.IoTFirmwareDefense/stable/2024-01-10/cryptoKeys.json
52+
- $(repo)/specification/fist/resource-manager/Microsoft.IoTFirmwareDefense/stable/2024-01-10/passwordHashes.json
53+
- $(repo)/specification/fist/resource-manager/Microsoft.IoTFirmwareDefense/stable/2024-01-10/summaries.json
54+
- $(repo)/specification/fist/resource-manager/Microsoft.IoTFirmwareDefense/stable/2024-01-10/common.json
55+
- $(repo)/specification/fist/resource-manager/Microsoft.IoTFirmwareDefense/stable/2024-01-10/operations.json
56+
57+
try-require:
58+
- /swagger/fist/resource-manager/readme.powershell.md
59+
60+
# For new RP, the version is 0.1.0
61+
module-version: 0.1.0
62+
# Normally, title is the service name
63+
title: FirmwareAnalysis
64+
subject-prefix: $(service-name)
65+
66+
# 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.
67+
# identity-correction-for-post: true
68+
# resourcegroup-append: true
69+
# nested-object-to-string: true
70+
71+
directive:
72+
# Following are common directives which are normally required in all the RPs
73+
# 1. Remove the unexpanded parameter set
74+
# 2. For New-* cmdlets, ViaIdentity is not required
75+
# Following two directives are v4 specific
76+
- where:
77+
variant: ^(Create|Update)(?!.*?Expanded|JsonFilePath|JsonString)
78+
remove: true
79+
- where:
80+
variant: ^CreateViaIdentity.*$
81+
remove: true
82+
# Follow directive is v3 specific. If you are using v3, uncomment following directive and comments out two directives above
83+
#- where:
84+
# variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
85+
# remove: true
86+
87+
# Remove the set-* cmdlet
88+
- where:
89+
verb: Set
90+
remove: true
91+
92+
- where:
93+
parameter-name: Id
94+
verb: New
95+
subject: AzFirmwareAnalysisFirmware
96+
set:
97+
default:
98+
name: Id
99+
description: Gets the Id from the current context.
100+
script: 'New-Guid'
101+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"resourceType": "workspaces/firmwares/summaries",
3+
"apiVersion": "2024-01-10",
4+
"learnMore": {
5+
"url": "https://learn.microsoft.com/powershell/module/az.firmwareanalysis"
6+
},
7+
"commands": [
8+
{
9+
"name": "Get-AzFirmwareAnalysisSummary",
10+
"description": "Get an analysis result summary of a firmware by name.",
11+
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTFirmwareDefense/workspaces/{workspaceName}/firmwares/{firmwareId}/summaries/{summaryName}",
12+
"help": {
13+
"learnMore": {
14+
"url": "https://learn.microsoft.com/powershell/module/az.firmwareanalysis/get-azfirmwareanalysissummary"
15+
},
16+
"parameterSets": [
17+
{
18+
"parameters": [
19+
"-FirmwareId <String>",
20+
"-Name <String>",
21+
"-ResourceGroupName <String>",
22+
"[-SubscriptionId <String[]>]",
23+
"-WorkspaceName <String>"
24+
]
25+
}
26+
]
27+
},
28+
"examples": [
29+
{
30+
"description": "Get an analysis result summary of a firmware by name.",
31+
"parameters": [
32+
{
33+
"name": "-FirmwareId",
34+
"value": "[Path.firmwareId]"
35+
},
36+
{
37+
"name": "-Name",
38+
"value": "[Path.summaryName]"
39+
},
40+
{
41+
"name": "-ResourceGroupName",
42+
"value": "[Path.resourceGroupName]"
43+
},
44+
{
45+
"name": "-SubscriptionId",
46+
"value": "[Path.subscriptionId]"
47+
},
48+
{
49+
"name": "-WorkspaceName",
50+
"value": "[Path.workspaceName]"
51+
}
52+
]
53+
}
54+
]
55+
}
56+
]
57+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
{
2+
"resourceType": "workspaces/firmwares",
3+
"apiVersion": "2024-01-10",
4+
"learnMore": {
5+
"url": "https://learn.microsoft.com/powershell/module/az.firmwareanalysis"
6+
},
7+
"commands": [
8+
{
9+
"name": "Get-AzFirmwareAnalysisFirmware",
10+
"description": "Get firmware.",
11+
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTFirmwareDefense/workspaces/{workspaceName}/firmwares/{firmwareId}",
12+
"help": {
13+
"learnMore": {
14+
"url": "https://learn.microsoft.com/powershell/module/az.firmwareanalysis/get-azfirmwareanalysisfirmware"
15+
},
16+
"parameterSets": [
17+
{
18+
"parameters": [
19+
"-Id <String>",
20+
"-ResourceGroupName <String>",
21+
"[-SubscriptionId <String[]>]",
22+
"-WorkspaceName <String>"
23+
]
24+
}
25+
]
26+
},
27+
"examples": [
28+
{
29+
"description": "Get firmware.",
30+
"parameters": [
31+
{
32+
"name": "-Id",
33+
"value": "[Path.firmwareId]"
34+
},
35+
{
36+
"name": "-ResourceGroupName",
37+
"value": "[Path.resourceGroupName]"
38+
},
39+
{
40+
"name": "-SubscriptionId",
41+
"value": "[Path.subscriptionId]"
42+
},
43+
{
44+
"name": "-WorkspaceName",
45+
"value": "[Path.workspaceName]"
46+
}
47+
]
48+
}
49+
]
50+
},
51+
{
52+
"name": "Remove-AzFirmwareAnalysisFirmware",
53+
"description": "The operation to delete a firmware.",
54+
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTFirmwareDefense/workspaces/{workspaceName}/firmwares/{firmwareId}",
55+
"help": {
56+
"learnMore": {
57+
"url": "https://learn.microsoft.com/powershell/module/az.firmwareanalysis/remove-azfirmwareanalysisfirmware"
58+
},
59+
"parameterSets": [
60+
{
61+
"parameters": [
62+
"-Id <String>",
63+
"-ResourceGroupName <String>",
64+
"[-SubscriptionId <String>]",
65+
"-WorkspaceName <String>"
66+
]
67+
}
68+
]
69+
},
70+
"examples": [
71+
{
72+
"description": "The operation to delete a firmware.",
73+
"parameters": [
74+
{
75+
"name": "-Id",
76+
"value": "[Path.firmwareId]"
77+
},
78+
{
79+
"name": "-ResourceGroupName",
80+
"value": "[Path.resourceGroupName]"
81+
},
82+
{
83+
"name": "-SubscriptionId",
84+
"value": "[Path.subscriptionId]"
85+
},
86+
{
87+
"name": "-WorkspaceName",
88+
"value": "[Path.workspaceName]"
89+
}
90+
]
91+
}
92+
]
93+
}
94+
]
95+
}
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
"resourceType": "workspaces",
3+
"apiVersion": "2024-01-10",
4+
"learnMore": {
5+
"url": "https://learn.microsoft.com/powershell/module/az.firmwareanalysis"
6+
},
7+
"commands": [
8+
{
9+
"name": "Get-AzFirmwareAnalysisWorkspace",
10+
"description": "Get firmware analysis workspace.",
11+
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTFirmwareDefense/workspaces/{workspaceName}",
12+
"help": {
13+
"learnMore": {
14+
"url": "https://learn.microsoft.com/powershell/module/az.firmwareanalysis/get-azfirmwareanalysisworkspace"
15+
},
16+
"parameterSets": [
17+
{
18+
"parameters": [
19+
"-Name <String>",
20+
"-ResourceGroupName <String>",
21+
"[-SubscriptionId <String[]>]"
22+
]
23+
}
24+
]
25+
},
26+
"examples": [
27+
{
28+
"description": "Get firmware analysis workspace.",
29+
"parameters": [
30+
{
31+
"name": "-Name",
32+
"value": "[Path.workspaceName]"
33+
},
34+
{
35+
"name": "-ResourceGroupName",
36+
"value": "[Path.resourceGroupName]"
37+
},
38+
{
39+
"name": "-SubscriptionId",
40+
"value": "[Path.subscriptionId]"
41+
}
42+
]
43+
}
44+
]
45+
},
46+
{
47+
"name": "Remove-AzFirmwareAnalysisWorkspace",
48+
"description": "The operation to delete a firmware analysis workspace.",
49+
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTFirmwareDefense/workspaces/{workspaceName}",
50+
"help": {
51+
"learnMore": {
52+
"url": "https://learn.microsoft.com/powershell/module/az.firmwareanalysis/remove-azfirmwareanalysisworkspace"
53+
},
54+
"parameterSets": [
55+
{
56+
"parameters": [
57+
"-Name <String>",
58+
"-ResourceGroupName <String>",
59+
"[-SubscriptionId <String>]"
60+
]
61+
}
62+
]
63+
},
64+
"examples": [
65+
{
66+
"description": "The operation to delete a firmware analysis workspace.",
67+
"parameters": [
68+
{
69+
"name": "-Name",
70+
"value": "[Path.workspaceName]"
71+
},
72+
{
73+
"name": "-ResourceGroupName",
74+
"value": "[Path.resourceGroupName]"
75+
},
76+
{
77+
"name": "-SubscriptionId",
78+
"value": "[Path.subscriptionId]"
79+
}
80+
]
81+
}
82+
]
83+
}
84+
]
85+
}

0 commit comments

Comments
 (0)