You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Execution Core Container (and TRUE Connector) has implemented basic security mechanisms for all "public" endpoints (those endpoints that will be reached from outside world).
For extended token validation is that **public keys from connector itself and other connectors MUST be loaded into truststore.** Reason for this is that TRUE Connector will, during startup:
34
+
## Prerequisite
35
+
36
+
For extended token validation **public keys from connector itself and other connectors MUST be loaded into truststore.** Reason for this is that TRUE Connector will, during startup:
36
37
- load all certificates from truststore
37
38
- generate hash from certificate, using *MessageDigest* class.
38
39
- use certificate's SubjectAlternativeName and populate map with SAN and hash. This map will later be used to perform extended jwToken validation.
39
40
40
-
From our example, TLS certificate should be for DNS domain with name *ecc-consumer.demo*, and when hash is calculated from certificate, it should be a3cd813e1510ca64a9da\**\**. Those 2 values will be put in map, like key-pair (ecc-consumer.demo, a3cd813e1510ca64a9da\**\**), that will be used in verify token phase.
41
-
41
+
From our example, TLS certificate should be for DNS domain with name *ecc-consumer*, and when hash is calculated from certificate, it should be a3cd813e1510ca64a9da\**\**. Those 2 values will be put in map, like key-pair (ecc-consumer, a3cd813e1510ca64a9da\**\**), that will be used in verify token phase.
42
+
43
+
### Setup and configure ECC and DAPS for extended token validation from scratch
44
+
45
+
In order to properly configure the extended token validation, there are a few steps that should be done:
46
+
47
+
1. Clone some of MVD Certification Authority (e.g. Testbed or any other Testbed based)
48
+
49
+
2. Go to /CertificateAuthority and generate key pair for device certificate (ECC) with the next command:
4. Copy generated p12 file to true-connector/ecc_cert and change next properties in .env file:
64
+
65
+
```
66
+
### CONSUMER Configuration
67
+
CONSUMER_DAPS_KEYSTORE_NAME=ecc-consumer.p12
68
+
CONSUMER_DAPS_KEYSTORE_PASSWORD=password
69
+
CONSUMER_DAPS_KEYSTORE_ALIAS=1
70
+
```
71
+
72
+
5. Import ***ecc-consumer.crt*** to ***truststoreEcc.jks***
73
+
74
+
6. Register new connector in DAPS
75
+
76
+
**NOTE** Subject Alternative Name (SAN) which was used in the certificate creation in previous step, MUST match with client name that is used to register certificate/connector to the DAPS in register_connector.sh script.
77
+
78
+
6.1. Copy previously generated ecc-consumer.cert in IDS-testbed/DAPS/Keys and rename it from ***ecc-consumer.crt*** -> ***ecc-consumer.cert***
79
+
80
+
6.2. Go to /DAPS/ and run the following command which will register ECC as new client in client.yml:
81
+
82
+
6.3 Make sure that script (*register_connector.sh*) will not append additional name (like .demo) for referring connector
83
+
84
+
```
85
+
- key: referringConnector
86
+
value: http://${CLIENT_NAME}
87
+
```
88
+
89
+
Once confirmed, following command can be executed:
90
+
91
+
```
92
+
./register_connector.sh ecc-consumer
93
+
94
+
```
95
+
96
+
**IMPORTANT:** Repeat the same procedure for ECC Provider, and in all places instead of consumer use provider, e.g. ecc-provider.cert, etc.
97
+
98
+
The same steps applies for all other connectors.
99
+
42
100
## Validate jwToken
43
101
44
102
Once jwToken is received, either from DAPS or from other connector, it will be validated with following:
- get *referringConnector* claim (in our example - "http://ecc-consumer.demo")
60
-
- get *transportCertsSha256* (in our example - "a3cd813e1510ca64a9da****")
117
+
- get *referringConnector* claim (in our example - "http://ecc-consumer")
118
+
- get *transportCertsSha256* (in our example - "a3cd813e1510ca64a9da****") - this one will require TLS certificate loaded previously in truststore, like stated at the begining of this document (this is mandatory also for TLS communication and enabling https traffic)
61
119
- check if map contains same hash value for referringConnector
62
120
63
121
In our example, map should contain key-pair like following (populated in startup phase):
64
122
65
-
(ecc-consumer.demo, a3cd813e1510ca64a9da****)
123
+
(ecc-consumer, a3cd813e1510ca64a9da****)
66
124
67
125
If this evaluates as true, token is valid, otherwise, token is not valid.
0 commit comments