Skip to content

Commit f3fcfb4

Browse files
Add resource prefix for safe secret standard alerts (Azure#40028)
Add the prefix to identify RGs that we are creating in our TME tenant to identify them as potentially using local auth and violating our safe secret standards. Co-authored-by: Wes Haggard <Wes.Haggard@microsoft.com>
1 parent c33e4f7 commit f3fcfb4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

eng/common/TestResources/New-TestResources.ps1

+12
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,18 @@ try {
194194
-serviceDirectoryName $serviceName `
195195
-CI $CI
196196

197+
if ($wellKnownTMETenants.Contains($TenantId)) {
198+
# Add a prefix to the resource group name to avoid flagging the usages of local auth
199+
# See details at https://eng.ms/docs/products/onecert-certificates-key-vault-and-dsms/key-vault-dsms/certandsecretmngmt/credfreefaqs#how-can-i-disable-s360-reporting-when-testing-customer-facing-3p-features-that-depend-on-use-of-unsafe-local-auth
200+
$ResourceGroupName = "SSS3PT_" + $ResourceGroupName
201+
}
202+
203+
if ($ResourceGroupName.Length -gt 90) {
204+
# See limits at https://docs.microsoft.com/azure/architecture/best-practices/resource-naming
205+
Write-Warning -Message "Resource group name '$ResourceGroupName' is too long. So pruning it to be the first 90 characters."
206+
$ResourceGroupName = $ResourceGroupName.Substring(0, 90)
207+
}
208+
197209
# Make sure pre- and post-scripts are passed formerly required arguments.
198210
$PSBoundParameters['BaseName'] = $BaseName
199211

0 commit comments

Comments
 (0)