Skip to content

Commit ea30029

Browse files
authored
[Security] Initialize Security Autogenerated Modules (#24162)
* Generate SecurityConnectors and ApiCollections cmdlets * Add Get-* integration tests * Regenerate tests * Update docs and examples. Rename subject *Repos to *Repo. * Remove depricated offering * Fix static analysis errors * Fix one more static analysis issue
1 parent 334dcea commit ea30029

File tree

193 files changed

+18165
-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.

193 files changed

+18165
-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 = '6f1c0dfd-dfcd-4e5b-b77c-a64a9d355ebf'
3+
RootModule = './Az.Security.psm1'
4+
ModuleVersion = '1.5.1'
5+
CompatiblePSEditions = 'Core', 'Desktop'
6+
Author = 'Microsoft Corporation'
7+
CompanyName = 'Microsoft Corporation'
8+
Copyright = 'Microsoft Corporation. All rights reserved.'
9+
Description = 'Microsoft Azure PowerShell: Security cmdlets'
10+
PowerShellVersion = '5.1'
11+
DotNetFrameworkVersion = '4.7.2'
12+
RequiredAssemblies = './bin/Az.Security.private.dll'
13+
FormatsToProcess = './Az.Security.format.ps1xml'
14+
FunctionsToExport = 'Get-AzSecurityApiCollection', 'Get-AzSecurityConnector', 'Get-AzSecurityConnectorAzureDevOpsOrg', 'Get-AzSecurityConnectorAzureDevOpsOrgAvailable', 'Get-AzSecurityConnectorAzureDevOpsProject', 'Get-AzSecurityConnectorAzureDevOpsRepo', 'Get-AzSecurityConnectorDevOpsConfiguration', 'Get-AzSecurityConnectorGitHubOwner', 'Get-AzSecurityConnectorGitHubOwnerAvailable', 'Get-AzSecurityConnectorGitHubRepo', 'Get-AzSecurityConnectorGitLabGroup', 'Get-AzSecurityConnectorGitLabGroupAvailable', 'Get-AzSecurityConnectorGitLabProject', 'Get-AzSecurityConnectorGitLabSubgroup', 'Invoke-AzSecurityApiCollectionApimOffboard', 'Invoke-AzSecurityApiCollectionApimOnboard', 'New-AzSecurityAwsEnvironmentObject', 'New-AzSecurityAwsOrganizationalDataMasterObject', 'New-AzSecurityAwsOrganizationalDataMemberObject', 'New-AzSecurityAzureDevOpsScopeEnvironmentObject', 'New-AzSecurityConnector', 'New-AzSecurityConnectorActionableRemediationObject', 'New-AzSecurityConnectorDevOpsConfiguration', 'New-AzSecurityCspmMonitorAwsOfferingObject', 'New-AzSecurityCspmMonitorAzureDevOpsOfferingObject', 'New-AzSecurityCspmMonitorGcpOfferingObject', 'New-AzSecurityCspmMonitorGithubOfferingObject', 'New-AzSecurityCspmMonitorGitLabOfferingObject', 'New-AzSecurityDefenderCspmAwsOfferingObject', 'New-AzSecurityDefenderCspmGcpOfferingObject', 'New-AzSecurityDefenderForContainersAwsOfferingObject', 'New-AzSecurityDefenderForContainersGcpOfferingObject', 'New-AzSecurityDefenderForDatabasesAwsOfferingObject', 'New-AzSecurityDefenderForDatabasesGcpOfferingObject', 'New-AzSecurityDefenderForServersAwsOfferingObject', 'New-AzSecurityDefenderForServersGcpOfferingObject', 'New-AzSecurityGcpOrganizationalDataMemberObject', 'New-AzSecurityGcpOrganizationalDataOrganizationObject', 'New-AzSecurityGcpProjectEnvironmentObject', 'New-AzSecurityGitHubScopeEnvironmentObject', 'New-AzSecurityGitLabScopeEnvironmentObject', 'New-AzSecurityInformationProtectionAwsOfferingObject', 'Remove-AzSecurityConnector', 'Remove-AzSecurityConnectorDevOpsConfiguration', 'Update-AzSecurityConnector', 'Update-AzSecurityConnectorAzureDevOpsOrg', 'Update-AzSecurityConnectorAzureDevOpsProject', 'Update-AzSecurityConnectorAzureDevOpsRepo', 'Update-AzSecurityConnectorDevOpsConfiguration'
15+
PrivateData = @{
16+
PSData = @{
17+
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Security'
18+
LicenseUri = 'https://aka.ms/azps-license'
19+
ProjectUri = 'https://github.com/Azure/azure-powershell'
20+
ReleaseNotes = ''
21+
}
22+
}
23+
}
Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
<!-- region Generated -->
2+
# Az.Security
3+
This directory contains the PowerShell module for the Security service.
4+
5+
---
6+
## Status
7+
[![Az.Security](https://img.shields.io/powershellgallery/v/Az.Security.svg?style=flat-square&label=Az.Security "Az.Security")](https://www.powershellgallery.com/packages/Az.Security/)
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.Security`, see [how-to.md](how-to.md).
27+
<!-- endregion -->
28+
29+
### AutoRest Configuration
30+
> see https://aka.ms/autorest
31+
32+
###
33+
``` yaml
34+
commit: 6c4497e6b0aaad8127f2dd50fa8a29aaf68f24e6
35+
require:
36+
- $(this-folder)/../../readme.azure.noprofile.md
37+
input-file:
38+
- $(repo)/specification/security/resource-manager/Microsoft.Security/preview/2023-10-01-preview/securityConnectors.json
39+
- $(repo)/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/securityConnectorsDevOps.json
40+
- $(repo)/specification/security/resource-manager/Microsoft.Security/stable/2023-11-15/apiCollections.json
41+
42+
title: Security
43+
module-version: 1.5.1
44+
subject-prefix: $(service-name)
45+
enable-parent-pipeline-input: false
46+
47+
directive:
48+
- rename-model:
49+
from: EnvironmentData
50+
to: SecurityConnectorEnvironment
51+
- rename-model:
52+
from: AwsEnvironmentData
53+
to: AwsEnvironment
54+
- rename-model:
55+
from: GcpProjectEnvironmentData
56+
to: GcpProjectEnvironment
57+
- rename-model:
58+
from: AzureDevOpsScopeEnvironmentData
59+
to: AzureDevOpsScopeEnvironment
60+
- rename-model:
61+
from: GitlabScopeEnvironmentData
62+
to: GitLabScopeEnvironment
63+
- rename-model:
64+
from: GithubScopeEnvironmentData
65+
to: GitHubScopeEnvironment
66+
67+
- from: securityConnectors.json
68+
where: $.definitions
69+
debug: true
70+
transform: >
71+
$.defenderFoDatabasesAwsOffering['x-ms-client-name'] = 'DefenderForDatabasesAwsOffering'
72+
73+
- from: types.json
74+
where: $.definitions.Kind
75+
transform: >
76+
$['x-ms-client-name'] = 'ResourceKind';
77+
78+
- from: apiCollections.json
79+
where: $.paths..operationId
80+
transform: >
81+
return $.replace(/OffboardAzureApiManagementApi$/g, "ApiCollectionAPIM_Delete")
82+
83+
- where:
84+
verb: Invoke
85+
subject: ^AzureApiCollection$
86+
set:
87+
subject: ApiCollectionApimOnboard
88+
89+
- where:
90+
verb: Remove
91+
subject: ^ApiCollectionApim$
92+
set:
93+
verb: Invoke
94+
subject: ApiCollectionApimOffboard
95+
96+
# New-* cmdlets, ViaIdentity is not required
97+
- where:
98+
variant: ^(Create|Update)(?!.*?Expanded|JsonFilePath|JsonString)
99+
remove: true
100+
- where:
101+
variant: ^CreateViaIdentity.*$
102+
remove: true
103+
104+
# Remove the set-* cmdlet
105+
- where:
106+
verb: Set
107+
remove: true
108+
109+
- where:
110+
subject: ^(DevOpsConfiguration|AzureDevOps|GitHub|GitLab)(.*)
111+
set:
112+
subject-prefix: SecurityConnector
113+
114+
- where:
115+
subject: (.*)(AzureDevOpsRepos)$
116+
set:
117+
subject: $1AzureDevOpsRepo
118+
119+
- where:
120+
subject: (.*)(GitHubRepos)$
121+
set:
122+
subject: $1GitHubRepo
123+
124+
- where:
125+
verb: New
126+
subject: ^(AzureDevOpsOrg|AzureDevOpsProject|AzureDevOpsRepo)(.*)
127+
remove: true
128+
129+
- where:
130+
subject: ^(DevOpsOperationResult)(.*)
131+
remove: true
132+
133+
- where:
134+
subject: ^(DevOpsConfiguration|AzureDevOps|GitHub|GitLab)(.*)
135+
parameter-name: ProvisioningState
136+
hide: true
137+
138+
- where:
139+
verb: Update
140+
subject: ^(AzureDevOps)(.*)
141+
parameter-name: OnboardingState
142+
hide: true
143+
144+
- where:
145+
model-name: SecurityConnector
146+
set:
147+
format-table:
148+
properties:
149+
- Name
150+
- ResourceGroupName
151+
- EnvironmentName
152+
- Location
153+
- HierarchyIdentifier
154+
155+
- no-inline:
156+
- SecurityConnectorEnvironment
157+
- AwsOrganizationalData
158+
- GcpOrganizationalData
159+
- ActionableRemediation
160+
161+
- model-cmdlet:
162+
- model-name: AwsEnvironment
163+
- model-name: AwsOrganizationalDataMaster
164+
- model-name: AwsOrganizationalDataMember
165+
- model-name: GcpProjectEnvironment
166+
- model-name: GcpOrganizationalDataOrganization
167+
- model-name: GcpOrganizationalDataMember
168+
- model-name: AzureDevOpsScopeEnvironment
169+
- model-name: GitLabScopeEnvironment
170+
- model-name: GitHubScopeEnvironment
171+
- model-name: CspmMonitorAwsOffering
172+
- model-name: CspmMonitorGcpOffering
173+
- model-name: CspmMonitorGithubOffering
174+
- model-name: CspmMonitorAzureDevOpsOffering
175+
- model-name: CspmMonitorGitLabOffering
176+
- model-name: DefenderCspmAwsOffering
177+
- model-name: DefenderCspmGcpOffering
178+
- model-name: DefenderForContainersAwsOffering
179+
- model-name: DefenderForContainersGcpOffering
180+
- model-name: DefenderForDatabasesAwsOffering
181+
- model-name: DefenderForDatabasesGcpOffering
182+
- model-name: DefenderForServersAwsOffering
183+
- model-name: DefenderForServersGcpOffering
184+
- model-name: InformationProtectionAwsOffering
185+
- model-name: ActionableRemediation
186+
cmdlet-name: New-AzSecurityConnectorActionableRemediationObject
187+
```
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
{
2+
"resourceType": "service/apiCollections",
3+
"apiVersion": "2023-11-15",
4+
"learnMore": {
5+
"url": "https://learn.microsoft.com/powershell/module/az.security"
6+
},
7+
"commands": [
8+
{
9+
"name": "Get-AzSecurityApiCollection",
10+
"description": "Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs.\nIf an Azure API Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected.",
11+
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections/{apiId}",
12+
"help": {
13+
"learnMore": {
14+
"url": "https://learn.microsoft.com/powershell/module/az.security/get-azsecurityapicollection"
15+
},
16+
"parameterSets": [
17+
{
18+
"parameters": [
19+
"-ApiId <String>",
20+
"-ResourceGroupName <String>",
21+
"-ServiceName <String>",
22+
"[-SubscriptionId <String[]>]"
23+
]
24+
}
25+
]
26+
},
27+
"examples": [
28+
{
29+
"description": "Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs. If an Azure API Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected.",
30+
"parameters": [
31+
{
32+
"name": "-ApiId",
33+
"value": "[Path.apiId]"
34+
},
35+
{
36+
"name": "-ResourceGroupName",
37+
"value": "[Path.resourceGroupName]"
38+
},
39+
{
40+
"name": "-ServiceName",
41+
"value": "[Path.serviceName]"
42+
},
43+
{
44+
"name": "-SubscriptionId",
45+
"value": "[Path.subscriptionId]"
46+
}
47+
]
48+
}
49+
]
50+
},
51+
{
52+
"name": "Invoke-AzSecurityApiCollectionApimOffboard",
53+
"description": "Offboard an Azure API Management API from Microsoft Defender for APIs.\nThe system will stop monitoring the operations within the Azure API Management API for intrusive behaviors.",
54+
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections/{apiId}",
55+
"help": {
56+
"learnMore": {
57+
"url": "https://learn.microsoft.com/powershell/module/az.security/invoke-azsecurityapicollectionapimoffboard"
58+
},
59+
"parameterSets": [
60+
{
61+
"parameters": [
62+
"-ApiId <String>",
63+
"-ResourceGroupName <String>",
64+
"-ServiceName <String>",
65+
"[-SubscriptionId <String>]"
66+
]
67+
}
68+
]
69+
},
70+
"examples": [
71+
{
72+
"description": "Offboard an Azure API Management API from Microsoft Defender for APIs. The system will stop monitoring the operations within the Azure API Management API for intrusive behaviors.",
73+
"parameters": [
74+
{
75+
"name": "-ApiId",
76+
"value": "[Path.apiId]"
77+
},
78+
{
79+
"name": "-ResourceGroupName",
80+
"value": "[Path.resourceGroupName]"
81+
},
82+
{
83+
"name": "-ServiceName",
84+
"value": "[Path.serviceName]"
85+
},
86+
{
87+
"name": "-SubscriptionId",
88+
"value": "[Path.subscriptionId]"
89+
}
90+
]
91+
}
92+
]
93+
},
94+
{
95+
"name": "Invoke-AzSecurityApiCollectionApimOnboard",
96+
"description": "Onboard an Azure API Management API to Microsoft Defender for APIs.\nThe system will start monitoring the operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been detected.",
97+
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections/{apiId}",
98+
"help": {
99+
"learnMore": {
100+
"url": "https://learn.microsoft.com/powershell/module/az.security/invoke-azsecurityapicollectionapimonboard"
101+
},
102+
"parameterSets": [
103+
{
104+
"parameters": [
105+
"-ApiId <String>",
106+
"-ResourceGroupName <String>",
107+
"-ServiceName <String>",
108+
"[-SubscriptionId <String>]"
109+
]
110+
}
111+
]
112+
},
113+
"examples": [
114+
{
115+
"description": "Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been detected.",
116+
"parameters": [
117+
{
118+
"name": "-ApiId",
119+
"value": "[Path.apiId]"
120+
},
121+
{
122+
"name": "-ResourceGroupName",
123+
"value": "[Path.resourceGroupName]"
124+
},
125+
{
126+
"name": "-ServiceName",
127+
"value": "[Path.serviceName]"
128+
},
129+
{
130+
"name": "-SubscriptionId",
131+
"value": "[Path.subscriptionId]"
132+
}
133+
]
134+
}
135+
]
136+
}
137+
]
138+
}

0 commit comments

Comments
 (0)