Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Fixed complaint on Managed instance's system database for vulnerability assessment" #13040

Merged
merged 1 commit into from
Sep 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/Sql/Sql/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
- Additional information about change #1
-->
## Upcoming Release
* Fixed complaint on Managed instance's system database for vulnerability assessment
* Added warning for BackupStorageRedundancy configuration in select regions in `New-AzSqlDatabase` (Ignore Case for BackupStorageRedundancy configuration input)
* Fixed for bug in `New-AzSqlDatabaseExport`
* Removed case sensitivity for BackupStorageRedundancy parameter for `New-AzSqlInstance`
Expand Down
9 changes: 9 additions & 0 deletions src/Sql/Sql/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/Sql/Sql/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,9 @@
<data name="RetrievingStorageAccountKeysFailed" xml:space="preserve">
<value>Failed retrieving keys of storage '{0}'.</value>
</data>
<data name="VulnerabilityAssessmentOperationIsNotAvailableOnManagedInstanceSystemDatabase" xml:space="preserve">
<value>Vulnerability Assessment operation is not available on managed instance system database. Skipping...</value>
</data>
<data name="KeyIdNotFoundForAzureKeyVaultEncryptionProtectorError" xml:space="preserve">
<value>KeyId parameter is required for encryption protector type AzureKeyVault</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,20 @@ protected override object TransformModelToOutputObject(VulnerabilityAssessmentRu
{
return new ManagedDatabaseVulnerabilityAssessmentRuleBaselineModel(model, GetServerName(), GetDatabaseName());
}

/// <summary>
/// Overriding to add warning message in case cmdlet is on master
/// </summary>
public override void ExecuteCmdlet()
{
var database = GetDatabaseName();
if (database == "master" || database == "msdb" || database == "model")
{
WriteWarning(Resources.VulnerabilityAssessmentOperationIsNotAvailableOnManagedInstanceSystemDatabase);
return;
}

base.ExecuteCmdlet();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,20 @@ protected override object TransformModelToOutputObject(VulnerabilityAssessmentRu
{
return new ManagedDatabaseVulnerabilityAssessmentRuleBaselineModel(model, GetServerName(), GetDatabaseName());
}

/// <summary>
/// Overriding to add warning message in case cmdlet is on master
/// </summary>
public override void ExecuteCmdlet()
{
var database = GetDatabaseName();
if (database == "master" || database == "msdb" || database == "model")
{
WriteWarning(Resources.VulnerabilityAssessmentOperationIsNotAvailableOnManagedInstanceSystemDatabase);
return;
}

base.ExecuteCmdlet();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,20 @@ protected override object TransformModelToOutputObject(VulnerabilityAssessmentRu
{
return new ManagedDatabaseVulnerabilityAssessmentRuleBaselineModel(model, GetServerName(), GetDatabaseName());
}

/// <summary>
/// Overriding to add warning message in case cmdlet is on master
/// </summary>
public override void ExecuteCmdlet()
{
var database = GetDatabaseName();
if (database == "master" || database == "msdb" || database == "model")
{
WriteWarning(Resources.VulnerabilityAssessmentOperationIsNotAvailableOnManagedInstanceSystemDatabase);
return;
}

base.ExecuteCmdlet();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,20 @@ protected override object TransformModelToOutputObject(VulnerabilityAssessmentSc
{
return new ManagedDatabaseVulnerabilityAssessmentScanExportModel(model, GetServerName(), GetDatabaseName());
}

/// <summary>
/// Overriding to add warning message in case cmdlet is on master
/// </summary>
public override void ExecuteCmdlet()
{
var database = GetDatabaseName();
if (database == "master" || database == "msdb" || database == "model")
{
WriteWarning(Resources.VulnerabilityAssessmentOperationIsNotAvailableOnManagedInstanceSystemDatabase);
return;
}

base.ExecuteCmdlet();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,20 @@ protected override object TransformModelToOutputObject(IEnumerable<Vulnerability
{
return models.Select(model => new ManagedDatabaseVulnerabilityAssessmentScanRecordModel(model, GetServerName(), GetDatabaseName()));
}

/// <summary>
/// Overriding to add warning message in case cmdlet is on master
/// </summary>
public override void ExecuteCmdlet()
{
var database = GetDatabaseName();
if (database == "master" || database == "msdb" || database == "model")
{
WriteWarning(Resources.VulnerabilityAssessmentOperationIsNotAvailableOnManagedInstanceSystemDatabase);
return;
}

base.ExecuteCmdlet();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,20 @@ protected override object TransformModelToOutputObject(VulnerabilityAssessmentSc
{
return new ManagedDatabaseVulnerabilityAssessmentScanRecordModel(model, GetServerName(), GetDatabaseName());
}

/// <summary>
/// Overriding to add warning message in case cmdlet is on master
/// </summary>
public override void ExecuteCmdlet()
{
var database = GetDatabaseName();
if (database == "master" || database == "msdb" || database == "model")
{
WriteWarning(Resources.VulnerabilityAssessmentOperationIsNotAvailableOnManagedInstanceSystemDatabase);
return;
}

base.ExecuteCmdlet();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,20 @@ protected override object TransformModelToOutputObject(VulnerabilityAssessmentSe
{
return new ManagedDatabaseVulnerabilityAssessmentSettingsModel(model, GetServerName(), GetDatabaseName());
}

/// <summary>
/// Overriding to add warning message in case cmdlet is on master
/// </summary>
public override void ExecuteCmdlet()
{
var database = GetDatabaseName();
if (database == "master" || database == "msdb" || database == "model")
{
WriteWarning(Resources.VulnerabilityAssessmentOperationIsNotAvailableOnManagedInstanceSystemDatabase);
return;
}

base.ExecuteCmdlet();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,20 @@ protected override object TransformModelToOutputObject(VulnerabilityAssessmentSe
{
return new ManagedDatabaseVulnerabilityAssessmentSettingsModel(model, GetServerName(), GetDatabaseName());
}

/// <summary>
/// Overriding to add warning message in case cmdlet is on master
/// </summary>
public override void ExecuteCmdlet()
{
var database = GetDatabaseName();
if (database == "master" || database == "msdb" || database == "model")
{
WriteWarning(Resources.VulnerabilityAssessmentOperationIsNotAvailableOnManagedInstanceSystemDatabase);
return;
}

base.ExecuteCmdlet();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,20 @@ protected override object TransformModelToOutputObject(VulnerabilityAssessmentSe
{
return new ManagedDatabaseVulnerabilityAssessmentSettingsModel(model, GetServerName(), GetDatabaseName());
}

/// <summary>
/// Overriding to add warning message in case cmdlet is on master
/// </summary>
public override void ExecuteCmdlet()
{
var database = GetDatabaseName();
if (database == "master" || database == "msdb" || database == "model")
{
WriteWarning(Resources.VulnerabilityAssessmentOperationIsNotAvailableOnManagedInstanceSystemDatabase);
return;
}

base.ExecuteCmdlet();
}
}
}