rlevas opened a new pull request #56: KNOX-1756 - Knox Gateway TLS Keystore and 
Alias Should be Configurable
URL: https://github.com/apache/knox/pull/56
 
 
   ## What changes were proposed in this pull request?
   
   **Problem**
   The location of the keystore housing the Knox Gateway TLS certificate is 
hardcoded to <calculated from configs>/keystores/gateway.jks and the 
certificate alias is hardcoded to “gateway-identity”. This limits the ability 
for external management facilities to setup a custom TLS key and certificate 
for the Knox Gateway. For example, a host-wide, CA-signed, TLS certificate.
   
   Knox has configuration hooks for the following (optional) properties
   
   - Home Directory
      - Gateway-site property: GATEWAY_HOME
      - System property: GATEWAY_HOME
      - Environment variable: GATEWAY_HOME
   - Data Directory
      - System property: GATEWAY_DATA_HOME
      - Environment variable: GATEWAY_DATA_HOME
      - Gateway-site property: gateway.data.dir
      - Calculated: [Home Directory] + [Path Separator] + “data”
   - Security Directory
      - Gateway-site property: gateway.security.dir
      - Calculated: [Data Directory] + [Path Separator] + “security”
   
   The path to the Knox Gateway TLS keystore is calculated as
   ```
   [Security Directory] + [Path Separator] + “keystores” + [Path Separator] + 
“gateway.jks”
   ```
   
   **Solution**
   To make it easier to use an externally provided TLS key and certificate, the 
Knox Gateway should allow the TLS keystore file and alias name to be 
configurable. The following properties should be made available:
   
   - TLS Keystore File Path
      - Gateway-site property: gateway.tls.keystore.path
      - Calculated: [Security Directory] + [Path Separator] + "keystores"  
[Path Separator]  "gateway.jks"
   - TLS Keystore Password Alias (value to be stored in the Knox Gateway 
credential store)
      - Gateway-site property: gateway.tls.keystore.password.alias
      - Calculated: "gateway-identity-keystore-password"
   - TLS Keystore Type
      - Gateway-site property: gateway.tls.keystore.type
      - Calculated: :”jks”
   - TLS Key Alias
      - Gateway-site property: gateway.tls.key.alias
      - Calculated: “gateway-identity”
   - TLS Key Passphrase Alias (value to be stored in the Knox Gateway 
credential store)
      - Gateway-site property: gateway.tls.key.passphrase.alias
      - Calculated: "gateway-identity-passphrase"
   
   ## How was this patch tested?
   
   Updated unit tests
   
   Manually tested using
   - default keystore for identity and signing
   - custom keystore for identity, default keystore for signing (falls to 
custom keystore for identitiy)
   - custom keystore for identity, custom keystore for signing 
   
   Please review [Knox Contributing 
Process](https://cwiki.apache.org/confluence/display/KNOX/Contribution+Process#ContributionProcess-GithubWorkflow)
 before opening a pull request.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to