Menyetel protokol TLS untuk Router dan Pemroses Pesan

Secara default di Apigee Edge untuk Private Cloud 4.54.00, Router (Nginx) dan Message Processor (Java 21) mengaktifkan TLSv1.2 dan TLSv1.3. Bergantung pada kebutuhan bisnis dan praktik keamanan Anda, Anda mungkin ingin membatasi protokol yang diizinkan atau mengaktifkan kembali protokol lama. Dokumen ini menjelaskan cara mengonfigurasi protokol TLS untuk traffic utara dan selatan di Router dan Message Processor.

Untuk Router, Anda juga dapat menetapkan protokol untuk setiap host virtual. Lihat Mengonfigurasi akses TLS ke API untuk Private Cloud untuk mengetahui informasi selengkapnya.

Untuk Message Processor, Anda dapat menetapkan protokol untuk setiap TargetEndpoint. Lihat Mengonfigurasi TLS dari Edge ke backend (Cloud dan Cloud Pribadi) untuk mengetahui informasi selengkapnya.

Menetapkan protokol TLS di Router

Properti berikut membantu Anda menetapkan protokol TLS yang diinginkan di Router untuk komunikasi utara.

Untuk menetapkan protokol TLS di Router, tetapkan properti dalam file router.properties:

  1. Buka file router.properties di editor. Jika file tidak ada, buat file tersebut:
    vi /opt/apigee/customer/application/router.properties
  2. Tetapkan properti sesuai keinginan:
    # Possible values are space-delimited list of: TLSv1 TLSv1.1 TLSv1.2 TLSv1.3
    conf_load_balancing_load.balancing.driver.server.ssl.protocols=TLSv1.2
  3. Simpan perubahan.
  4. Pastikan file properti dimiliki oleh pengguna apigee:
    chown apigee:apigee /opt/apigee/customer/application/router.properties
  5. Mulai ulang Router:
    /opt/apigee/apigee-service/bin/apigee-service edge-router restart
  6. Verifikasi bahwa protokol diperbarui dengan benar dengan memeriksa file Nginx /opt/nginx/conf.d/0-default.conf:
    cat /opt/nginx/conf.d/0-default.conf

    Pastikan nilai untuk ssl_protocols adalah TLSv1.2.

  7. Jika Anda menggunakan TLS dua arah dengan host virtual, Anda juga harus menetapkan protokol TLS di host virtual seperti yang dijelaskan dalam Mengonfigurasi akses TLS ke API untuk cloud pribadi.

Menetapkan protokol TLS di Message Processor

Properti berikut membantu Anda menetapkan protokol TLS yang diinginkan di Message Processor untuk komunikasi selatan. Bagian ini juga menjelaskan cara menggunakan protokol dan cipher TLS yang dinonaktifkan.

Untuk menetapkan protokol TLS di Message Processor, tetapkan properti dalam file message-processor.properties:

  1. Buka file message-processor.properties di editor. Jika file tidak ada, buat file tersebut:
    vi /opt/apigee/customer/application/message-processor.properties
  2. Konfigurasi properti menggunakan sintaksis berikut:
    # Possible values are a comma-delimited list of TLSv1, TLSv1.1, TLSv1.2, and TLSv1.3
    conf/system.properties+https.protocols=[TLSv1][,TLSv1.1][,TLSv1.2][,TLSv1.3]
    # Possible values are a comma-delimited list of SSLv3, TLSv1, TLSv1.1, TLSv1.2, TLSv1.3
    # SSLv3 is required
    conf_jvmsecurity_jdk.tls.disabledAlgorithms=SSLv3[,TLSv1][,TLSv1.1][,TLSv1.2][,TLSv1.3]
    
    # Specify the ciphers that the Message Processor supports. (You must separate ciphers with a comma.):
    conf_message-processor-communication_local.http.ssl.ciphers=cipher[,...]

    Contoh:

    conf/system.properties+https.protocols=TLSv1.2
    conf_jvmsecurity_jdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1
    conf_message-processor-communication_local.http.ssl.ciphers=TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384,TLS_DHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384

    Untuk mengetahui daftar lengkap properti terkait, lihat Mengonfigurasi TLS antara Router dan Message Processor.

  3. Simpan perubahan.
  4. Pastikan file properti dimiliki oleh pengguna apigee:
    chown apigee:apigee /opt/apigee/customer/application/message-processor.properties
  5. Mulai ulang Message Processor:
    /opt/apigee/apigee-service/bin/apigee-service edge-message-processor restart
  6. Jika Anda menggunakan TLS dua arah dengan backend, tetapkan protokol TLS di host virtual seperti yang dijelaskan dalam Mengonfigurasi TLS dari Edge ke backend (Cloud dan Private Cloud).

Menggunakan cipher dan protokol TLS lama: Lihat bagian berikut jika Anda ingin menggunakan cipher atau protokol lama.

Menggunakan TLS lama

Di Java 21, protokol TLS lama (TLSv1, TLSv1.1, dan SSLv3) dan kunci Diffie-Hellman yang lemah (DH keySize < 1024) dinonaktifkan secara default di jdk.tls.disabledAlgorithms. Untuk mengaktifkannya, gunakan salah satu opsi berikut:

  • Opsi A: Memodernisasi protokol backend: Perbarui server backend untuk mendukung TLS 1.2 atau TLS 1.3 dan pastikan ukuran parameter Diffie-Hellman adalah 2048 bit atau lebih besar (>= 2048 bit).
  • Opsi B: Mengaktifkan kembali protokol lama menggunakan CwC: Pertahankan kompatibilitas dengan backend TLS 1.0 atau TLS 1.1 lama dengan menghapus TLSv1, TLSv1.1 dari conf_jvmsecurity_jdk.tls.disabledAlgorithms di /opt/apigee/customer/application/message-processor.properties menggunakan code with config (CwC):
    # Re-enable TLS 1.0 and TLS 1.1 for legacy backend connectivity
    conf_jvmsecurity_jdk.tls.disabledAlgorithms=SSLv3, DTLSv1.0, RC4, DES, MD5withRSA, DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, ECDH, TLS_RSA_*, rsa_pkcs1_sha1 usage HandshakeSignature, ecdsa_sha1 usage HandshakeSignature, dsa_sha1 usage HandshakeSignature, include jdk.disabled.namedCurves

Menggunakan cipher RSA statis

Apigee Edge untuk Private Cloud versi 4.54.00 berjalan di Java 21, tempat cipher suite RSA statis (TLS_RSA_*) yang tidak memiliki pertukaran kunci Diffie-Hellman sementara (ECDHE atau DHE) dinonaktifkan secara default di jdk.tls.disabledAlgorithms (misalnya, TLS_RSA_WITH_AES_128_CBC_SHA atau TLS_RSA_WITH_AES_256_CBC_SHA). Untuk mendukung backend yang memerlukan cipher suite RSA statis, gunakan opsi berikut:

  • Mengaktifkan kembali cipher RSA statis menggunakan CwC: Pertahankan kompatibilitas dengan backend lama dengan menghapus TLS_RSA_* dari conf_jvmsecurity_jdk.tls.disabledAlgorithms di /opt/apigee/customer/application/message-processor.properties menggunakan code with config (CwC):
    # Re-enable Static RSA ciphers for backward compatibility with legacy Java 8 backends
    conf_jvmsecurity_jdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1, DTLSv1.0, RC4, DES, MD5withRSA, DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, ECDH, rsa_pkcs1_sha1 usage HandshakeSignature, ecdsa_sha1 usage HandshakeSignature, dsa_sha1 usage HandshakeSignature, include jdk.disabled.namedCurves

Setelah mengubah properti, mulai ulang Message Processor menggunakan apigee-service:

/opt/apigee/apigee-service/bin/apigee-service edge-message-processor restart

Mengaktifkan TLS 1.3 untuk host

Bagian ini menjelaskan cara mengaktifkan TLS 1.3 untuk host virtual tertentu. Untuk mengaktifkan TLS 1.3, lakukan langkah-langkah berikut di node Management Server

  1. Di setiap node Management Server, edit file /opt/apigee/customer/application/management-server.properties dan tambahkan baris berikut (jika file tidak ada, buat file tersebut):
    conf_virtualhost_virtual.host.allowed.protocol.list=TLSv1,TLSv1.1,TLSv1.2,TLSv1.3

    Untuk file ini, protokol dipisahkan koma dan peka huruf besar/kecil.

  2. Simpan file.
  3. Pastikan file dimiliki oleh pengguna apigee:
    chown apigee:apigee /opt/apigee/customer/application/management-server.properties
  4. Mulai ulang Management Server:
    /opt/apigee/apigee-service/bin/apigee-service edge-management-server restart
  5. Ulangi langkah sebelumnya di semua node Management Server satu per satu.
  6. Buat (atau perbarui) host virtual dengan properti berikut property. Perhatikan bahwa protokol dipisahkan dengan spasi dan peka huruf besar/kecil:
    "properties": {
        "property": [
          {
            "name": "ssl_protocols",
            "value": "TLSv1 TLSv1.1 TLSv1.2 TLSv1.3"
          }
        ]
    }

    Contoh berikut menunjukkan vhost contoh dengan properti ini:

    {
      "hostAliases": [
        "api.myCompany,com",
      ],
      "interfaces": [],
      "listenOptions": [],
      "name": "secure",
      "port": "443",
      "retryOptions": [],
      "properties": {
        "property": [
          {
            "name": "ssl_protocols",
            "value": "TLSv1 TLSv1.1 TLSv1.2 TLSv1.3"
          }
        ]
      },
      "sSLInfo": {
        "ciphers": [],
        "clientAuthEnabled": "false",
        "enabled": "true",
        "ignoreValidationErrors": false,
        "keyAlias": "myCompanyKeyAlias",
        "keyStore": "ref://myCompanyKeystoreref",
        "protocols": []
      },
      "useBuiltInFreeTrialCert": false
    }

Menguji TLS 1.3

Untuk menguji TLS 1.3, masukkan perintah berikut:

curl -v --tlsv1.3 "https://api.myCompany,com/testproxy"

Perhatikan bahwa Anda hanya dapat menguji TLS 1.3 di klien yang mendukung protokol ini. Jika TLS 1.3 tidak diaktifkan, Anda akan melihat pesan error seperti berikut:

sslv3 alert handshake failure