[ 
https://issues.apache.org/jira/browse/KNOX-1756?focusedWorklogId=200716&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-200716
 ]

ASF GitHub Bot logged work on KNOX-1756:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 19/Feb/19 16:08
            Start Date: 19/Feb/19 16:08
    Worklog Time Spent: 10m 
      Work Description: risdenk commented on pull request #54: [WIP] KNOX-1756 
- Knox Gateway TLS Keystore and Alias Should be Configurable
URL: https://github.com/apache/knox/pull/54#discussion_r258100235
 
 

 ##########
 File path: 
gateway-spi/src/test/java/org/apache/knox/gateway/services/security/impl/X509CertificateUtilTest.java
 ##########
 @@ -0,0 +1,162 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.knox.gateway.services.security.impl;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateExpiredException;
+import java.security.cert.CertificateNotYetValidException;
+import java.security.cert.X509Certificate;
+import java.util.Calendar;
+import java.util.Locale;
+import java.util.TimeZone;
+
+public class X509CertificateUtilTest {
 
 Review comment:
   Looks like this would be useful outside of this PR
 
----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 200716)
    Time Spent: 20m  (was: 10m)

> Knox Gateway TLS Keystore and Alias Should be Configurable
> ----------------------------------------------------------
>
>                 Key: KNOX-1756
>                 URL: https://issues.apache.org/jira/browse/KNOX-1756
>             Project: Apache Knox
>          Issue Type: Improvement
>          Components: Server
>    Affects Versions: 1.3.0
>            Reporter: Robert Levas
>            Assignee: Robert Levas
>            Priority: Major
>              Labels: keystore, ssl
>             Fix For: 1.3.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> h1. 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”
> *Note*: the calculation for the home directory is inconsistent with the other 
> directory calculations. This inconsistency may be confusing to users and thus 
> should be fixed to be
>  * System property: GATEWAY_HOME
>  * Environment variable: GATEWAY_HOME
>  * Gateway-site property: gateway.home.dir
> The path to the Knox Gateway TLS keystore is calculated as
> {noformat}
> [Security Directory] + [Path Separator] + “keystores” + [Path Separator] + 
> “gateway.jks”
> {noformat}
> h1. 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"
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to