Secure enclave touch ups (#1964)

This commit is contained in:
Cheena Malhotra
2023-03-23 20:59:38 -07:00
committed by GitHub
parent 8b7600eb5b
commit 3ef3a0f022
6 changed files with 47 additions and 20 deletions

View File

@@ -1428,6 +1428,10 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection
switch (connectionDetails.SecureEnclaves.ToUpper()) switch (connectionDetails.SecureEnclaves.ToUpper())
{ {
case "ENABLED": case "ENABLED":
if (string.IsNullOrEmpty(connectionDetails.EnclaveAttestationProtocol))
{
throw new ArgumentException(SR.ConnectionServiceConnStringMissingAttestationProtocolWithSecureEnclaves);
}
break; break;
case "DISABLED": case "DISABLED":
break; break;

View File

@@ -45,6 +45,14 @@ namespace Microsoft.SqlTools.ServiceLayer
} }
} }
public static string ConnectionServiceConnStringMissingAttestationProtocolWithSecureEnclaves
{
get
{
return Keys.GetString(Keys.ConnectionServiceConnStringMissingAttestationProtocolWithSecureEnclaves);
}
}
public static string ConnectionServiceConnStringMissingAttestationUrlWithAttestationProtocol public static string ConnectionServiceConnStringMissingAttestationUrlWithAttestationProtocol
{ {
get get
@@ -10190,6 +10198,9 @@ namespace Microsoft.SqlTools.ServiceLayer
public const string ConnectionServiceConnStringInvalidEnclaveAttestationProtocol = "ConnectionServiceConnStringInvalidEnclaveAttestationProtocol"; public const string ConnectionServiceConnStringInvalidEnclaveAttestationProtocol = "ConnectionServiceConnStringInvalidEnclaveAttestationProtocol";
public const string ConnectionServiceConnStringMissingAttestationProtocolWithSecureEnclaves = "ConnectionServiceConnStringMissingAttestationProtocolWithSecureEnclaves";
public const string ConnectionServiceConnStringMissingAttestationUrlWithAttestationProtocol = "ConnectionServiceConnStringMissingAttestationUrlWithAttestationProtocol"; public const string ConnectionServiceConnStringMissingAttestationUrlWithAttestationProtocol = "ConnectionServiceConnStringMissingAttestationUrlWithAttestationProtocol";

View File

@@ -146,7 +146,7 @@
Parameters: 0 - columnEncryptionSetting (string) </comment> Parameters: 0 - columnEncryptionSetting (string) </comment>
</data> </data>
<data name="ConnectionServiceConnStringInvalidSecureEnclaves" xml:space="preserve"> <data name="ConnectionServiceConnStringInvalidSecureEnclaves" xml:space="preserve">
<value>Invalid value &apos;{0}&apos; for SecureEnclaves. Valid values are &apos;Enabled&apos; and &apos;Disabled&apos;.</value> <value>Invalid value &apos;{0}&apos; for Secure enclaves. Valid values are &apos;Enabled&apos; and &apos;Disabled&apos;.</value>
<comment>. <comment>.
Parameters: 0 - secureEnclaves (string) </comment> Parameters: 0 - secureEnclaves (string) </comment>
</data> </data>
@@ -156,20 +156,24 @@
Parameters: 0 - encrypt (string) </comment> Parameters: 0 - encrypt (string) </comment>
</data> </data>
<data name="ConnectionServiceConnStringInvalidEnclaveAttestationProtocol" xml:space="preserve"> <data name="ConnectionServiceConnStringInvalidEnclaveAttestationProtocol" xml:space="preserve">
<value>Invalid value &apos;{0}&apos; for EnclaveAttestationProtocol. Valid values are &apos;AAS&apos;, &apos;HGS&apos; and &apos;None&apos;.</value> <value>Invalid value &apos;{0}&apos; for Attestation protocol. Valid values are &apos;AAS&apos;, &apos;HGS&apos; and &apos;None&apos;.</value>
<comment>. <comment>.
Parameters: 0 - enclaveAttestationProtocol (string) </comment> Parameters: 0 - enclaveAttestationProtocol (string) </comment>
</data> </data>
<data name="ConnectionServiceConnStringMissingAttestationProtocolWithSecureEnclaves" xml:space="preserve">
<value>Attestation protocol cannot be empty with Secure enclaves enabled.</value>
<comment></comment>
</data>
<data name="ConnectionServiceConnStringMissingAttestationUrlWithAttestationProtocol" xml:space="preserve"> <data name="ConnectionServiceConnStringMissingAttestationUrlWithAttestationProtocol" xml:space="preserve">
<value>Attestation URL cannot be empty with the selected value of Attestation Protocol.</value> <value>Attestation URL cannot be empty with the selected value of Attestation protocol.</value>
<comment></comment> <comment></comment>
</data> </data>
<data name="ConnectionServiceConnStringInvalidAlwaysEncryptedOptionCombination" xml:space="preserve"> <data name="ConnectionServiceConnStringInvalidAlwaysEncryptedOptionCombination" xml:space="preserve">
<value>The Attestation Protocol and Enclave Attestation URL requires Always Encrypted with Secure Enclaves to be set to Enabled.</value> <value>The Attestation protocol and Attestation URL requires Always Encrypted with Secure enclaves to be set to Enabled.</value>
<comment></comment> <comment></comment>
</data> </data>
<data name="ConnectionServiceConnStringInvalidAttestationProtocolNoneWithUrl" xml:space="preserve"> <data name="ConnectionServiceConnStringInvalidAttestationProtocolNoneWithUrl" xml:space="preserve">
<value>The Enclave Attestation URL must not be specified with Attestation Protocol &apos;None&apos;. Either set appropriate Attestation Protocol or remove Attestation URL from connection properties.</value> <value>The Attestation URL must not be specified with Attestation protocol &apos;None&apos;. Either set appropriate Attestation protocol or remove Attestation URL from connection properties.</value>
<comment></comment> <comment></comment>
</data> </data>
<data name="ConnectionServiceConnStringInvalidIntent" xml:space="preserve"> <data name="ConnectionServiceConnStringInvalidIntent" xml:space="preserve">

View File

@@ -35,17 +35,19 @@ ConnectionServiceConnStringInvalidAuthType(string authType) = Invalid value '{0}
ConnectionServiceConnStringInvalidColumnEncryptionSetting(string columnEncryptionSetting) = Invalid value '{0}' for ComlumEncryption. Valid values are 'Enabled' and 'Disabled'. ConnectionServiceConnStringInvalidColumnEncryptionSetting(string columnEncryptionSetting) = Invalid value '{0}' for ComlumEncryption. Valid values are 'Enabled' and 'Disabled'.
ConnectionServiceConnStringInvalidSecureEnclaves(string secureEnclaves) = Invalid value '{0}' for SecureEnclaves. Valid values are 'Enabled' and 'Disabled'. ConnectionServiceConnStringInvalidSecureEnclaves(string secureEnclaves) = Invalid value '{0}' for Secure enclaves. Valid values are 'Enabled' and 'Disabled'.
ConnectionServiceConnStringInvalidEncryptOption(string encrypt) = Invalid value '{0}' for Encrypt. Valid values are 'Optional', 'Mandatory', 'Strict', 'True', 'False', 'Yes' and 'No'. ConnectionServiceConnStringInvalidEncryptOption(string encrypt) = Invalid value '{0}' for Encrypt. Valid values are 'Optional', 'Mandatory', 'Strict', 'True', 'False', 'Yes' and 'No'.
ConnectionServiceConnStringInvalidEnclaveAttestationProtocol(string enclaveAttestationProtocol) = Invalid value '{0}' for EnclaveAttestationProtocol. Valid values are 'AAS', 'HGS' and 'None'. ConnectionServiceConnStringInvalidEnclaveAttestationProtocol(string enclaveAttestationProtocol) = Invalid value '{0}' for Attestation protocol. Valid values are 'AAS', 'HGS' and 'None'.
ConnectionServiceConnStringMissingAttestationUrlWithAttestationProtocol = Attestation URL cannot be empty with the selected value of Attestation Protocol. ConnectionServiceConnStringMissingAttestationProtocolWithSecureEnclaves = Attestation protocol cannot be empty with Secure enclaves enabled.
ConnectionServiceConnStringInvalidAlwaysEncryptedOptionCombination = The Attestation Protocol and Enclave Attestation URL requires Always Encrypted with Secure Enclaves to be set to Enabled. ConnectionServiceConnStringMissingAttestationUrlWithAttestationProtocol = Attestation URL cannot be empty with the selected value of Attestation protocol.
ConnectionServiceConnStringInvalidAttestationProtocolNoneWithUrl = The Enclave Attestation URL must not be specified with Attestation Protocol 'None'. Either set appropriate Attestation Protocol or remove Attestation URL from connection properties. ConnectionServiceConnStringInvalidAlwaysEncryptedOptionCombination = The Attestation protocol and Attestation URL requires Always Encrypted with Secure enclaves to be set to Enabled.
ConnectionServiceConnStringInvalidAttestationProtocolNoneWithUrl = The Attestation URL must not be specified with Attestation protocol 'None'. Either set appropriate Attestation protocol or remove Attestation URL from connection properties.
ConnectionServiceConnStringInvalidIntent(string intent) = Invalid value '{0}' for ApplicationIntent. Valid values are 'ReadWrite' and 'ReadOnly'. ConnectionServiceConnStringInvalidIntent(string intent) = Invalid value '{0}' for ApplicationIntent. Valid values are 'ReadWrite' and 'ReadOnly'.

View File

@@ -2042,14 +2042,14 @@
Parameters: 0 - encrypt (string) </note> Parameters: 0 - encrypt (string) </note>
</trans-unit> </trans-unit>
<trans-unit id="ConnectionServiceConnStringInvalidEnclaveAttestationProtocol"> <trans-unit id="ConnectionServiceConnStringInvalidEnclaveAttestationProtocol">
<source>Invalid value '{0}' for EnclaveAttestationProtocol. Valid values are 'AAS', 'HGS' and 'None'.</source> <source>Invalid value '{0}' for Attestation protocol. Valid values are 'AAS', 'HGS' and 'None'.</source>
<target state="new">Invalid value '{0}' for EnclaveAttestationProtocol. Valid values are 'AAS', 'HGS' and 'None'.</target> <target state="new">Invalid value '{0}' for Attestation protocol. Valid values are 'AAS', 'HGS' and 'None'.</target>
<note>. <note>.
Parameters: 0 - enclaveAttestationProtocol (string) </note> Parameters: 0 - enclaveAttestationProtocol (string) </note>
</trans-unit> </trans-unit>
<trans-unit id="ConnectionServiceConnStringInvalidAlwaysEncryptedOptionCombination"> <trans-unit id="ConnectionServiceConnStringInvalidAlwaysEncryptedOptionCombination">
<source>The Attestation Protocol and Enclave Attestation URL requires Always Encrypted with Secure Enclaves to be set to Enabled.</source> <source>The Attestation protocol and Attestation URL requires Always Encrypted with Secure enclaves to be set to Enabled.</source>
<target state="new">The Attestation Protocol and Enclave Attestation URL requires Always Encrypted with Secure Enclaves to be set to Enabled.</target> <target state="new">The Attestation protocol and Attestation URL requires Always Encrypted with Secure enclaves to be set to Enabled.</target>
<note></note> <note></note>
</trans-unit> </trans-unit>
<trans-unit id="SqlCmdExitOnError"> <trans-unit id="SqlCmdExitOnError">
@@ -6551,19 +6551,19 @@ The Query Processor estimates that implementing the following index could improv
<note></note> <note></note>
</trans-unit> </trans-unit>
<trans-unit id="ConnectionServiceConnStringMissingAttestationUrlWithAttestationProtocol"> <trans-unit id="ConnectionServiceConnStringMissingAttestationUrlWithAttestationProtocol">
<source>Attestation URL cannot be empty with the selected value of Attestation Protocol.</source> <source>Attestation URL cannot be empty with the selected value of Attestation protocol.</source>
<target state="new">Attestation URL cannot be empty with the selected value of Attestation Protocol.</target> <target state="new">Attestation URL cannot be empty with the selected value of Attestation protocol.</target>
<note></note> <note></note>
</trans-unit> </trans-unit>
<trans-unit id="ConnectionServiceConnStringInvalidSecureEnclaves"> <trans-unit id="ConnectionServiceConnStringInvalidSecureEnclaves">
<source>Invalid value '{0}' for SecureEnclaves. Valid values are 'Enabled' and 'Disabled'.</source> <source>Invalid value '{0}' for Secure enclaves. Valid values are 'Enabled' and 'Disabled'.</source>
<target state="new">Invalid value '{0}' for SecureEnclaves. Valid values are 'Enabled' and 'Disabled'.</target> <target state="new">Invalid value '{0}' for Secure enclaves. Valid values are 'Enabled' and 'Disabled'.</target>
<note>. <note>.
Parameters: 0 - secureEnclaves (string) </note> Parameters: 0 - secureEnclaves (string) </note>
</trans-unit> </trans-unit>
<trans-unit id="ConnectionServiceConnStringInvalidAttestationProtocolNoneWithUrl"> <trans-unit id="ConnectionServiceConnStringInvalidAttestationProtocolNoneWithUrl">
<source>The Enclave Attestation URL must not be specified with Attestation Protocol 'None'. Either set appropriate Attestation Protocol or remove Attestation URL from connection properties.</source> <source>The Attestation URL must not be specified with Attestation protocol 'None'. Either set appropriate Attestation protocol or remove Attestation URL from connection properties.</source>
<target state="new">The Enclave Attestation URL must not be specified with Attestation Protocol 'None'. Either set appropriate Attestation Protocol or remove Attestation URL from connection properties.</target> <target state="new">The Attestation URL must not be specified with Attestation protocol 'None'. Either set appropriate Attestation protocol or remove Attestation URL from connection properties.</target>
<note></note> <note></note>
</trans-unit> </trans-unit>
<trans-unit id="DefaultLanguagePlaceholder"> <trans-unit id="DefaultLanguagePlaceholder">
@@ -6582,6 +6582,11 @@ The Query Processor estimates that implementing the following index could improv
<note>. <note>.
Parameters: 0 - urn (string) </note> Parameters: 0 - urn (string) </note>
</trans-unit> </trans-unit>
<trans-unit id="ConnectionServiceConnStringMissingAttestationProtocolWithSecureEnclaves">
<source>Attestation protocol cannot be empty with Secure enclaves enabled.</source>
<target state="new">Attestation protocol cannot be empty with Secure enclaves enabled.</target>
<note></note>
</trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

View File

@@ -37,6 +37,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Utility
Assert.NotNull(ServiceLayerSr.ConnectionServiceConnectionCanceled); Assert.NotNull(ServiceLayerSr.ConnectionServiceConnectionCanceled);
Assert.NotNull(ServiceLayerSr.ConnectionServiceConnStringMissingAttestationUrlWithAttestationProtocol); Assert.NotNull(ServiceLayerSr.ConnectionServiceConnStringMissingAttestationUrlWithAttestationProtocol);
Assert.NotNull(ServiceLayerSr.ConnectionServiceConnStringInvalidAttestationProtocolNoneWithUrl); Assert.NotNull(ServiceLayerSr.ConnectionServiceConnStringInvalidAttestationProtocolNoneWithUrl);
Assert.NotNull(ServiceLayerSr.ConnectionServiceConnStringMissingAttestationProtocolWithSecureEnclaves);
Assert.NotNull(ServiceLayerSr.ConnectionServiceConnStringInvalidEnclaveAttestationProtocol("")); Assert.NotNull(ServiceLayerSr.ConnectionServiceConnStringInvalidEnclaveAttestationProtocol(""));
Assert.NotNull(ServiceLayerSr.ConnectionServiceConnStringInvalidColumnEncryptionSetting("")); Assert.NotNull(ServiceLayerSr.ConnectionServiceConnStringInvalidColumnEncryptionSetting(""));
Assert.NotNull(ServiceLayerSr.ConnectionServiceConnStringInvalidSecureEnclaves("")); Assert.NotNull(ServiceLayerSr.ConnectionServiceConnStringInvalidSecureEnclaves(""));