設定安全性通訊協定和密碼 - Amazon Relational Database Service

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

設定安全性通訊協定和密碼

您可以使用資料庫參數開啟和關閉特定安全性通訊協定和密碼。您可以設定的安全性參數 (TLS 1.2 版除外) 如下表所示。

資料庫參數 允許的值 (預設值以粗體表示) 描述
rds.tls10 default、enabled、disabled TLS 1.0。
rds.tls11 default、enabled、disabled TLS 1.1。
rds.tls12 default TLS 1.2。您無法修改此值。
rds.fips 0、1

當您將參數設定為 1 時,RDS 會強制使用符合美國聯邦資訊處理標準 (FIPS) 140-2 標準的模組。

如需詳細資訊,請參閱 Microsoft 文件中使用符合 FIPS 140-2 模式的 SQL Server 2016

rds.rc4 default、enabled、disabled RC4 串流密碼。
rds.diffie-hellman default、enabled、disabled Diffie-Hellman 金鑰交換加密。
RDS。 diffie-hellman-min-key-位長 default、1024、2048、4096 Diffie-Hellman 金鑰的最小位元長度。
rds.curve25519 default、enabled、disabled Curve25519 橢圓曲線加密密碼。並非所有引擎版本都支援此參數。
rds.3des168 default、enabled、disabled 具有 168 位元金鑰長度的三重資料加密標準 (DES) 加密密碼。
注意

如果是在之後的次要引擎版本,則資料庫參數、、、和的預設設定為停用。rds.tls10 rds.tls11 rds.rc4 rds.curve25519 rds.3des168否則,會啟用預設設定。

對於之後的次要引擎版本而言,預設設定為 3072。rds.diffie-hellman-min-key-bit-length否則,預設設定為 2048。

請使用下列程序來設定安全性通訊協定和密碼:

  1. 建立自訂資料庫參數群組。

  2. 修改參數群組中的參數。

  3. 將資料庫參數群組與您的資料庫執行個體建立關聯。

如需資料庫參數群組的詳細資訊,請參閱使用參數群組

建立安全性相關參數群組

為對應到 SQL Server 版本和資料庫執行個體版本的安全性相關參數建立參數群組。

下列範例會建立 SQL Server Standard Edition 2016 的參數群組。

建立參數群組
  1. 登入 AWS Management Console 並開啟 Amazon RDS 主控台,網址為 https://console.aws.amazon.com/rds/

  2. 在導覽窗格中,選擇 Parameter groups (參數群組)。

  3. 選擇 Create parameter group (建立參數群組)

  4. Create parameter group (建立參數群組) 窗格中執行下列動作:

    1. 對於 Parameter group family (參數群組家族),請選擇 sqlserver-se-13.0

    2. 對於 Group name (群組名稱),輸入參數群組的識別碼,例如 sqlserver-ciphers-se-13

    3. 對於 Description (說明),輸入 Parameter group for security protocols and ciphers

  5. 選擇 Create (建立)。

下列範例會建立 SQL Server Standard Edition 2016 的參數群組。

建立參數群組
  • 請執行下列其中一個命令:

    對於LinuxmacOS、或Unix:

    aws rds create-db-parameter-group \ --db-parameter-group-name sqlserver-ciphers-se-13 \ --db-parameter-group-family "sqlserver-se-13.0" \ --description "Parameter group for security protocols and ciphers"

    在 Windows 中:

    aws rds create-db-parameter-group ^ --db-parameter-group-name sqlserver-ciphers-se-13 ^ --db-parameter-group-family "sqlserver-se-13.0" ^ --description "Parameter group for security protocols and ciphers"

修改安全性相關參數

修改參數群組中對應至 SQL Server 版本和資料庫執行個體版本的安全性相關參數。

下列範例會修改您為 SQL Server Standard Edition 2016 建立的參數群組。此範例會關閉 TLS 1.0 版。

修改參數群組
  1. 登入 AWS Management Console 並開啟 Amazon RDS 主控台,網址為 https://console.aws.amazon.com/rds/

  2. 在導覽窗格中,選擇 Parameter groups (參數群組)。

  3. 選擇參數群組,例如 sqlserver-ciphers-se-13

  4. Parameters (參數) 下,篩選 rds 的參數清單。

  5. 選擇 Edit parameters (編輯參數)。

  6. 選擇 rds.tls10

  7. 對於 Values (值),選擇 disabled

  8. 選擇儲存變更

下列範例會修改您為 SQL Server Standard Edition 2016 建立的參數群組。此範例會關閉 TLS 1.0 版。

修改參數群組
  • 請執行下列其中一個命令:

    對於LinuxmacOS、或Unix:

    aws rds modify-db-parameter-group \ --db-parameter-group-name sqlserver-ciphers-se-13 \ --parameters "ParameterName='rds.tls10',ParameterValue='disabled',ApplyMethod=pending-reboot"

    在 Windows 中:

    aws rds modify-db-parameter-group ^ --db-parameter-group-name sqlserver-ciphers-se-13 ^ --parameters "ParameterName='rds.tls10',ParameterValue='disabled',ApplyMethod=pending-reboot"

將安全性相關參數群組與資料庫執行個體建立關聯

若要將參數群組與資料庫執行個體產生關聯,請使用 AWS Management Console 或 AWS CLI。

您可以將參數群組與新的或現有的資料庫執行個體建立關聯。

您可以將參數群組與新的或現有的資料庫執行個體建立關聯。

使用參數群組建立資料庫執行個體
  • 指定建立參數群組時所使用的相同資料庫引擎類型和主要版本。

    對於LinuxmacOS、或Unix:

    aws rds create-db-instance \ --db-instance-identifier mydbinstance \ --db-instance-class db.m5.2xlarge \ --engine sqlserver-se \ --engine-version 13.00.5426.0.v1 \ --allocated-storage 100 \ --master-user-password secret123 \ --master-username admin \ --storage-type gp2 \ --license-model li \ --db-parameter-group-name sqlserver-ciphers-se-13

    在 Windows 中:

    aws rds create-db-instance ^ --db-instance-identifier mydbinstance ^ --db-instance-class db.m5.2xlarge ^ --engine sqlserver-se ^ --engine-version 13.00.5426.0.v1 ^ --allocated-storage 100 ^ --master-user-password secret123 ^ --master-username admin ^ --storage-type gp2 ^ --license-model li ^ --db-parameter-group-name sqlserver-ciphers-se-13
    注意

    指定此處所顯示提示以外的密碼,作為安全最佳實務。

修改資料庫執行個體並建立參數群組的關聯
  • 請執行下列其中一個命令:

    對於LinuxmacOS、或Unix:

    aws rds modify-db-instance \ --db-instance-identifier mydbinstance \ --db-parameter-group-name sqlserver-ciphers-se-13 \ --apply-immediately

    在 Windows 中:

    aws rds modify-db-instance ^ --db-instance-identifier mydbinstance ^ --db-parameter-group-name sqlserver-ciphers-se-13 ^ --apply-immediately