From 217fe345ad51f5602605ba2eb13640fb6e4090e2 Mon Sep 17 00:00:00 2001 From: Anthony Martin Date: Fri, 30 Jul 2021 15:31:53 -0400 Subject: [PATCH] Improve performance of `no-hardcoded-env-urls` linter rule (#3833) * Test replacing the regex with basic string matching * Add checks for valid subdomain vs substring * Refactor Co-authored-by: jofleish --- docs/linter-rules/no-hardcoded-env-urls.md | 7 - .../LinterRuleTests/LinterRuleTestsBase.cs | 32 ++-- .../NoHardcodedEnvironmentUrlsRuleTests.cs | 21 +-- .../NoUnusedParametersRuleTests.cs | 10 +- .../NoUnusedVariablesRuleTests.cs | 10 +- .../PreferInterpolationRuleTests.cs | 22 ++- .../SimplifyInterpolationRuleTests.cs | 22 ++- .../Rules/NoHardcodedEnvironmentUrlsRule.cs | 145 +++++++++++------- src/Bicep.Core/Configuration/bicepconfig.json | 7 - .../schemas/bicepconfig.schema.json | 7 - 10 files changed, 141 insertions(+), 142 deletions(-) diff --git a/docs/linter-rules/no-hardcoded-env-urls.md b/docs/linter-rules/no-hardcoded-env-urls.md index f11f456b9ea..83af04ac872 100644 --- a/docs/linter-rules/no-hardcoded-env-urls.md +++ b/docs/linter-rules/no-hardcoded-env-urls.md @@ -36,7 +36,6 @@ The set of URL hosts to disallow may be customized using the `disallowedHosts` p "no-hardcoded-env-urls": { "level": "warning", "disallowedHosts": [ - "management.core.windows.net", "gallery.azure.com", "management.core.windows.net", "management.azure.com", @@ -45,17 +44,11 @@ The set of URL hosts to disallow may be customized using the `disallowedHosts` p "login.microsoftonline.com", "graph.windows.net", "trafficmanager.net", - "vault.azure.net", "datalake.azure.net", "azuredatalakestore.net", "azuredatalakeanalytics.net", "vault.azure.net", "api.loganalytics.io", - "api.loganalytics.iov1", - "asazure.windows.net", - "region.asazure.windows.net", - "api.loganalytics.iov1", - "api.loganalytics.io", "asazure.windows.net", "region.asazure.windows.net", "batch.core.windows.net" diff --git a/src/Bicep.Core.UnitTests/Diagnostics/LinterRuleTests/LinterRuleTestsBase.cs b/src/Bicep.Core.UnitTests/Diagnostics/LinterRuleTests/LinterRuleTestsBase.cs index 291ab35d490..1780b9b1a44 100644 --- a/src/Bicep.Core.UnitTests/Diagnostics/LinterRuleTests/LinterRuleTestsBase.cs +++ b/src/Bicep.Core.UnitTests/Diagnostics/LinterRuleTests/LinterRuleTestsBase.cs @@ -4,31 +4,37 @@ using Bicep.Core.Analyzers.Linter; using Bicep.Core.Analyzers.Linter.Rules; using Bicep.Core.Diagnostics; +using Bicep.Core.UnitTests.Assertions; using Bicep.Core.UnitTests.Utils; using FluentAssertions; using FluentAssertions.Execution; +using System; +using System.Collections.Generic; using System.Linq; namespace Bicep.Core.UnitTests.Diagnostics.LinterRuleTests { public class LinterRuleTestsBase { - virtual protected void CompileAndTest(string ruleCode, string text, int expectedDiagnosticCount) - { - using (new AssertionScope($"linter errors for this code:\n{text}\n")) - { - var errors = GetDiagnostics(ruleCode, text); - errors.Should().HaveCount(expectedDiagnosticCount); - } - } + protected void CompileAndTest(string ruleCode, string text, int expectedDiagnosticCount) + => AssertRuleCodeDiagnostics(ruleCode, text, diags => diags.Should().HaveCount(expectedDiagnosticCount)); - protected IDiagnostic[] GetDiagnostics(string ruleCode, string text) + protected void AssertRuleCodeDiagnostics(string ruleCode, string text, Action> assertAction) + => DoWithDiagnosticAnnotations( + text, + diag => diag.Code == ruleCode, + assertAction); + + private void DoWithDiagnosticAnnotations(string text, Func filterFunc, Action> assertAction) { - var compilationResult = CompilationHelper.Compile(text); - var internalRuleErrors = compilationResult.Diagnostics.Where(d => d.Code == LinterAnalyzer.FailedRuleCode).ToArray(); - internalRuleErrors.Count().Should().Be(0, "There should never be linter FailedRuleCode errors"); + var result = CompilationHelper.Compile(text); + + result.Should().NotHaveDiagnosticsWithCodes(new [] { LinterAnalyzer.FailedRuleCode }, "There should never be linter FailedRuleCode errors"); - return compilationResult.Diagnostics.OfType().Where(d => d.Code == ruleCode).ToArray(); + DiagnosticAssertions.DoWithDiagnosticAnnotations( + result.Compilation.SourceFileGrouping.EntryPoint, + result.Diagnostics.Where(filterFunc), + assertAction); } } } diff --git a/src/Bicep.Core.UnitTests/Diagnostics/LinterRuleTests/NoHardcodedEnvironmentUrlsRuleTests.cs b/src/Bicep.Core.UnitTests/Diagnostics/LinterRuleTests/NoHardcodedEnvironmentUrlsRuleTests.cs index b6b2a091cf4..67627500ee2 100644 --- a/src/Bicep.Core.UnitTests/Diagnostics/LinterRuleTests/NoHardcodedEnvironmentUrlsRuleTests.cs +++ b/src/Bicep.Core.UnitTests/Diagnostics/LinterRuleTests/NoHardcodedEnvironmentUrlsRuleTests.cs @@ -1,20 +1,11 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +using System.Linq; using Azure.Deployments.Core.Extensions; using Bicep.Core.Analyzers.Linter.Rules; using Bicep.Core.Configuration; -using Bicep.Core.Text; -using Bicep.Core.Diagnostics; -using Bicep.Core.UnitTests.Assertions; -using Bicep.Core.UnitTests.Utils; -using FluentAssertions; -using FluentAssertions.Execution; using Microsoft.VisualStudio.TestTools.UnitTesting; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text.RegularExpressions; // TODO: Test with different configs namespace Bicep.Core.UnitTests.Diagnostics.LinterRuleTests @@ -162,14 +153,13 @@ public void InsideExpressions(int diagnosticCount, string text) [DataRow("subdomain1.management.azzzure.com", false)] [DataRow("http://subdomain1.manageeeement.azure.com", false)] [DataRow("https://subdomain1.managemeeeent.azure.com", false)] - public void DisallowedHostsRegexTest(string host, bool isMatch) + public void DisallowedHostsMatchingTest(string testString, bool isMatch) { var rule = new NoHardcodedEnvironmentUrlsRule(); var configHelper = new ConfigHelper(); // this ensures configuration is loaded from resources rule.Configure(configHelper.Config); - var regex = rule.CreateDisallowedHostRegex(); - Assert.AreEqual(isMatch, regex.IsMatch(host)); + Assert.AreEqual(isMatch, actual: rule.DisallowedHosts.Any(host => NoHardcodedEnvironmentUrlsRule.FindHostnameMatches(host, testString).Any())); } [DataTestMethod] @@ -192,14 +182,13 @@ public void DisallowedHostsRegexTest(string host, bool isMatch) [DataRow("https://subdomain1.management.azure.com", false)] [DataRow("all the world is a stage, but subdomain1.management.azure.com should not be hardcoded", false)] [DataRow("all the world is a stage, but subdomain1.schema.management.azure.com should not be hardcoded", true)] - public void ExcludedHostsRegexTest(string host, bool isMatch) + public void ExcludedHostsMatchingTest(string testString, bool isMatch) { var rule = new NoHardcodedEnvironmentUrlsRule(); var configHelper = new ConfigHelper(); // this ensures configuration is loaded from resources rule.Configure(configHelper.Config); - var regex = rule.CreateExcludedHostsRegex(); - Assert.AreEqual(isMatch, regex.IsMatch(host)); + Assert.AreEqual(isMatch, rule.ExcludedHosts.Any(host => NoHardcodedEnvironmentUrlsRule.FindHostnameMatches(host, testString).Any())); } } } diff --git a/src/Bicep.Core.UnitTests/Diagnostics/LinterRuleTests/NoUnusedParametersRuleTests.cs b/src/Bicep.Core.UnitTests/Diagnostics/LinterRuleTests/NoUnusedParametersRuleTests.cs index f90b67f5732..2b5a6dffde4 100644 --- a/src/Bicep.Core.UnitTests/Diagnostics/LinterRuleTests/NoUnusedParametersRuleTests.cs +++ b/src/Bicep.Core.UnitTests/Diagnostics/LinterRuleTests/NoUnusedParametersRuleTests.cs @@ -22,20 +22,18 @@ public void ParameterNameInFormattedMessage() private void CompileAndTest(string text, params string[] unusedParams) { - using (new AssertionScope($"linter errors for this code:\n{text}\n")) - { - var errors = GetDiagnostics(NoUnusedParametersRule.Code, text); + AssertRuleCodeDiagnostics(NoUnusedParametersRule.Code, text, diags => { if (unusedParams.Any()) { var rule = new NoUnusedParametersRule(); string[] expectedMessages = unusedParams.Select(p => rule.GetMessage(p)).ToArray(); - errors.Select(e => e.Message).Should().ContainInOrder(expectedMessages); + diags.Select(e => e.Message).Should().ContainInOrder(expectedMessages); } else { - errors.Should().BeEmpty(); + diags.Should().BeEmpty(); } - } + }); } [DataRow(@" diff --git a/src/Bicep.Core.UnitTests/Diagnostics/LinterRuleTests/NoUnusedVariablesRuleTests.cs b/src/Bicep.Core.UnitTests/Diagnostics/LinterRuleTests/NoUnusedVariablesRuleTests.cs index c35680fd33c..b5583caca8a 100644 --- a/src/Bicep.Core.UnitTests/Diagnostics/LinterRuleTests/NoUnusedVariablesRuleTests.cs +++ b/src/Bicep.Core.UnitTests/Diagnostics/LinterRuleTests/NoUnusedVariablesRuleTests.cs @@ -23,20 +23,18 @@ public void VariableNameInFormattedMessage() private void CompileAndTest(string text, params string[] unusedVars) { - using (new AssertionScope($"linter errors for this code:\n{text}\n")) - { - var errors = GetDiagnostics(NoUnusedVariablesRule.Code, text); + AssertRuleCodeDiagnostics(NoUnusedVariablesRule.Code, text, diags => { if (unusedVars.Any()) { var rule = new NoUnusedVariablesRule(); string[] expectedMessages = unusedVars.Select(p => rule.GetMessage(p)).ToArray(); - errors.Select(e => e.Message).Should().ContainInOrder(expectedMessages); + diags.Select(e => e.Message).Should().ContainInOrder(expectedMessages); } else { - errors.Should().BeEmpty(); + diags.Should().BeEmpty(); } - } + }); } [DataRow(@" diff --git a/src/Bicep.Core.UnitTests/Diagnostics/LinterRuleTests/PreferInterpolationRuleTests.cs b/src/Bicep.Core.UnitTests/Diagnostics/LinterRuleTests/PreferInterpolationRuleTests.cs index 7a8479a1756..ffbc13f0471 100644 --- a/src/Bicep.Core.UnitTests/Diagnostics/LinterRuleTests/PreferInterpolationRuleTests.cs +++ b/src/Bicep.Core.UnitTests/Diagnostics/LinterRuleTests/PreferInterpolationRuleTests.cs @@ -19,11 +19,9 @@ public class PreferInterpolationRuleTests : LinterRuleTestsBase { private void ExpectPass(string text) { - using (new AssertionScope($"linter errors for this code:\n{text}\n")) - { - var errors = GetDiagnostics(PreferInterpolationRule.Code, text); - errors.Should().HaveCount(0, $"expecting linter rule to pass"); - } + AssertRuleCodeDiagnostics(PreferInterpolationRule.Code, text, diags => { + diags.Should().HaveCount(0, $"expecting linter rule to pass"); + }); } private void ExpectDiagnosticWithFix(string text, string expectedFix) @@ -33,15 +31,13 @@ private void ExpectDiagnosticWithFix(string text, string expectedFix) private void ExpectDiagnosticWithFix(string text, string[] expectedFixes) { - using (new AssertionScope($"linter errors for this code:\n{text}\n")) - { - var errors = GetDiagnostics(PreferInterpolationRule.Code, text); - errors.Should().HaveCount(expectedFixes.Length, $"expecting one fix per testcase"); + AssertRuleCodeDiagnostics(PreferInterpolationRule.Code, text, diags => { + diags.Should().HaveCount(expectedFixes.Length, $"expecting one fix per testcase"); - errors.First().As().Fixes.Should().HaveCount(1); - errors.First().As().Fixes.First().Replacements.Should().HaveCount(1); - var a = errors.First().As().Fixes.SelectMany(f => f.Replacements.SelectMany(r => r.Text)); - } + diags.First().As().Fixes.Should().HaveCount(1); + diags.First().As().Fixes.First().Replacements.Should().HaveCount(1); + var a = diags.First().As().Fixes.SelectMany(f => f.Replacements.SelectMany(r => r.Text)); + }); } [DataRow(@" diff --git a/src/Bicep.Core.UnitTests/Diagnostics/LinterRuleTests/SimplifyInterpolationRuleTests.cs b/src/Bicep.Core.UnitTests/Diagnostics/LinterRuleTests/SimplifyInterpolationRuleTests.cs index aa89fa86997..30ec81fdc2f 100644 --- a/src/Bicep.Core.UnitTests/Diagnostics/LinterRuleTests/SimplifyInterpolationRuleTests.cs +++ b/src/Bicep.Core.UnitTests/Diagnostics/LinterRuleTests/SimplifyInterpolationRuleTests.cs @@ -21,24 +21,20 @@ public class SimplifyInterpolationRuleTests : LinterRuleTestsBase { private void ExpectPass(string text) { - using (new AssertionScope($"linter errors for this code:\n{text}\n")) - { - var errors = GetDiagnostics(SimplifyInterpolationRule.Code, text); - errors.Should().HaveCount(0, $"expecting linter rule to pass"); - } + AssertRuleCodeDiagnostics(SimplifyInterpolationRule.Code, text, diags => { + diags.Should().HaveCount(0, $"expecting linter rule to pass"); + }); } private void ExpectDiagnosticWithFix(string text, string expectedFix) { - using (new AssertionScope($"linter errors for this code:\n{text}\n")) - { - var errors = GetDiagnostics(SimplifyInterpolationRule.Code, text); - errors.Should().HaveCount(1, $"expected one fix per testcase"); + AssertRuleCodeDiagnostics(SimplifyInterpolationRule.Code, text, diags => { + diags.Should().HaveCount(1, $"expected one fix per testcase"); - errors.First().As().Fixes.Should().HaveCount(1); - errors.First().As().Fixes.First().Replacements.Should().HaveCount(1); - errors.First().As().Fixes.First().Replacements.First().Text.Should().Be(expectedFix); - } + diags.First().As().Fixes.Should().HaveCount(1); + diags.First().As().Fixes.First().Replacements.Should().HaveCount(1); + diags.First().As().Fixes.First().Replacements.First().Text.Should().Be(expectedFix); + }); } [DataRow( diff --git a/src/Bicep.Core/Analyzers/Linter/Rules/NoHardcodedEnvironmentUrlsRule.cs b/src/Bicep.Core/Analyzers/Linter/Rules/NoHardcodedEnvironmentUrlsRule.cs index 1ebea5e81ee..142026eae98 100644 --- a/src/Bicep.Core/Analyzers/Linter/Rules/NoHardcodedEnvironmentUrlsRule.cs +++ b/src/Bicep.Core/Analyzers/Linter/Rules/NoHardcodedEnvironmentUrlsRule.cs @@ -10,7 +10,6 @@ using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; -using System.Text.RegularExpressions; namespace Bicep.Core.Analyzers.Linter.Rules { @@ -18,81 +17,116 @@ public sealed class NoHardcodedEnvironmentUrlsRule : LinterRuleBase { public new const string Code = "no-hardcoded-env-urls"; - public ImmutableArray? DisallowedHosts; + private ImmutableArray? disallowedHosts; + public ImmutableArray DisallowedHosts => disallowedHosts.HasValue ? disallowedHosts.Value : ImmutableArray.Empty; + + private ImmutableArray? excludedHosts; + public ImmutableArray ExcludedHosts => excludedHosts.HasValue ? excludedHosts.Value : ImmutableArray.Empty; - private ImmutableArray? ExcludedHosts; private int MinimumHostLength; private bool HasHosts; - private readonly Lazy hostRegexLazy; - private Regex hostRegex => hostRegexLazy.Value; - - private readonly Lazy excludedRegexLazy; - private Regex excludedRegex => excludedRegexLazy.Value; - public NoHardcodedEnvironmentUrlsRule() : base( code: Code, description: CoreResources.EnvironmentUrlHardcodedRuleDescription, docUri: new Uri("https://aka.ms/bicep/linter/no-hardcoded-env-urls")) { - this.hostRegexLazy = new Lazy(CreateDisallowedHostRegex); - this.excludedRegexLazy = new Lazy(CreateExcludedHostsRegex); } public override void Configure(IConfigurationRoot config) { base.Configure(config); - this.DisallowedHosts = GetArray(nameof(DisallowedHosts), Array.Empty()) + this.disallowedHosts = GetArray(nameof(DisallowedHosts), Array.Empty()) .ToImmutableArray(); - this.MinimumHostLength = this.DisallowedHosts.Value.Min(h => h.Length); - this.ExcludedHosts = GetArray(nameof(ExcludedHosts), Array.Empty()) + this.MinimumHostLength = this.disallowedHosts.Value.Min(h => h.Length); + this.excludedHosts = GetArray(nameof(ExcludedHosts), Array.Empty()) .ToImmutableArray(); - this.HasHosts = this.DisallowedHosts?.Any() ?? false; + this.HasHosts = this.disallowedHosts?.Any() ?? false; } public override string FormatMessage(params object[] values) => string.Format("{0} Found this disallowed host: \"{1}\"", this.Description, values.First()); - /// - /// Note that this regex requires the match to be at a subdomain boundary - /// so that there is not a partial match "mid-word". The subdomain must - /// be proceeded by a text break (., or slash, or space) or at the beginning - /// of a line. - /// - /// - public Regex CreateDisallowedHostRegex() => - new Regex(string.Join('|', this.DisallowedHosts!.Value.Select(h => $@"(?<=\.|'|{{|}}|\s|^|/){Regex.Escape(h)}")), - RegexOptions.Compiled | RegexOptions.IgnoreCase); - - public Regex CreateExcludedHostsRegex() => - new Regex(string.Join('|', this.ExcludedHosts!.Value.Select(h => $@"(?<=\.|'|{{|}}|\s|^|/){Regex.Escape(h)}")), - RegexOptions.Compiled | RegexOptions.IgnoreCase); - public override IEnumerable AnalyzeInternal(SemanticModel model) { if (HasHosts) { - var visitor = new Visitor(this.hostRegex, this.MinimumHostLength, this.excludedRegex); + var visitor = new Visitor(this.DisallowedHosts, this.MinimumHostLength, this.ExcludedHosts); visitor.Visit(model.SourceFile.ProgramSyntax); + return visitor.DisallowedHostSpans.Select(entry => CreateDiagnosticForSpan(entry.Key, entry.Value)); } + return Enumerable.Empty(); } - private class Visitor : SyntaxVisitor + public static IEnumerable<(TextSpan RelativeSpan, string Value)> FindHostnameMatches(string hostname, string srcText) + { + bool isExactDomainMatch(int index) + { + var leadingAlnum = index > 0 && + char.IsLetterOrDigit(srcText[index - 1]); + var trailingAlnum = index + hostname.Length < srcText.Length && + char.IsLetterOrDigit(srcText[index + hostname.Length]); + + return !leadingAlnum && !trailingAlnum; + } + + if (hostname.Length == 0) + { + // ensure we terminate - the below for-loop uses this value to increment + yield break; + } + + var matchIndex = -1; + for (var startIndex = 0; startIndex <= srcText.Length - hostname.Length; startIndex = matchIndex + hostname.Length) + { + matchIndex = srcText.IndexOf(hostname, startIndex, StringComparison.OrdinalIgnoreCase); + if (matchIndex < 0) + { + // we haven't foud any instances of the hostname + yield break; + } + + // check preceding and trailing chars to verify we're not dealing with a substring + if (isExactDomainMatch(matchIndex)) + { + var matchText = srcText.Substring(matchIndex, hostname.Length); + yield return (RelativeSpan: new TextSpan(matchIndex, hostname.Length), Value: matchText); + } + } + } + + private sealed class Visitor : SyntaxVisitor { public readonly Dictionary DisallowedHostSpans = new Dictionary(); - private readonly Regex hostRegex; + private readonly ImmutableArray disallowedHosts; private readonly int minHostLen; - private readonly Regex exclusionRegex; + private readonly ImmutableArray excludedHosts; - public Visitor(Regex disallowedRegex, int minHostLen, Regex exclusionRegex) + public Visitor(ImmutableArray disallowedHosts, int minHostLen, ImmutableArray excludedHosts) { - this.hostRegex = disallowedRegex; + this.disallowedHosts = disallowedHosts; this.minHostLen = minHostLen; - this.exclusionRegex = exclusionRegex; + this.excludedHosts = excludedHosts; + } + + public IEnumerable<(TextSpan RelativeSpan, string Value)> RemoveOverlapping(IEnumerable<(TextSpan RelativeSpan, string Value)> matches) + { + TextSpan? prevSpan = null; + foreach (var match in matches.OrderBy(x => x.RelativeSpan.Position).ThenByDescending(x => x.RelativeSpan.Length)) + { + if (prevSpan is not null && TextSpan.AreOverlapping(match.RelativeSpan, prevSpan)) + { + continue; + } + + yield return match; + + prevSpan = match.RelativeSpan; + } } public override void VisitStringSyntax(StringSyntax syntax) @@ -105,27 +139,30 @@ public override void VisitStringSyntax(StringSyntax syntax) // shortcut check by testing length of token if (token.Text.Length >= minHostLen) { - var disallowedMatches = this.hostRegex.Matches(token.Text); + var disallowedMatches = disallowedHosts + .SelectMany(host => FindHostnameMatches(host, token.Text)) + .ToImmutableArray(); - if (disallowedMatches.Any()) + if (!disallowedMatches.Any()) { - var exclusionMatches = exclusionRegex.Matches(token.Text); + break; + } - // does this segment have a host match - foreach (Match match in disallowedMatches) - { + var exclusionMatches = excludedHosts + .SelectMany(host => FindHostnameMatches(host, token.Text)) + .ToImmutableArray(); + + foreach (var match in RemoveOverlapping(disallowedMatches)) + { + // exclusion is found containing the host match + var hasExclusion = exclusionMatches.Any(exclusionMatch => + TextSpan.AreOverlapping(exclusionMatch.RelativeSpan, match.RelativeSpan)); - // exclusion is found containing the host match - var isExcluded = exclusionMatches.Any(exclusionMatch => - match.Index > exclusionMatch.Index - && match.Index + match.Length <= exclusionMatch.Index + exclusionMatch.Length); - - if (!isExcluded) - { - // create a span for the specific identified instance - // to allow for multiple instances in a single syntax - this.DisallowedHostSpans[new TextSpan(token.Span.Position + match.Index, match.Length)] = match.Value; - } + if (!hasExclusion) + { + // create a span for the specific identified instance + // to allow for multiple instances in a single syntax + this.DisallowedHostSpans[new TextSpan(token.Span.Position + match.RelativeSpan.Position, match.RelativeSpan.Length)] = match.Value; } } } diff --git a/src/Bicep.Core/Configuration/bicepconfig.json b/src/Bicep.Core/Configuration/bicepconfig.json index 52897f28b06..fb68d91bc21 100644 --- a/src/Bicep.Core/Configuration/bicepconfig.json +++ b/src/Bicep.Core/Configuration/bicepconfig.json @@ -7,7 +7,6 @@ "no-hardcoded-env-urls": { "level": "warning", "disallowedhosts": [ - "management.core.windows.net", "gallery.azure.com", "management.core.windows.net", "management.azure.com", @@ -16,17 +15,11 @@ "login.microsoftonline.com", "graph.windows.net", "trafficmanager.net", - "vault.azure.net", "datalake.azure.net", "azuredatalakestore.net", "azuredatalakeanalytics.net", "vault.azure.net", "api.loganalytics.io", - "api.loganalytics.iov1", - "asazure.windows.net", - "region.asazure.windows.net", - "api.loganalytics.iov1", - "api.loganalytics.io", "asazure.windows.net", "region.asazure.windows.net", "batch.core.windows.net" diff --git a/src/vscode-bicep/schemas/bicepconfig.schema.json b/src/vscode-bicep/schemas/bicepconfig.schema.json index a0e100031be..3af042e0f63 100644 --- a/src/vscode-bicep/schemas/bicepconfig.schema.json +++ b/src/vscode-bicep/schemas/bicepconfig.schema.json @@ -96,7 +96,6 @@ "description": "Customize the list of hosts to disallow", "type": "array", "default": [ - "management.core.windows.net", "gallery.azure.com", "management.core.windows.net", "management.azure.com", @@ -105,17 +104,11 @@ "login.microsoftonline.com", "graph.windows.net", "trafficmanager.net", - "vault.azure.net", "datalake.azure.net", "azuredatalakestore.net", "azuredatalakeanalytics.net", "vault.azure.net", "api.loganalytics.io", - "api.loganalytics.iov1", - "asazure.windows.net", - "region.asazure.windows.net", - "api.loganalytics.iov1", - "api.loganalytics.io", "asazure.windows.net", "region.asazure.windows.net", "batch.core.windows.net"