blob: f6078a413ef4dd129281517a8cd67a577db988ec [file] [log] [blame]
Bogumil Zebek483ccbf2020-03-25 11:54:11 +01001.. 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
4
5Configuration
6=============
7
Bogumil Zebek483ccbf2020-03-25 11:54:11 +01008
Adam Wudzinski2e83d542020-04-21 19:28:37 +02009Configuring Cert Service
10------------------------
11Cert Service keeps configuration of CMP Servers in file *cmpServers.json*.
12
13Example cmpServers.json file:
14
15.. code-block:: json
16
17 {
18 "cmpv2Servers": [
19 {
20 "caName": "Client",
21 "url": "http://aafcert-ejbca:8080/ejbca/publicweb/cmp/cmp",
22 "issuerDN": "CN=ManagementCA",
23 "caMode": "CLIENT",
24 "authentication": {
25 "iak": "mypassword",
26 "rv": "mypassword"
27 }
28 },
29 {
30 "caName": "RA",
31 "url": "http://aafcert-ejbca:8080/ejbca/publicweb/cmp/cmpRA",
32 "issuerDN": "CN=ManagementCA",
33 "caMode": "RA",
34 "authentication": {
35 "iak": "mypassword",
36 "rv": "mypassword"
37 }
38 }
39 ]
40 }
41
42This contains list of CMP Servers, where each server has following properties:
43
44 - *caName* - name of the external CA server
45 - *url* - Url to CMPv2 server
46 - *issuerDN* - Distinguished Name of the CA that will sign the certificate
47 - *caMode* - Issuer mode
48 - *authentication*
49
50 - *iak* - Initial authentication key, used to authenticate request in CMPv2 server
51 - *rv* - Reference values, used ti authenticate request in CMPv2 server
52
53
54
55This configuration is read on the application start. It can also be reloaded in runtime, by calling HTTP endpoint.
56
57
58Configuring in local(docker-compose) deployment:
59^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
60
61Static:
62"""""""
63
641. Edit *cmpServers.json* file in certservice/compose-resources
652. Start containers::
66
67 make start-backend
68
69Dynamic:
70""""""""
71
721. Find CertService docker container name.
732. Enter container::
74
75 docker exec -it <certservice-container-name> bash
76
773. Edit *cmpServers.json* file::
78
79 vim /etc/onap/aaf/certservice/cmpServers.json
80
814. Save
825. Reload configuration::
83
84 curl -I https://localhost:8443/reload --cacert /etc/onap/aaf/certservice/certs/root.crt --cert-type p12 --cert /etc/onap/aaf/certservice/certs/certServiceServer-keystore.p12 --pass secret
85
86
87Configuring in OOM deployment:
88^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
89
90Static:
91"""""""
92
93*Note! This must be executed before calling make all or needs remaking aaf Charts*
94
951. Edit *cmpServers.json* file
96
97 - if it's test deployment - edit *kubernetes/aaf/charts/aaf-cert-service/resources/test/cmpServers.json*
98 - if it's normal deployment - edit *kubernetes/aaf/charts/aaf-cert-service/resources/default/cmpServers.json*
99
1002. Build and start OOM deployment
101
102Dynamic:
103""""""""
104
1051. Encode your configuration to base64 (You can use for example online encoders or command line tool *base64*)
1062. Edit secret::
107
108 kubectl edit secret <cmp-servers-secret-name> # aaf-cert-service-secret by default
109
1103. Replace value for *cmpServers.json* with your base64 encoded configuration. For example:
111
112 .. code-block:: yaml
113
114 apiVersion: v1
115 data:
116 cmpServers.json: <HERE_PLACE_YOUR_BASE64_ENCODED_CONFIG>
117 kind: Secret
118 metadata:
119 creationTimestamp: "2020-04-21T16:30:29Z"
120 name: aaf-cert-service-secret
121 namespace: default
122 resourceVersion: "33892990"
123 selfLink: /api/v1/namespaces/default/secrets/aaf-cert-service-secret
124 uid: 6a037526-83ed-11ea-b731-fa163e2144f6
125 type: Opaque
126
1274. Save and exit
1285. New configuration will be automatically mounted to CertService pod, but reload is needed.
1296. Enter CertService pod::
130
131 kubectl exec -it <cert-service-pod-name> bash
132
1337. Reload configuration::
134
135 curl -I https://localhost:$HTTPS_PORT/reload --cacert $ROOT_CERT --cert-type p12 --cert $KEYSTORE_P12_PATH --pass $KEYSTORE_PASSWORD
136
137
Adam Wudzinskie59bd6b2020-04-22 11:24:24 +0200138Generating certificates for CertService and CertService Client
139--------------------------------------------------------------
140CertService and CertService client use mutual TLS for communication. Certificates are generated using Makefile.
141
142Local:
143^^^^^^
144
145Certificates are mounted to containers by docker volumes:
146
147 - CertService volumes are defined in certservice/docker-compose.yaml
148 - CertClient volumes are defined in certservice/Makefile
149
150All certificates are stored in *certservice/certs* directory. To recreate certificates go to *certservice/certs* directory and execute::
151
152 make clear all
153
154This will clear existing certs and generate new ones.
155
156OOM:
157^^^^
158
159Certificates are stored in secrets, which are mounted to pods as volumes. Both secrets are stored in *kubernetes/aaf/charts/aaf-cert-service/templates/secret.yaml*.
160Secrets take certificates from *kubernetes/aaf/charts/aaf-cert-service/resources* directory. Certificates are generated automatically during building(using Make) OOM repository.
161
162*kubernetes/aaf/charts/aaf-cert-service/Makefile* is similar to the one stored in certservice repository. It actually generates certificates.
163This Makefile is executed by *kubernetes/aaf/Makefile*, which is automatically executed during OOM build.
164
165
egernug56f09f32020-03-31 11:28:11 +0100166Configuring EJBCA server for testing
167------------------------------------
168
169To instantiate an EJBCA server for testing purposes with an OOM deployment, cmpv2Enabled and cmpv2Testing have to be changed to true in oom/kubernetes/aaf/values.yaml.
170
171cmpv2Enabled has to be true to enable aaf-cert-service to be instantiated and used with an external Certificate Authority to get certificates for secure communication.
172
173If cmpv2Testing is enabled then an EJBCA test server will be instantiated in the OOM deployment as well, and will come pre-configured with a test CA to request a certificate from.
174
175Currently the recommended mode is single-layer RA mode.
176
177
178Default Values:
179
180+---------------------+---------------------------------------------------------------------------------------------------------------------------------+
181| Name | Value |
182+=====================+=================================================================================================================================+
Adam Wudzinski2e83d542020-04-21 19:28:37 +0200183| Request URL | http://aaf-ejbca:8080/ejbca/publicweb/cmp/cmpRA |
egernug56f09f32020-03-31 11:28:11 +0100184+---------------------+---------------------------------------------------------------------------------------------------------------------------------+
185| Response Type | PKI Response |
186+---------------------+---------------------------------------------------------------------------------------------------------------------------------+
187| caMode | RA |
188+---------------------+---------------------------------------------------------------------------------------------------------------------------------+
189| alias | cmpRA |
190+---------------------+---------------------------------------------------------------------------------------------------------------------------------+
191
192
193If you wish to configure the EJBCA server, you can find Documentation for EJBCA here: https://doc.primekey.com/ejbca/
194
195If you want to understand how CMP works on EJBCA in more detail, you can find Details here: https://download.primekey.com/docs/EJBCA-Enterprise/6_14_0/CMP.html
Bogumil Zebek483ccbf2020-03-25 11:54:11 +0100196