1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. Copyright 2020 NOKIA
5 How to use functionality
6 ========================
7 Common information to docker and Kubernetes modes described below
11 Certification Service Client needs the following configuration parameters to work properly:
13 1. Parameters for connection to Certification Service API to obtain certificate and trust anchors
15 - REQUEST_URL *(default: https://aaf-cert-service:8443/v1/certificate/)* - URL to Certification Service API
16 - REQUEST_TIMEOUT *(default: 30000[ms])* - Timeout In miliseconds for REST API calls
17 - OUTPUT_PATH *(required)* - Path where client will output generated certificate and trust anchor
18 - CA_NAME *(required)* - Name of CA which will enroll certificate. Must be same as configured on server side. Used in REST API calls
21 2. Parameters to generate CSR file:
23 - COMMON_NAME *(required)* - Common name for which certificate from CMPv2 server should be issued
24 - ORGANIZATION *(required)* - Organization for which certificate from CMPv2 server should be issued
25 - ORGANIZATION_UNIT *(optional)* - Organization unit for which certificate from CMPv2 server should be issued
26 - LOCATION *(optional)* - Location for which certificate from CMPv2 server should be issued
27 - STATE *(required)* - State for which certificate from CMPv2 server should be issued
28 - COUNTRY *(required)* - Country for which certificate from CMPv2 server should be issued
29 - SANS *(optional)(SANS's should be separated by a colon e.g. test.onap.org:onap.com)* - Subject Alternative Names (SANs) for which certificate from CMPv2 server should be issued.
31 3. Parameters to establish secure communication:
33 - KEYSTORE_PATH *(required)*
34 - KEYSTORE_PASSWORD *(required)*
35 - TRUSTSTORE_PATH *(required)*
36 - TRUSTSTORE_PASSWORD *(required)*
38 Certification Service Client image can be found on Nexus repository :
42 nexus3.onap.org:10001/onap/org.onap.aaf.certservice.aaf-certservice-client:$VERSION
45 As standalone docker container
46 ------------------------------
47 You need certificate and trust anchors to connect to certification service API via HTTPS. Information how to generate truststore and keystore files you can find in project repository README `Gerrit GitWeb <https://gerrit.onap.org/r/gitweb?p=aaf%2Fcertservice.git;a=summary>`__
49 To run Certification Service Client as standalone docker container execute following steps:
51 1. Create file '*$PWD/client.env*' with environments as in example below:
56 REQUEST_URL=<url to certification service API>
58 OUTPUT_PATH=/var/certs
62 ORGANIZATION=Linux-Foundation
63 ORGANIZATION_UNIT=ONAP
64 LOCATION=San-Francisco
67 SANS=test.onap.org:onap.com
69 KEYSTORE_PATH=/etc/onap/aaf/certservice/certs/certServiceClient-keystore.jks
70 KEYSTORE_PASSWORD=<password to keystore.jks>
71 TRUSTSTORE_PATH=/etc/onap/aaf/certservice/certs/certServiceClient-truststore.jks
72 TRUSTSTORE_PASSWORD=<password to certServiceClient-truststore.jks>
74 2. Run docker container as in following example (API and client must be running in same network):
80 --name aafcert-client \
81 --env-file <$PWD/client.env (same as in step1)> \
82 --network <docker network of cert service> \
83 --mount type=bind,src=<path to local host directory where certificate and trust anchor will be created>,dst=<OUTPUT_PATH (same as in step 1)> \
84 --volume <local path to keystore.jks>:<KEYSTORE_PATH> \
85 --volume <local path to trustore.jks>:<TRUSTSTORE_PATH> \
86 nexus3.onap.org:10001/onap/org.onap.aaf.certservice.aaf-certservice-client:$VERSION
90 After successful creation of certifications, container exits with exit code 0, expected logs looks like:
94 INFO 1 [ main] o.o.a.c.c.c.f.ClientConfigurationFactory : Successful validation of Client configuration. Configuration data: REQUEST_URL: https://aaf-cert-service:8443/v1/certificate/, REQUEST_TIMEOUT: 10000, OUTPUT_PATH: /var/certs, CA_NAME: RA
95 INFO 1 [ main] o.o.a.c.c.c.f.CsrConfigurationFactory : Successful validation of CSR configuration. Configuration data: COMMON_NAME: onap.org, COUNTRY: US, STATE: California, ORGANIZATION: Linux-Foundation, ORGANIZATION_UNIT: ONAP, LOCATION: San-Francisco, SANS: test.onap.org:onap.org
96 INFO 1 [ main] o.o.a.c.c.c.KeyPairFactory : KeyPair generation started with algorithm: RSA and key size: 2048
97 INFO 1 [ main] o.o.a.c.c.c.CsrFactory : Creation of CSR has been started with following parameters: COMMON_NAME: onap.org, COUNTRY: US, STATE: California, ORGANIZATION: Linux-Foundation, ORGANIZATION_UNIT: ONAP, LOCATION: San-Francisco, SANS: test.onap.org:onap.org
98 INFO 1 [ main] o.o.a.c.c.c.CsrFactory : Creation of CSR has been completed successfully
99 INFO 1 [ main] o.o.a.c.c.c.CsrFactory : Conversion of CSR to PEM has been started
100 INFO 1 [ main] o.o.a.c.c.c.PrivateKeyToPemEncoder : Attempt to encode private key to PEM
101 INFO 1 [ main] o.o.a.c.c.h.HttpClient : Attempt to send request to API, on url: https://aaf-cert-service:8443/v1/certificate/RA
102 INFO 1 [ main] o.o.a.c.c.h.HttpClient : Received response from API
103 INFO 1 [ main] o.o.a.c.c.c.c.PemToPKCS12Converter : Conversion of PEM certificates to PKCS12 keystore
104 DEBUG 1 [ main] o.o.a.c.c.c.c.PKCS12FilesCreator : Attempt to create PKCS12 keystore files and saving data. Keystore path: /var/certs/keystore.jks
105 INFO 1 [ main] o.o.a.c.c.c.c.PemToPKCS12Converter : Conversion of PEM certificates to PKCS12 truststore
106 DEBUG 1 [ main] o.o.a.c.c.c.c.PKCS12FilesCreator : Attempt to create PKCS12 truststore files and saving data. Truststore path: /var/certs/truststore.jks
107 INFO 1 [ main] o.o.a.c.c.AppExitHandler : Application exits with following exit code: 0 and message: Success
110 If container exits with non 0 exit code, you can find more information in logs, see :ref:`cert_logs` page.
112 As init container for Kubernetes
113 --------------------------------
115 To run Certification Service Client as init container for ONAP component, add following configuration to deploymnet:
129 - image: sample.image
133 - mountPath: /var/certs #CERTS CAN BE FOUND IN THIS DIRECTORY
137 - name: cert-service-client
138 image: nexus3.onap.org:10001/onap/org.onap.aaf.certservice.aaf-certservice-client:latest
139 imagePullPolicy: Always
142 value: http://aaf-cert-service:8080/v1/certificate/
143 - name: REQUEST_TIMEOUT
152 value: Linux-Foundation
153 - name: ORGANIZATION_UNIT
162 value: test.onap.org:onap.com
163 - name: KEYSTORE_PATH
164 value: /etc/onap/aaf/certservice/certs/certServiceClient-keystore.jks
165 - name: KEYSTORE_PASSWORD
167 - name: TRUSTSTORE_PATH
168 value: /etc/onap/aaf/certservice/certs/truststore.jks
169 - name: TRUSTSTORE_PASSWORD
172 - mountPath: /var/certs
174 - mountPath: /etc/onap/aaf/certservice/certs/
182 secretName: aaf-cert-service-client-tls-secret # Value of global.aaf.certService.client.secret.name