European Union / European Regional Development Fund / Investing in your future

SECURITY SERVER USER GUIDE

X-ROAD 6

Version: 2.55
Doc. ID: UG-SS


Version history

Date Version Description Author
05.09.2014 0.1 Initial draft
24.09.2014 0.2 Translation to English
10.10.2014 0.3 Update
14.10.2014 0.4 Title page, header, footer added
16.10.2014 0.5 Minor corrections done
12.11.2014 0.6 Asynchronous messages section removed. Global Configuration distributors section replaced with Configuration Anchor section (10.1). Added Logback information (Chapter 16). A note added about the order of timestamping services (Section 10.2).
1.12.2014 1.0 Minor corrections done
19.01.2015 1.1 License information added
27.01.2015 1.2 Minor corrections done
30.04.2015 1.3 "sdsb" changed to "xroad"
29.05.2015 1.4 Message Log chapter added (Chapter 11)
30.06.2015 1.5 Minor corrections done
3.07.2015 1.6 Audit Log chapter added (Chapter 12)
7.09.2015 1.7 Message Log – how to use remote database (Section 11.3)
14.09.2015 1.8 Reference to the audit log events added
18.09.2015 1.9 Minor corrections done
21.09.2015 2.0 References fixed
07.10.2015 2.1 Default value of the parameter acceptable-timestamp-failure-period set to 14400
14.10.2015 2.2 Instructions for using an external database for the message log corrected
05.11.2015 2.3 Updates related to backup and restore (Chapter 13)
30.11.2015 2.4 X-Road concepts updated (Section 1.2). Security server registration updated (Chapter 3). Security server clients updated (Chapter 4); only subsystems (and not members) can be registered as security server clients and have services or access rights configured. Cross-references fixed. Editorial changes made.
09.12.2015 2.5 Security server client deletion updated (Section 4.5.2). Editorial changes made.
14.12.2015 2.6 Message log updated (Chapter 11)
14.01.2016 2.7 Logs updated (Chapter 16)
08.02.2016 2.8 Corrections in chapter 16
20.05.2016 2.9 Merged changes from xtee6-doc repo. Added Chapter 14 Diagnostics and updated content of 10.3 Changing the Internal TLS Key and Certificate.
29.11.2016 2.10 User Management updated (Chapter 2). XTE-297: Internal Servers tab is displayed to security server owner (Chapter 9).
19.12.2016 2.11 Added Chapter 15 Operational Monitoring
20.12.2016 2.12 Minor corrections in Chapter 15
22.12.2016 2.13 Corrections in Chapter 15.2.5
04.01.2016 2.14 Corrections in Chapter 15.2.5
20.02.2017 2.15 Converted to Github flavoured Markdown, added license text, adjusted tables for better output in PDF Toomas Mölder
16.03.2017 2.16 Added observer role to Chapters 2.1 and 2.2 Tatu Repo
22.01.2018 2.16.1 Added NEE member class info 4.2 Jürgen Šuvalov
15.06.2017 2.17 Added Chapter 17 on federation Olli Lindgren
25.09.2017 2.18 Added chapter 16 Environmental Monitoring Tomi Tolvanen
17.10.2017 2.19 Added section 16.3 Limiting environmental monitoring remote data set Joni Laurila
05.03.2018 2.20 Added terms and abbreviations reference, document links, moved concepts to terms and abbreviations. Tatu Repo 
10.04.2018 2.21 Update internal server certificate documentation. Jarkko Hyöty
25.05.2018 2.22 Update system parameters documentation. Jarkko Hyöty
15.11.2018 2.23 Minor updates for Ubuntu 18.04 Jarkko Hyöty
06.02.2019 2.24 Minor updates on security server client registration in Chapters 4.3 and 4.4. Petteri Kivimäki
15.03.2019 2.25 Update documentation to cover REST service usage in chapter [6] Jarkko Hyöty
26.03.2019 2.26 Added chapter on API keys 19 Janne Mattila
16.04.2019 2.27 Minor updates regarding REST services in chapter [6] Petteri Kivimäki
30.06.2019 2.28 Update the default connection type from HTTP to HTTPS in chapter [9] Petteri Kivimäki
01.07.2019 2.29 Changing the Security Server Owner chapter added (Chapter 3.4) Petteri Kivimäki
14.08.2019 2.30 Added automatic backups Ilkka Seppälä
29.09.2019 2.31 Added chapter 19.3 on REST API correlation id Janne Mattila
30.09.2019 2.32 Added remote database migration guide Ilkka Seppälä
15.10.2019 2.33 Updated REST services in chapter [6] Ilkka Seppälä
04.11.2019 2.34 Added information about REST API request rate and size limits Janne Mattila
07.11.2019 2.35 Add more information about service descriptions to chapter [6] Ilkka Seppälä
05.12.2019 2.36 Add information about timestamping failover capabilities in chapter 10.2 Petteri Kivimäki
24.02.2020 2.37 Updated notes about key caching after changing internal TLS key and certificate 10.3 Caro Hautamäki
26.03.2020 2.38 Added chapter on updating API keys 19.1.3 Petteri Kivimäki
30.03.2020 2.39 Added description of pre-restore backups Ilkka Seppälä
01.04.2020 2.40 Added notes about IP whitelists for REST API Janne Mattila
03.06.2020 2.41 Updated audit logging description Janne Mattila
05.06.2020 2.42 Added chapter about validation errors 19.4 Caro Hautamäki
25.06.2020 2.43 Update environmental and operational monitoring JMXMP details Petteri Kivimäki
08.07.2020 2.44 Update chapter on access rights 7 Petteri Kivimäki
30.07.2020 2.45 Added mention about proxy_ui_api.log to 17 Logs and System Services Janne Mattila
10.08.2020 2.46 Added mention about unit start rate limits to 17.1 System Services Janne Mattila
21.09.2020 2.47 Added a validation error example to 19.4 Validation errors Caro Hautamäki
29.09.2020 2.48 Update chapters 3, 4, 6, 7, 8 and 13 to match the new management API Tapio Jaakkola
30.09.2020 2.49 Update chapters 3, 5, 9, 10, 14 and 17 to match the new management API Caro Hautamäki
10.10.2020 2.50 Corrections in Chapter 19 Management REST API Janne Mattila
13.10.2020 2.51 Added a section about the warning responses 19.5 Warning responses Caro Hautamäki
15.10.2020 2.52 Added chapter 2.3 Managing API Keys Caro Hautamäki
22.10.2020 2.53 Added reference to management REST API's OpenAPI description Petteri Kivimäki
01.12.2020 2.54 Added endpoint for getting one API key to 19.1.2 Listing API keys Janne Mattila
25.02.2020 2.55 Added information to find X-Road ID from conf backup file in chapter 13.2 Restore from the Command Line Karl Talumäe

Table of Contents

License

This document is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/

1 Introduction

This document describes the management and maintenance of an X-Road version 6 security server.

1.1 The X-Road Security Server

The main function of a security server is to mediate requests in a way that preserves their evidential value.

The security server is connected to the public Internet from one side and to the information system within the organization's internal network from the other side. In a sense, the security server can be seen as a specialized application-level firewall that supports the SOAP and REST protocols; hence, it should be set up in parallel with the organization's firewall, which mediates other protocols.

The security server is equipped with the functionality needed to secure the message exchange between a client and a service provider.

To increase the availability of the entire system, the service user's and service provider's security servers can be set up in a redundant configuration as follows.

The security server also depends on a central server, which provides the global configuration.

1.2 Terms and abbreviations

See X-Road terms and abbreviations documentation [TA-TERMS].

1.3 References

  1. [ASiC] ETSI TS 102 918, Electronic Signatures and Infrastructures (ESI); Associated Signature Containers (ASiC)

  2. [CRON] Quartz Scheduler CRON expression,
    http://www.quartz-scheduler.org/generated/2.2.1/html/qs-all/#page/Quartz_Scheduler_Documentation_Set%2Fco-trg_crontriggers.html

  3. [INI] INI file,
    http://en.wikipedia.org/wiki/INI_file

  4. [JDBC] Connecting to the Database,
    https://jdbc.postgresql.org/documentation/93/connect.html

  5. [JSON] Introducing JSON,
    http://json.org/

  6. [PR-MESS] Cybernetica AS. X-Road: Message Protocol v4.0. Document ID: PR-MESS

  7. [SPEC-AL] Cybernetica AS. X-Road: Audit log events. Document ID: SPEC-AL

  8. [PR-OPMON] Cybernetica AS. X-Road: Operational Monitoring Protocol. Document ID: PR-OPMON

  9. [PR-OPMONJMX] Cybernetica AS. X-Road: Operational Monitoring JMX Protocol. Document ID: PR-OPMONJMX

  10. [UG-OPMONSYSPAR] Cybernetica AS. X-Road: Operational Monitoring System Parameters. Document ID: PR-OPMONSYSPAR

  11. [IG-SS] Cybernetica AS. X-Road: Security Server Installation Guide. Document ID: IG-SS

  12. [JMX] Monitoring and Management Using JMX Technology,
    http://docs.oracle.com/javase/8/docs/technotes/guides/management/agent.html

  13. [ZABBIX-GATEWAY] Zabbix Java Gateway,
    https://www.zabbix.com/documentation/3.0/manual/concepts/java

  14. [ZABBIX-JMX] Zabbix JMX Monitoring,
    https://www.zabbix.com/documentation/3.0/manual/config/items/itemtypes/jmx_monitoring

  15. [ZABBIX-API] Zabbix API,
    https://www.zabbix.com/documentation/3.0/manual/api

  16. [ARC-ENVMON] X-Road: Environmental Monitoring Architecture. Document ID: ARC-ENVMON.

  17. [PR-ENVMONMES] X-Road: Environmental Monitoring Messages. Document ID: PR-ENVMONMES.

  18. [MONITORING_XSD] X-Road XML schema for monitoring extension. monitoring.xsd.

  19. [TA-TERMS] X-Road Terms and Abbreviations. Document ID: TA-TERMS.

  20. [PR-META] X-Road: Service Metadata Protocol. Document ID: PR-META.

  21. [PR-MREST] X-Road: Service Metadata Protocol for REST. Document ID: PR-MREST.

  22. [UG-SYSPAR] X-Road: System Parameters User Guide. Document ID: UG-SYSPAR.

  23. [REST_UI-API] X-Road Security Server Admin API OpenAPI Specification, https://github.com/nordic-institute/X-Road/blob/develop/src/proxy-ui-api/src/main/resources/openapi-definition.yaml.

2 User Management

2.1 User Roles

Security servers support the following user roles:

One user can have multiple roles and multiple users can be in the same role. Each role has a corresponding system group, created upon the installation of the system.

Henceforth each applicable section of the guide indicates, which user role is required to perform a particular action. For example:

Access rights: Security Officer

If the logged-in user does not have a permission to carry out a particular task, the button that would initiate the action is hidden (and neither is it possible to run the task using its corresponding keyboard combinations or mouse actions). Only the permitted data and actions are visible and available to the user.

2.2 Managing the Users

User management is carried out on command line in root user permissions.

To add a new user, enter the command:

adduser username

To grant permissions to the user you created, add it to the corresponding system groups, for example:

adduser username xroad-security-officer
adduser username xroad-registration-officer
adduser username xroad-service-administrator
adduser username xroad-system-administrator
adduser username xroad-securityserver-observer

To remove a user permission, remove the user from the corresponding system group, for example:

deluser username xroad-security-officer

Modified user permissions are applied only after user does a new log in.

To remove a user, enter:

deluser username

2.3 Managing API Keys

API keys are used to authenticate API calls to Security Server's management REST API. API keys are associated with roles that define the permissions granted to the API key. If the API key is lost, it can be revoked.

2.3.1 Creating a new API key

Access rights

  1. In the Navigation tabs, select KEYS AND CERTIFICATES.

  2. In the opening view, select API KEYS tab.

  3. In the opening view, click CREATE API KEY. In the wizard that opens

    1. Select the roles you want to be associated with the API key. Click NEXT.

    2. Click CREATE KEY. The API key, API key id and assigned roles will be displayed in the view. The API key will only be displayed this once so save it in a secure location.

    3. Click FINISH.

2.3.2 Editing the roles of an API key

Access rights

  1. In the Navigation tabs, select KEYS AND CERTIFICATES.

  2. In the opening view, select API KEYS tab.

  3. In the opening view, in the API key list, locate the API key you want to edit and click Edit at the end of the API key row. In the popup that opens

    1. Select the roles you want to be associated with the API key. Click SAVE.

2.3.3 Revoking an API key

Access rights

  1. In the Navigation tabs, select KEYS AND CERTIFICATES.

  2. In the opening view, select API KEYS tab.

  3. In the opening view, in the API key list, locate the API key you want to revoke and click Revoke Key at the end of the API key row. In the dialog that opens click YES.

3 Security Server Registration

To use a security server for mediating (exchanging) messages, the security server and its owner must be certified by a certification service provider approved by the X-Road governing authority, and the security server has to be registered in the X-Road governing authority.

3.1 Configuring the Signing Key and Certificate for the Security Server Owner

The signing keys used by the security servers for signing X-Road messages can be stored on software or hardware based (a Hardware Security Module or a smartcard) security tokens, according to the security policy of the X-Road instance.

Depending on the certification policy, the signing keys are generated either in the security server or by the certification service provider. Sections 3.1.1 to 3.1.3 describe the actions necessary to configure the signing key and certificate in case the key is generated in the security server. Section 3.1.4 describes the importing of the signing key and certificate in case the key is generated by the certification service provider.

The background colors of the devices, keys and certificate are explained in Section 5.1.

3.1.1 Generating a Signing Key and Certificate Signing Request

Access rights:

To generate a Signing key and a Certificate Signing Request, follow these steps.

  1. In the Navigation tabs, select KEYS AND CERTIFICATES.

  2. If you are using a hardware security token, ensure that the device is connected to the security server. The device information must be displayed in the SIGN AND AUTH KEYS table.

  3. To log in to the token, click LOG IN on the token's row in the table and enter the PIN code. Once the correct PIN is entered, the LOG IN button changes to LOG OUT.

  4. To generate a signing key and CSR for it, expand the token's information by clicking the caret next to the token name and click ADD KEY. In the wizard that opens

    1. Define a label for the newly created signing key (not mandatory) and click NEXT.

    2. In the dialog page that opens

      1. Select the certificate usage policy from the Usage drop down list (SIGNING for signing certificates)

      2. Select the X-Road member the certificate will be issued for from the Client drop-down list

      3. Select the issuer of the certificate from the Certification Service drop-down list

      4. Select the format of the certificate signing request (PEM or DER) from the CSR Format drop-down list, according to the certification service provider's requirements

      5. Click CONTINUE

    3. In the dialog that opens

      1. Review the certificate owner's information that will be included in the CSR and fill in the empty fields, if needed

      2. Click GENERATE CSR

      3. Click DONE

After the generation of the CSR, a "Request" record is added under the key's row in the table, indicating that a certificate signing request has been created for this key. The record is added even if the request file was not saved to the local file system.

To certify the signing key, transmit the certificate signing request to the approved certification service provider and accept the signing certificate created from the certificate signing request.

3.1.2 Importing a Certificate from the Local File System

Access rights: Security Officer, Registration Officer

To import the signing certificate to the security server, follow these steps.

  1. In the Navigation tabs, select KEYS AND CERTIFICATES.

  2. Show more details about a token by clicking the caret next to the token name.

  3. Click IMPORT CERT..

  4. Locate the certificate file from the local file system and click OK. After importing the certificate, the "Request" record under the signing key's row is replaced with the information from the imported certificate. By default, the signing certificate is imported in the "Registered" state.

3.1.3 Importing a Certificate from a Security Token

Access rights: Security Officer, Registration Officer

To import a certificate from a security token, follow these steps.

  1. In the Navigation tabs, select KEYS AND CERTIFICATES.

  2. Show more details about a token by clicking the caret next to the token name.

  3. Make sure that a key device containing the signing key and the signing certificate is connected to the security server. The device and the keys and certificates stored on the device must be displayed in the SIGN AND AUTH KEYS view.

  4. To log in to the security token, click LOG IN on the token's row in the table and enter the PIN. Once the correct PIN is entered, the LOG IN button changes to LOG OUT.

  5. Click the Import button on the row of the certificate. By default, the certificate is imported in the "Registered" state.

3.2 Configuring the Authentication Key and Certificate for the Security Server

The background colors of the devices, keys and certificate are explained in Section 5.1.

3.2.1 Generating an Authentication Key

Access rights

The security server's authentication keys can only be generated on software security tokens.

  1. In the Navigation tabs, select KEYS AND CERTIFICATES.

  2. To log in to the software token, click LOG IN on the token's row in the table and enter the token's PIN code. Once the correct PIN is entered, the LOG IN button changes to LOG OUT.

  3. Show more details about the token by clicking the caret next to the token name.

  4. To generate an authentication key and CSR for it, click the ADD KEY button below the token row. In the wizard that opens

    1. Define a label for the newly created authentication key (not mandatory) and click NEXT.

    2. In the dialog page that opens

      1. Select the certificate usage policy from the Usage drop down list (AUTHENTICATION for authentication certificates)

      2. Select the issuer of the certificate from the Certification Service drop-down list

      3. Select the format of the certificate signing request (PEM or DER) from the CSR Format drop-down list, according to the certification service provider's requirements

      4. Click CONTINUE

    3. In the dialog that opens

      1. Review the certificate owner's information that will be included in the CSR and fill in the empty fields, if needed

      2. Click GENERATE CSR

      3. Click DONE

3.2.2 Generating a Certificate Signing Request for an Authentication Key

Access rights: Security Officer

To generate a certificate signing request (CSR) for the authentication key, follow these steps.

  1. In the Navigation tabs, select KEYS AND CERTIFICATES.

  2. Show more details about a token by clicking the caret next to the token name.

  3. On the row of the desired key, click Generate CSR. In the dialog that opens

    2.1 Select the certificate usage policy from the Usage drop down list (AUTH for authentication certificates);

    2.2 select the issuer of the certificate from the Certification Service drop-down list;

    2.3 select the format of the certificate signing request (PEM or DER), according to the certification service provider's requirements

    2.4 click CONTINUE;

  4. In the form that opens, review the information that will be included in the CSR and fill in the empty fields, if needed.

  5. Click GENERATE CSR to complete the generation of the CSR and save the prompted file to the local file system.

  6. Click DONE

After the generation of the CSR, a "Request" record is added under the key's row in the table, indicating that a certificate signing request has been created for this key. The record is added even if the request file was not saved to the local file system.

To certify the authentication key, transmit the certificate signing request to the approved certification service provider and accept the authentication certificate created from the certificate signing request.

3.2.3 Importing an Authentication Certificate from the Local File System

Access rights: Security Officer

To import the authentication certificate to the security server, follow these steps.

  1. In the Navigation tabs, select Keys and Certificates.

  2. Show more details about a token by clicking the caret next to the token name.

  3. Click Import certificate.

  4. Locate the certificate file from the local file system and click OK. After importing the certificate, the "Request" record under the authentication key's row is replaced with the information from the imported certificate. By default, the certificate is imported in the "Saved" (see Section 5.2.2) and "Disabled" states (see Section 5.3).

3.3 Registering the Security Server in the X-Road Governing Authority

To register the security server in the X-Road governing authority, the following actions must be completed.

3.3.1 Registering an Authentication Certificate

Access rights: Security Officer

The security server's registration request is signed in the security server with the server owner's signing key and the server's authentication key. Therefore, ensure that the corresponding certificates are imported to the security server and are in a usable state (the tokens holding the keys are in logged in state and the OCSP status of the certificates is "good").

To submit an authentication certificate registration request, follow these steps.

  1. In the Navigation tabs, select KEYS AND CERTIFICATES.

  2. Show more details about a token by clicking the caret next to the token name.

  3. Click Register at the end of the desired certificate row. Note that the certificate must be in "Saved" state.

  4. In the dialog that opens, enter the security server's public DNS name or its external IP address and click ADD.

On submitting the request, the message "Certificate registration request successful" is displayed, and the authentication certificate's state is set to "Registration in process".

After the X-Road governing authority has accepted the registration, the registration state of the authentication certificate is set to "Registered" and the registration process is completed.

3.4 Changing the Security Server Owner

Access rights: Registration Officer

To change the security server owner, two registered Owner members must be available. If a registered member is already available, jump directly to step 3.

To add a new member and change it to Owner member, the following actions must be completed.

  1. Add a new Owner member to the security server

    1.1 On the CLIENTS view, select ADD MEMBER.

    1.2 In the opening wizard, Select the new Owner member from the list of security server clients

    1.3 Add the selected member

    Note: Signing Key and Certificate must be configured for the new Owner member. If needed, the wizard will automatically show the dedicated steps for Key and Certificate configuration to collect the needed information.

  2. Register the new member

    2.1 On the CLIENTS view, locate the new member in the Clients list and click Register in the corresponding row

    2.2 In the opening dialog, click Register. A registeration request is sent to the X-Road Governing Authority

    Note: Once the request is approved, the new member appears as "Registered" - it can be set as Owner member.

  3. Request a change of the security server owner

    3.1 On the CLIENTS view, locate the new member and click its name to open the member's detail view

    3.2 In the detail view, click MAKE OWNER

    1.3 In the opening dialog, click MAKE OWNER. An owner change request is sent to the X-Road Governing Authority

Once the owner change request is approved, the new member will be automatically shown as the security server Owner member.

4 Security Server Clients

Important: to use or provide X-Road services, a security server client needs to be certified by a certification service provider approved by the X-Road governing authority, and the association between the client and the security server used by the client must be registered at the X-Road governing authority.

This section does not address managing the owner to a security server. The owner's information has been already added to the security server upon the installation, and registered upon the security server's registration. The owner's registration status can be looked up by selecting CLIENTS on the main menu. In the list the item with text "(Owner)" after the name is security server's owner. Before the registration of the security server, the owner is in the "Saved" state and after the completion of the registration process, in the "Registered" state.

The registration of the security server's owner does not extend to the owner's subsystems. The subsystems must be registered as individual clients.

4.1 Security Server Client States

The security server distinguishes between the following client states.

Saved – the client's information has been entered and saved into the security server's configuration (see 4.2), but the association between the client and the security server is not registered in the X-Road governing authority. (If the association is registered in the central server prior to the entry of data, the client will move to the "Registered" state upon data entry.) From this state, the client can move to the following states:

Registration in progress – a registration request for the client is submitted from the security server to the central server, but the association between the client and the security server is not yet approved by the X-Road governing authority. From this state, the client can move to the following states:

Registered – the association between the client and the security server has been approved in the X-Road governing authority. In this state, the client can provide and use X-Road services (assuming all other prerequisites are fulfilled). From this state, the client can move to the following states:

Global error – the association between the client and the security server has been revoked in the central server. From this state, the client can move to the following states:

Deletion in progress – a client deletion request has been submitted from the security server. From this state, the client can move to the following state:

Deleted – the client's information has been deleted from the security server's configuration.

4.2 Adding a Security Server Client

Access rights: Registration Officer

Follow these steps.

  1. In the CLIENTS view, click ADD CLIENT.

  2. In the wizard that opens

    1. Client details page: Select an existing client from the Global list by pressing SELECT CLIENT or specify the details of the Client to be added manually and click NEXT

    2. Token page: Select the token where you want to add the SIGN key for the new Client. Click NEXT

    3. Sign key page: Define a label (optional) for the newly created SIGN key and click NEXT

    4. CSR details page: Select the Certification Authority (CA) that will issue the certificate in Certification Service field and format of the certificate signing request according to the CA's requirements in the CSR Format field. Click NEXT.

    5. Generate CSR page: Define Organization Name (O) and click NEXT

    6. Finish page: click SUBMIT and the new client will be added to the Clients list and the new key and CSR will appear in the Keys and Certificates view.

The new client is added to the list of security server clients in the "Saved" state.

4.3 Adding a Security Server Member Subsystem

Access rights: Registration Officer

Follow these steps.

  1. In the CLIENTS view in the client list, locate the X-Road member you want to add a subsystem to and click Add Subsystem at the end of the row.

  2. In the wizard that opens

    2.1. Select an existing subsystem from the Global list by pressing SELECT SUBSYSTEM or specify the Subsystem Code manually

    2.2. If you wish to register the new subsystem immediately, check the Register subsystem checkbox and then click ADD SUBSYSTEM.

    (2.3.) If you checked the Register subsystem checkbox, a popup will appear asking whether you wish to register the subsystem immediately. In the popup, click YES.

The new subsystem is added to the list of security server clients in the "Saved" state.

4.4 Configuring a Signing Key and Certificate for a Security Server Client

A signing key and certificate must be configured for the security server client to sign messages exchanged over the X-Road. In addition, a signing key and certificate are required for registering a security server client.

Certificates are not issued to subsystems; therefore, the certificate of the subsystem's owner (that is, an X-Road member) is used for the subsystem.

All particular X-Road member's subsystems that are registered in the same security server use the same signing certificate for signing messages. Hence, if the security server already contains the member's signing certificate, it is not necessary to configure a new signing key and/or certificate when adding a subsystem of that member.

The process of configuring the signing key and certificate for a security server client is the same as for the security server owner. The process is described in Section 3.1.

4.5 Registering a Security Server Client in the X-Road Governing Authority

To register a security server client in the X-Road governing authority, the following actions must be completed.

4.5.1 Registering a Security Server Client

Access rights: Registration Officer

To submit a client registration request follow these steps.

  1. In the CLIENTS view.

  2. Click Register button on the row that contains the client you wish to register.

  3. Click YES to submit the request.

On submitting the request, the message "Request sent" is displayed, and the client's state is set to "Registration in process".

After the X-Road governing authority has accepted the registration, the state of the client is set to "Registered" and the registration process is completed.

4.6 Deleting a Client from the Security Server

If a client is deleted from the security server, all the information related to the client is deleted from the server as well – that is, the WSDLs, services, access rights, and, if necessary, the certificates.

When one of the clients is deleted, it is not advisable to delete the signing certificate if the certificate is used by other clients registered to the security server, e.g., other subsystems belonging the same X-Road member as the deleted subsystem.

A client registered or submitted for registration in the X-Road governing authority (indicated by the "Registered" or "Registration in progress" state) must be unregistered before it can be deleted. The unregistering event sends a security server client deletion request from the security server to the central server.

4.6.1 Unregistering a Client

Access rights: Registration Officer

To unregister a client, follow these steps.

  1. In the CLIENTS view click the name of client that you wish to remove from the server

  2. In the window that opens, click UNREGISTER and then click YES. The security server automatically sends a client deletion request to the X-Road central server, upon the receipt of which the association between the security server and the client is revoked.

  3. Next, a notification is displayed about unregistering client. Now the client is moved to the "Deletion in progress" state, wherein the client cannot mediate messages and cannot be registered again in the X-Road governing authority.

Note: It is possible to unregister a registered client from the central server without sending a deletion request through the security server. In this case, the security server's administrator responsible for the client must transmit a request containing information about the client to be unregistered to the central server's administrator. If the client has been deleted from the central server without a prior deletion request from the security server, the client is shown in the "Global error" state in the security server.

4.6.2 Deleting a Client

Access rights: Registration Officer

A security server client can be deleted if its state is "Saved", "Global error" or "Deletion in progress". Clients that are in states "Registered" or "Registration in progress" need to be unregistered before they can be deleted (see Section 4.5.1).

To delete a client, follow these steps.

  1. In the CLIENTS view click the name of the client you wish to remove from the security server.

  2. In the window that opens, click DELETE and then click YES. If there are no users for the signature key nor for the certificate associated then an option is presented to delete the client's certificates. To delete the certificates, click YES again.

5 Security Tokens, Keys, and Certificates

5.1 Availability States of Security Tokens

Notice that the colors are a new feature introduced in the upcoming version 6.25.0

To display the availability of tokens, the following colors and labels are used in the "Keys and Certificates" view.

Caution: The key device's and key's information is automatically saved to the configuration when a certificate associated with either of them is imported to the security server, or when a certificate signing request is generated for the key. Similarly, the key device's and key's information is deleted from the security server configuration automatically upon the deletion of the last associated certificate and/or certificate signing request.

5.2 Registration States of Certificates

Registration states indicate if and how a certificate can be used in the X-Road system. In the "Keys and Certificates" view, a certificate's registration states (except "Deleted") are displayed in the "Status" column.

5.2.1 Registration States of the Signing Certificate

A security server signing certificate can be in one of the following registration states.

5.2.2 Registration States of the Authentication Certificate

A security server authentication certificate can be in one of the following registration states.

Saved – the certificate has been imported to the security server and saved to its configuration, but the certificate has not been submitted for registration. From this state, the certificate can move to the following states:

Registration in progress – an authentication certificate registration request has been created and sent to the central server, but the association between the certificate and the security server has not yet been approved. From this state, the certificate can move to the following states:

Registered – the association between the authentication certificate and the security server has been approved in the central server. An authentication certificate in this state can be used to establish a secure data exchange channel for exchanging X-Road messages. From this state, the certificate can move to the following states:

Global error – the association between the authentication certificate and the security server has been revoked in the central server. From this state, the certificate can move to the following states:

Deletion in progress – an authentication certificate registration request has been created for the certificate and sent to the central server. From this state, the certificate can be deleted. If the certificate has been deleted from the security server configuration, it will not be displayed in the table anymore.

5.3 Validity States of Certificates

Validity states indicate if and how a certificate can be used independent of the X-Road system. In the "Keys and Certificates" view, the certificate's validity states are displayed in the "OCSP" column. Validity states (except "Disabled") are displayed for certificates that are in the "Registered" registration state.

A security server certificate can be in one of the following validity states.

5.4 Activating and Disabling the Certificates

Access rights

Disabled certificates are not used for signing messages or for establishing secure channels between security servers (authentication). If a certificate is disabled, its status in the "OCSP" column in the "Keys and Certificates" table is "Disabled".

To activate or disable a certificate, follow these steps.

  1. In the Navigation tabs, select KEYS AND CERTIFICATES.

  2. Show more details about a token by clicking the caret next to the token name.

  3. To activate a certificate, click on the desired certificate's name.

    3.1 In the opening Certificate dialog, click Activate. To deactivate a certificate, click DISABLE in the Certificate dialog.

5.5 Configuring and Registering an Authentication key and Certificate

A Security server can have multiple authentication keys and certificates (e.g., during authentication key change).

The process of configuring another authentication key and certificate is described in Section 3.2.

The process of registering an authentication certificate is described in Section 3.3.1.

5.6 Deleting a Certificate

An authentication certificate registered or submitted for registration in the X-Road governing authority (indicated by the "Registered" or "Registration in progress" state) must be unregistered before it can be deleted. The unregistering event sends an authentication certificate deletion request from the security server to the central server.

5.6.1 Unregistering an Authentication Certificate

Access rights: Security Officer

To unregister an authentication certificate, follow these steps.

  1. In the Navigation tabs, select KEYS AND CERTIFICATES.

  2. Show more details about a token by clicking the caret next to the token name.

  3. Click on an authentication certificate that is in the state "Registered" or "Registration in progress".

    3.1 In the opening Certificate dialog, click UNREGISTER.

    Next, an authentication certificate deletion request is automatically sent to the X-Road central server, upon the receipt of which the associated authentication certificate is deleted from the central server. If the request was successfully sent, the message "Certificate unregistration request sent successfully" is displayed and the authentication certificate is moved to the "Deletion in progress" state.

A registered authentication certificate can be deleted from the central server without sending a deletion request through the security server. In this case, the security server's administrator must transmit a request containing information about the authentication certificate to be deleted to the central server's administrator. If the authentication certificate has been deleted from the central server without a deletion request from the security server, the certificate is shown in the "Global error" state in the security server.

5.6.2 Deleting a Certificate or a certificate Signing Request notice

Access rights

An authentication certificate saved in the system configuration can be deleted if its state is "Saved", "Global error" or "Deletion in progress". The signing certificate and request notices can always be deleted from the system configuration.

If a certificate is stored on a hardware security token, then the deletion works on two levels:

To delete a certificate, follow these steps.

  1. In the Navigation tabs, select KEYS AND CERTIFICATES.

  2. Show more details about a token by clicking the caret next to the token name.

  3. Click on the certificate that you want to delete.

    3.1 In the opening Certificate dialog, click DELETE. Confirm the deletion by clicking YES.

To delete a certificate signing request notice (CSR), follow these steps.

  1. In the Navigation tabs, select KEYS AND CERTIFICATES.

  2. Show more details about a token by clicking the caret next to the token name.

  3. At the end of the desired CSR row click Delete CSR. Confirm the deletion by clicking YES.

5.7 Deleting a Key

Warning: Deleting a key from the server configuration also deletes all certificates (and certificate signing request notices) associated with the key.

Access rights

The deletion of keys works on two levels:

To delete a key, follow these steps.

  1. In the Navigation tabs, select KEYS AND CERTIFICATES.

  2. Show more details about a token by clicking the caret next to the token name.

  3. Click on the desired Key.

    3.1 In the opening Key dialog, click DELETE. Confirm the deletion of the key (and its associated certificates) by clicking YES.

6 X-Road Services

X-Road supports both SOAP and REST services. The services are managed on two levels:

6.1 Adding a service description

Access rights: Service Administrator

6.1.1 SOAP

When a new WSDL file is added, the security server reads service information from it and displays the information in the table of services. The service code, title and address are read from the WSDL.

To add a WSDL, follow these steps.

  1. Navigate to CLIENTS tab, click the name of the client for which you wish to add WSDL to and click the SERVICES tab.

  2. Click ADD WSDL, enter the WSDL address in the dialog that opens and click ADD. Once the window is closed, the WSDL and the information about the services it contains are added to the client. By default, the WSDL is added in disabled state (see 6.3).

To see a list of services contained in the WSDL

6.1.2 REST

After a new REST service is added, the security server displays text "REST" and url for that service.

To add a REST service, follow these steps.

  1. Navigate to CLIENTS tab, click the name of the client for which you wish to add REST service to and click the SERVICES tab.

  2. Click ADD REST. Select whether the URL type is "REST API Base Path" or "OpenAPI 3 Description". Enter the url and service code in the window that opens and click ADD.

  3. Once the window is closed, the url and the service code are added to the service list. If the added URL type was OpenAPI 3 description, the service description is parsed and endpoints are added under the service. By default, the REST service is added in disabled state (see 6.3).

To see the service details under the REST service

6.2 Refreshing a service description

Access rights: Service Administrator

Upon refreshing, the security server reloads the service description file from the service description URL to the security server and checks the service information in the reloaded file against existing services. If the composition of services in the new service description has changed compared to the current version, a warning is displayed and you can either continue with the refresh or cancel.

To refresh the service description, follow these steps.

  1. Navigate to CLIENTS tab, click the name of the client containing service you wish to refresh and click the SERVICES tab.

  2. Click the arrow symbol in front of the WSDL or REST to be refreshed and click the Refresh button.

  3. If the new service description contains changes compared to the current service description in the security server, a warning is displayed. To proceed with the refresh, click CONTINUE.

When the service description is refreshed, the existing services' settings are not overwritten.

6.3 Enabling and Disabling a service description

Access rights: Service Administrator

A disabled service description is displayed in the services' list with a disabled switch icon on the same row.

Services described by a disabled service description cannot be accessed by the service clients – if an attempt is made to access the service, an error message is returned, containing the information entered by the security server's administrator when the service description was disabled.

If a service description is enabled, the services described there become accessible to users. Therefore it is necessary to ensure that before enabling the service description, the parameters of all its services are correctly configured (see 6.6).

To enable or disable a service description, follow these steps.

  1. Navigate to CLIENTS tab, click the name of the client containing service you wish to view and click the SERVICES tab.

  2. Click the switch icon on the same row with service WSDL or REST service you wish to enable or disable

(3.) If the service was disabled a popup will appear. In the popup, enter a Disable notice which is shown to clients who try to access any of the services in the service description, and click OK.

6.4 Changing the Address of a service description

Access rights: Service Administrator

To change the service description address, follow these steps.

  1. Navigate to CLIENTS tab, click the name of the client containing service you wish to view and click the SERVICES tab.

  2. Click the link text containing the type of the service and its url in paranthesis

  3. In the dialog that opens you can edit the URL for all types of services and for REST services the service code can also be changed. Click SAVE. The service information updates accordingly (see section 6.2).

6.5 Deleting a service description

Access rights: Service Administrator

When a service description is deleted, all information related to the services described in the service description, including access rights, are deleted.

To delete a service description, follow these steps.

  1. Navigate to CLIENTS tab, click the name of the client containing service you wish to view and click the SERVICES tab.

  2. Click the link text containing the type of the service and its url in paranthesis.

  3. Click DELETE and confirm the deletion by clicking YES in the dialog that opens.

6.6 Changing the Parameters of a Service

Access rights: Service Administrator

Service parameters are

To change service parameters, follow these steps.

  1. Navigate to CLIENTS tab, click the name of the client containing service you wish to view and click the SERVICES tab.

  2. Click the arrow symbol in front of a REST or WSDL service and in the list that is displayed click the service code which you wish to edit.

  3. In the view that opens, configure the service parameters. To apply the selected parameter to all services described in the same service description, select the checkbox adjacent to this parameter in the Apply to All in WSDL column. To apply the configured parameters, click SAVE.

6.7 Managing REST Endpoints

Access rights: Service Administrator

REST type service descriptions can contain API endpoints. The purpose of the endpoints is more fine-grained access control. More about that in chapter 7 Access Rights.

When URL type of the REST service is an OpenAPI 3 description, endpoints are parsed from the service description automatically. These endpoints cannot be manually updated or deleted. Additionally manual endpoints can be added as needed. When URL type is REST API base path, all the endpoints need to be created manually. Manually created endpoints can also be edited and deleted as needed.

To create API endpoint manually, follow these steps

  1. Navigate to CLIENTS tab, click the name of the client containing service you wish to view and click the SERVICES tab.

  2. Click the arrow symbol in front of a REST service and click the service code that is displayed.

  3. Click the ENDPOINTS tab and in the following view click ADD ENDPOINTS.

  4. In the dialog that opens fill in the HTTP Request method and path for the endpoint and click ADD

7 Access Rights

Access rights can be granted to the following access right subjects.

There are two options for managing access rights in a security server.

It is possible to define access rights on two levels for REST services:

In general, a REST service usually has multiple endpoints. When access rights are defined on the service level, they apply to all the endpoints of the REST service. Instead, defining access rights on the endpoint level gives access to specific endpoint(s) only. The service level access rights support both service-based and service client-based access rights management. The endpoint level access rights support only service based access rights management.

7.1 Changing the Access Rights of a Service

Access rights: Service Administrator

To change the access rights to a service, follow these steps.

  1. Navigate to CLIENTS tab, click the name of the client containing service you wish to view and click the SERVICES tab.

  2. Click the arrow symbol in front of a service and click the service code that is displayed.

  3. In the window that opens, the access rights table displays information about all X-Road subsystems and groups that have access to the selected service.

  4. To add one or more access right subjects to the service, click ADD SUBJECTS. The subject search window appears. You can search among all subsystems and global groups registered in the X-Road governing authority and among the security server client's local groups. Fill in optional filters for subjects and click SEARCH. Select one or more subjects from the list and click ADD SELECTED.

  5. To remove service access rights subjects, click Remove button on the respective row in the access rights table. To clear the access rights list (that is, remove all subjects), click REMOVE ALL.

To change access rights to an endpoint, follow there steps.

  1. Navigate to CLIENTS tab, click the name of the client containing service you wish to view and click the SERVICES tab.

  2. Click the arrow symbol in front of a REST service and click the service code that is displayed.

  3. Click the ENDPOINTS tab and in the following views endpoints list click Access Rights on the respective row of an endpoint.

  4. To add one or more access right subjects to the endpoint, click ADD SUBJECTS. The subject search window appears. You can search among all subsystems and global groups registered in the X-Road governing authority and among the security server client's local groups. Fill in optional filters for subjects and click SEARCH. Select one or more subjects from the list and click ADD SELECTED.

  5. To remove endpoint access rights subjects, click Remove button on the respective row in the access rights table and click YES in the confirmation dialog. To clear the access rights list (that is, remove all subjects), click REMOVE ALL and click YES in the confirmation dialog.

7.2 Adding a Service Client

Access rights: Service Administrator

The service client view (CLIENTS -> SERVICE CLIENTS) displays all the service level access rights subjects of the services mediated by this security server client. In other words, if an X-Road subsystem or group has been granted a service level access right to a service of this client, then the subject is shown in this view. Subjects that have been granted an endpoint level access right to a REST service, are not shown in the view.

To add a service client, follow these steps.

  1. Navigate to CLIENTS tab, click the name of the client containing service you wish to view and click the SERVICE CLIENTS tab.

  2. Click ADD SUBJECT. In the following wizard that opens

    1. Select a subject (a subsystem, or a local or global group) to which you want to grant access rights to and click NEXT

    2. Select service(s) whose access rights you want to grant to the selected subject. Click ADD SELECTED to grant access rights to the selected services to this subject. Note that access rights to REST API endpoints can not be added using this view, those need to be added on SERVICES tab as described in 7.1.

The subject is added to the list of service clients, after which the service clients view is displayed.

7.3 Changing the Access Rights of a Service Client

Access rights: Service Administrator

To change the service client's access rights, follow these steps.

  1. Navigate to CLIENTS tab, click the name of the client containing service you wish to view and click the SERVICE CLIENTS tab.

  2. In the view that opens click the name of a subject (a subsystem, or a local or global group) whose access rights you want to change

  3. In the window that opens, a list of services opened in the security server to the selected subject is displayed.

    • To add access rights to a service client, start by clicking ADD SERVICE. In the window that opens, select the service(s) that you wish to grant to the subject and click ADD. Note that access rights to REST API endpoints can not be added using this view, those need to be added on SERVICES tab as described in 7.1.

    • To remove a single access right to a service from the service client click Remove button on the corresponding row and click YES in the confirmation dialog.

    • To remove all access rights to a service from the service client click REMOVE ALL and click YES in the confirmation dialog.

    • Removing service level access rights from the service client also removes all REST API endpoint level access rights to the endpoints of the service. In other words, removing access rights from the service client removes all access rights to a service and its endpoints.

8 Local Access Right Groups

A local access rights group can be created for a security server client in order to facilitate the management of service access rights for a group of X-Road subsystems that use the same services. The access rights granted for a group apply for all the members of the group. Local groups are client-based, that is, a local group can only be used to manage the service access rights of one security server client in one security server.

8.1 Adding a Local Group

Access rights: Service Administrator

To create a local group for a security server client, follow these steps.

  1. Navigate to CLIENTS tab, click the name of the client and click the LOCAL GROUPS tab. In the view that opens, a list of the client's local groups is displayed.

  2. To create a new group, click ADD GROUP. In the view that opens, enter the code and description for the new group and click ADD.

8.2 Displaying and Changing the Members of a Local Group

Access rights: Service Administrator

To view the members of a local group, follow these steps.

  1. Navigate to CLIENTS tab, click the name of the client and click the LOCAL GROUPS tab.

  2. In the view that opens click the code of the group you wish to edit.

To add one or more members to a local group, follow these steps in the group's detail view.

  1. Click ADD MEMBERS.

  2. In the window that opens add optional filters to your members search and click SEARCH. Select the subsystems that you wish to add to the group and click ADD SELECTED.

To remove members from a local group, click Remove on the corresponding row on group you wish to be deleted in the group's detail view and then click YES in the confirmation dialog. To remove all group members from the group, click REMOVE ALL and then click YES in the confirmation dialog.

8.3 Changing the description of a Local Group

Access rights: Service Administrator

To change the description of a local group, follow these steps.

  1. Navigate to CLIENTS tab, click the name of the client and click the LOCAL GROUPS tab.

  2. In the view that opens click the code of the group you wish to edit.

  3. In the group´s detail view change the description. The description is saved when the input field loses focus.

8.4 Deleting a Local Group

Access rights: Service Administrator

Warning: When a local group is deleted, all the group members' access rights, which were granted through belonging to the group, are revoked.

To delete a local group, follow these steps.

  1. Navigate to CLIENTS tab, click the name of the client and click the LOCAL GROUPS tab.

  2. In the view that opens click the code of the group you wish to delete.

  3. In the group detail view, click DELETE and confirm the deletion by clicking YES in the dialog that opens.

9 Communication with the Client Information Systems

Access rights: Registration Officer, Service Administrator

A security server can use either the HTTP, HTTPS, or HTTPS NOAUTH protocol to communicate with information system servers which provide and use services.

Note: If the HTTP connection method is selected, but the information system connects to the security server over HTTPS, then the connection is accepted, but the client's internal TLS certificate is not verified (same behavior as with HTTPS NOAUTH).

By default the connection type for all the security server clients is set to HTTPS to prevent unauthorised use of the clients.

It is strongly recommended to keep the connection type of the security server owner as HTTPS to prevent security server clients from making operational monitoring data requests as a security server owner.

To set the connection method for internal network servers in the service consumer role, follow these steps.

  1. In the Navigation tabs, select CLIENTS, select a security server owner or a client from the table

  2. In the view that opens, select the INTERNAL SERVERS tab

  3. On the Connection type drop-down, select the connection method. The changes will be saved immediately on selecting the new method and a "Connection type updated" message is displayed.

Depending on the configured connection method, the request URL for information system is http://SECURITYSERVER/ or https://SECURITYSERVER/. When making the request, the address SECURITYSERVER must be replaced with the actual address of the security server.

The connection method for internal network servers in the service provider role is determined by the protocol in the URL. To change the connection method, follow these steps.

  1. In the Navigation tabs, select CLIENTS, select a security server owner or a client from the table

  2. In the view that opens, select the SERVICES tab

  3. Click the caret next to the desired service description to show all services related to it

  4. Click on a service code in the table.

  5. In the view that opens, change the protocol in the service URL to HTTP, HTTPS or HTTPS NO AUTH. If the HTTPS protocol was selected, select the Verify TLS certificate checkbox if needed (see section 6.6). According to the service parameters, the connection with the internal network server is created using one the following protocols:

To add an internal TLS certificate for a security server owner or security server client (for HTTPS connections), follow these steps.

  1. In the Navigation tabs, select CLIENTS, select a security server owner or a client from the table

  2. In the view that opens, select the INTERNAL SERVERS tab

  3. To add a certificate, click ADD in the Information System TLS certificate section, select a certificate file from the local file system and click OK. The certificate fingerprint appears in the "Information System TLS certificate" table.

To display the detailed information of an internal TLS certificate, follow these steps.

  1. In the Navigation tabs, select CLIENTS, select a security server owner or a client from the table

  2. In the view that opens, select the INTERNAL SERVERS tab

  3. Click on a certificate in the "Information System TLS certificate".

To delete an internal TLS certificate, follow these steps.

  1. In the Navigation tabs, select CLIENTS, select a security server owner or a client from the table

  2. In the view that opens, select the INTERNAL SERVERS tab

  3. Click on a certificate in the "Information System TLS certificate".

  4. In the Certificate view that opens, click DELETE. Confirm deletion by clicking YES.

To export the security server's internal TLS certificate, follow these steps.

  1. In the Navigation tabs, select CLIENTS, select a security server owner or a client from the table

  2. In the view that opens, select the INTERNAL SERVERS tab

  3. Click Export at the end of a certificate row in the "Security Server certificate" table and save the prompted file to the local file system.

10 System Parameters

The security server system parameters are:

10.1 Managing the Configuration Anchor

Access rights

To upload the configuration anchor, follow these steps.

  1. In the Navigation tabs, select SETTINGS.

  2. In the opening view select SYSTEM PARAMETERS tab.

  3. In the Configuration Anchor section, click UPLOAD.

  4. Find the anchor file from the local file system and click Open.

  5. Ensure that the anchor file you are uploading is valid by comparing the hash value of the uploaded file with the hash value of the currently valid anchor published by the X-Road governing authority. If the hash values match, confirm the upload by clicking CONFIRM.

To download the configuration anchor, follow these steps.

  1. In the Navigation tabs, select SETTINGS.

  2. In the opening view select SYSTEM PARAMETERS tab.

  3. On the Configuration Anchor section, click DOWNLOAD and save the prompted file.

10.2 Managing the Timestamping Services

Access rights: Security Officer

To add a timestamping service, follow these steps.

  1. In the Navigation tabs, select SETTINGS.

  2. In the opening view select SYSTEM PARAMETERS tab.

  3. In the Timestamping Services section, click ADD.

  4. In the dialog that opens, select a service and click ADD.

To delete a timestamping service, follow these steps.

  1. In the Navigation tabs, select SETTINGS.

  2. In the opening view select SYSTEM PARAMETERS tab.

  3. In the Timestamping Services section, click DELETE at the end of the row of the service you wish to delete.

Note: If more than one timestamping service is configured, the security server will try to get a timestamp from the topmost service in the table, moving down to the next service if the try was unsuccessful. The failover covers both connection and timestamp response verification issues. For example, security server is not able to establish a connection to a timestamping service because of a misconfigured firewall, or verification of a timestamp response fails because of the sign certificate of the timestamping service is changed.

10.3 Changing the Internal TLS Key and Certificate

Access rights: Security Officer, System Administrator

To change the security server's internal TLS key and certificate, follow these steps.

  1. On the Navigation tabs, select Keys and Certificates

  2. In the opening view, select SECURITY SERVER TLS KEY tab

  3. In the opening view, click GENERATE KEY and in the dialog that opens, click CONFIRM.

    The security server generates a key used for communication with the client information systems, and the corresponding self-signed certificate. The security server's certificate fingerprint will also change. The security server's domain name is saved to the certificate's Common Name field, and the internal IP address to the subjectAltName extension field.

To generate a new certificate request, follow these steps.

  1. On the Navigation tabs, select KEYS AND CERTIFICATES

  2. In the opening view, select SECURITY SERVER TLS KEY tab

  3. In the "TLS Key and Certificate" section, at the end of the key row, click Generate CSR

  4. In the opening view, input the Distinguished Name and click GENERATE CSR. Save the certificate request file to the local file system and click DONE.

    The security server generates a certificate request using the current key and the provided Distinguished Name.

To import a new TLS certificate, follow these steps.

  1. On the Navigation tabs, select KEYS AND CERTIFICATES

  2. In the opening view, select SECURITY SERVER TLS KEY tab

  3. In the opening view, click IMPORT CERT. and point to the file to be imported.

    The imported certificate must be in PEM-format to be accepted. Certificate chains are supported; concatenate possible intermediate certificate(s) to the server certificate before importing the file.

    Note that the Internal TLS Key and Certificate are cached by default for 60 seconds (default cache period for serverconf) so generating a new key and importing a new certificate might affect providing services from the security server for the caching period. The caching period can be changed with System Parameters [UG-SYSPAR]

To export the security server's internal TLS certificate, follow these steps.

  1. On the Navigation tabs, select KEYS AND CERTIFICATES

  2. In the opening view, select SECURITY SERVER TLS KEY tab

  3. In the opening view, click EXPORT CERT. and save the prompted file to the local file system.

    Note that only the internal server certificate is exported, not the possible intermediate certificates.

To view the detailed information of the security server's internal TLS certificate, follow these steps.

  1. On the Navigation tabs, select Keys and Certificates

  2. In the opening view, select SECURITY SERVER TLS KEY tab

  3. In the "TLS Key and Certificate" section, click on the certificate hash.

10.4 Approved Certificate Authorities

To list the approved certificate authorities, follow these steps.

  1. In the Navigation tabs, select SETTINGS.

  2. In the opening view select SYSTEM PARAMETERS tab. Approved certificate authorities are listed in the "Approved Certificate Authorities" section.

Lists approved certificate authorities. The listing contains the following information:

11 Message Log

The purpose of the message log is to provide means to prove the reception of a regular request or response message to a third party. Messages exchanged between security servers are signed and encrypted. For every regular request and response, the security server produces a complete signed and timestamped document (Associated Signature Container [ASiC]).

Message log data is stored to the database of the security server during message exchange. According to the configuration (see 11.1), the timestamping of the signatures of the exchanged messages is either synchronous to the message exchange process or is done asynchronously using the time period set by the X-Road governing agency.

In case of synchronous timestamping, the timestamping is an integral part of the message exchange process (one timestamp is taken for the request and another for the response). If the timestamping fails, the message exchange fails as well and the security server responds with an error message.

In case of asynchronous timestamping, all the messages (maximum limit is determined in the configuration, see 11.1) stored in the message log since the last periodical timestamping event are timestamped with a single (batch) timestamp. By default, the security server uses asynchronous timestamping for better performance and availability.

The security server periodically composes signed (and timestamped) documents from the message log data and archives them in the local file system. Archive files are ZIP containers containing one or more signed documents and a special linking information file for additional integrity verification purpose.

11.1 Changing the Configuration of the Message Log

Configuration parameters are defined in INI files [INI], where each section contains the parameters for a particular security server component. The default message log configuration is located in the file

/etc/xroad/conf.d/addons/message-log.ini

In order to override default values, create or edit the file

/etc/xroad/conf.d/local.ini

Create the [message-log] section (if not present) in the file. Below the start of the section, list the values of the parameters, one per line.

For example, to configure the parameters archive-path and archive-max-filesize, the following lines must be added to the configuration file:

[message-log]
archive-path=/my/arhcive/path/
archive-max-filesize=67108864

11.1.1 Common parameters

  1. hash-algo-id – the hash algorithm that is used for hashing in the message log. Possible choices are SHA-256, SHA-384, SHA-512. Defaults to SHA-512.

11.1.2 Timestamping parameters

  1. timestamp-immediately – if set to true, the timestamps are created synchronously with the message exchange, i.e., one timestamp is created for a request and another for a response. This is a security policy to guarantee the timestamp at the time of logging the message, but if the timestamping fails, the message exchange fails as well, and if load to the security server increases, then the load to the timestamping service increases as well. The value of this parameter defaults to false for better performance and availability. In case the value of the parameter is false then the timestamping is performed as a periodic background process (the time period is determined in the X-Road governing agency and propagated to the security servers by global configuration) and signatures stored during the time period (see parameter timestamp-records-limit) are timestamped in one batch.

  2. timestamp-records-limit – maximum number of signed messages that can be timestamped in one batch. The message exchanging load (messages per minute) and the timestamping interval of the security server must be taken into account when changing the default value of this parameter. Do not modify this parameter without a good reason. Defaults to 10000.

  3. acceptable-timestamp-failure-period – time period in seconds, for how long the asynchronous timestamping is allowed to fail before message exchange between security servers is stopped. Set to 0 to disable this check. Defaults to 14400.

11.1.3 Archiving parameters

  1. keep-records-for – time in days for which to keep timestamped and archived records in the database. Defaults to 30.

  2. archive-max-filesize – maximum size for archived files in bytes. Reaching the maximum value triggers the file rotation. Defaults to 33554432 (32 MB).

  3. archive-interval – time interval as Cron expression [CRON] for archiving timestamped records. Defaults to 0 0 0/6 1/1 * ? * (fire every 6 hours).

  4. archive-path – the directory where the timestamped log records are archived. Defaults to /var/lib/xroad/.

  5. clean-interval – time interval as Cron expression [CRON] for cleaning archived records from the database. Defaults to 0 0 0/12 1/1 * ? * (fire every 12 hours).

  6. archive-transfer-command – the command executed after the (periodic) archiving process. This enables one to configure an external script to transfer archive files automatically from the security server. Defaults to no operation.

11.2 Transferring the Archive Files from the Security Server

In order to save hard disk space, it is recommended to transfer archive files periodically from the security server (manually or automatically) to an external location.

Archive files (ZIP containers) are located in the directory specified by the configuration parameter archive-path. File names are in the format mlog-X-Y-Z.zip, where X is the timestamp (UTC time in the format YYYYMMDDHHmmss) of the first message log record, Y is the timestamp of the last message log record (records are processed in chronological order) and Z is 10 characters long alphanumeric random. An example of an archive file name is:

mlog-20150504152559-20150504152559-a7JS05XAJC.zip

The message log package provides a helper script /usr/share/xroad/scripts/archive-http-transporter.sh for transferring archive files. This script uses the HTTP/HTTPS protocol (the POST method, the form name is file) to transfer archive files to an archiving server.

Usage of the script:

Options:  
-d, --dir DIR Archive directory. Defaults to '/var/lib/xroad'
-r, --remove Remove successfully transported files form the archive directory.
-k, --key KEY Private key file name in PEM format (TLS). Defaults to '/etc/xroad/ssl/internal.key'
-c, --cert CERT Client certificate file in PEM format (TLS). Defaults to '/etc/xroad/ssl/internal.crt'
-cacert FILE CA certificate file to verify the peer (TLS). The file may contain multiple CA certificates. The certificate(s) must be in PEM format.
-h, --help This help text.

The archive file has been successfully transferred when the archiving server returns the HTTP status code 200.

Override the configuration parameter archive-transfer-command (create or edit the file etc/xroad/conf.d/local.ini) to set up a transferring script. For example:

[message-log]
archive-transfer-command=/usr/share/xroad/scripts/archive-http-transporter.sh -r http://my-archiving-server/cgi-bin/upload

The message log package contains the CGI script /usr/share/doc/xroad-addon-messagelog/archive-server/demo-upload.pl for a demo archiving server for the purpose of testing or development.

11.3 Using a Remote Database

The message log database can be located outside of the security server. The following guide describes how to configure and populate a remote database schema for the message log. It is assumed that access to the database from the security server has been configured. For detailed information about the configuration of database connections, refer to [JDBC].

  1. Create a database user at remote database host:

    postgres@db_host:~$ createuser -P messagelog_user
    Enter password for new role: <messagelog_password>
    Enter it again: <messagelog_password>
    
  2. Create a database owned by the message log user at remote database host:

    postgres@db_host:~$ createdb messagelog_dbname -O messagelog_user -E UTF-8
    
  3. Verify connectivity from security server to the remote database:

    user@security_server:~$ psql -h db_host -U messagelog_user messagelog_dbname
    Password for user messagelog_user: <messagelog_password>
    psql (9.3.9)
    SSL connection (cipher: DHE-RSA-AES256-GCM-SHA384, bits: 256)
    Type "help" for help.
    messagelog_dbname=>
    
  4. Stop xroad-proxy service for reconfiguration:

    root@security_server:~# service xroad-proxy stop
    
  5. Configure the database connection parameters to achieve encrypted connections, in /etc/xroad/db.properties:

    messagelog.hibernate.jdbc.use_streams_for_binary = true
    messagelog.hibernate.dialect = ee.ria.xroad.common.db.CustomPostgreSQLDialect
    messagelog.hibernate.connection.driver_class = org.postgresql.Driver
    messagelog.hibernate.connection.url = jdbc:postgresql://db_host:5432/messagelog_dbname?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory
    messagelog.hibernate.connection.username = messagelog_user
    messagelog.hibernate.connection.password = messagelog_password
    
  6. Populate database schema by reinstalling messagelog addon package and start xroad-proxy

    Ubuntu: apt-get install --reinstall xroad-addon-messagelog
    RHEL: yum reinstall xroad-addon-messagelog

    service xroad-proxy start

12 Audit Log

The security server keeps an audit log. The audit log events are generated by the user interface when the user changes the system's state or configuration. The user actions are logged regardless of whether the outcome was a success or a failure. The complete list of the audit log events is described in [SPEC-AL].

Actions that change the system state or configuration but are not carried out using the user interface are not logged (for example, X-Road software installation and upgrade, user creation and permission granting, and changing the configuration files).

An audit log record contains correlation-id, which can be used to link the record to other log messages about the same request.

An audit log record also contains

For example, registering a new client in the security server produces the following log record:

2020-06-03T11:00:51+00:00 my-security-server-host correlation-id: [24b47d04dc6e1c49] INFO [X-Road Proxy Admin REST API] 2020-06-03T11:00:51.944Z - {"event":"Register client","user":"admin1","auth":"Session","url":"/api/v1/clients/LXD:GOV:M1:audit-test/register","data":{"clientIdentifier":{"xRoadInstance":"LXD","memberClass":"GOV","memberCode":"M1","subsystemCode":"audit-test","clientStatus":"registration in progress"}}}

The event is present in JSON [JSON] format, in order to ensure machine processability. The field event represents the description of the event, the field user represents the user name of the performer, and the field data represents data related with the event. Field auth represents the authentication type, and url represents the API url. The failed action event record contains additional fields reason for the error message, and boolean warning to document whether failure was due to an unhandled warning. For example:

2020-06-03T10:57:46+00:00 my-security-server-host correlation-id: [49458d51a0bbe9ed] INFO [X-Road Proxy Admin REST API] 2020-06-03T10:57:46.417Z - {"event":"Log in to token failed","user":"admin1","reason":"org.niis.xroad.restapi.service.TokenService$PinIncorrectException: Signer.PinIncorrect: PIN incorrect","warning":false,"auth":"Session","url":"/api/v1/tokens/0/login","data":{"tokenId":"0","tokenSerialNumber":null,"tokenFriendlyName":"softToken-0"}}

By default, audit log is located in the file

/var/log/xroad/audit.log

12.1 Changing the Configuration of the Audit Log

The X-Road software writes the audit log to the syslog (rsyslog) using UDP interface (default port is 514). Corresponding configuration is located in the file

/etc/rsyslog.d/90-udp.conf

The audit log records are written with level INFO and facility LOCAL0. By default, log records of that level and facility are saved to the X-Road audit log file

/var/log/xroad/audit.log

The default behavior can be changed by editing the rsyslog configuration file

/etc/rsyslog.d/40-xroad.conf

Restart the rsyslog service to apply the changes made to the configuration file

service rsyslog restart

The audit log is rotated monthly by logrotate. To configure the audit log rotation, edit the logrotate configuration file

/etc/logrotate.d/xroad-proxy

12.2 Archiving the Audit Log

In order to save hard disk space and avoid loss of the audit log records during security server crash, it is recommended to archive the audit log files periodically to an external storage or a log server.

The X-Road software does not offer special tools for archiving the audit log. The rsyslog can be configured to redirect the audit log to an external location.

13 Back up and Restore

13.1 Back up and Restore in the User Interface

Access rights: System Administrator

The backup and restore view can be accessed from the Navigation tabs by selecting Back Up and Restore.

To back up configuration, follow these steps.

  1. Navigate to SETTINGS tab and in the view that opens click BACKUP AND RESTORE tab.

  2. Click BACK UP CONFIG.

  3. The configuration backup file appears in the list of configuration backup files.

  4. To save the configuration backup file to the local file system, click DOWNLOAD on the configuration file's row.

To restore configuration, follow these steps.

  1. Click Restore on the appropriate row in the list of configuration backup files and click YES.

  2. A popup notification shows after the restore whether the restoring was successful or not.

If something goes wrong while restoring the configuration it is possible to revert back to the old configuration. Security Server stores so called pre-restore configuration automatically to /var/lib/xroad/conf_prerestore_backup.tar. Either move it to /var/lib/xroad/backup/ folder and utilize the user interface to restore it or use the command line interaface described in the next chapter.

To delete a configuration backup file, click Delete on the appropriate row in the configuration backup file list and then click YES.

To upload a configuration backup file from the local file system to the security server, click UPLOAD BACKUP, select a file and click YES. The uploaded configuration file appears in the list of configuration files.

13.2 Restore from the Command Line

To restore configuration from the command line, the following data must be available:

To find the X-Road ID of the security server, the following command can be used:

tar -tf /var/lib/xroad/backup/<security server conf backup file> | head -1

It is expected that the restore command is run by the xroad user.

In order to restore configuration, the following command should be used:

/usr/share/xroad/scripts/restore_xroad_proxy_configuration.sh \
-s <security server ID> -f <path + filename>

For example (all on one line):

/usr/share/xroad/scripts/restore_xroad_proxy_configuration.sh \
-s AA/GOV/TS1OWNER/TS1 \
–f /var/lib/xroad/backup/conf_backup_20140703-110438.tar

If it is absolutely necessary to restore the system from a backup made on a different security server, the forced mode of the restore command can be used with the –F option. For example (all on one line):

/usr/share/xroad/scripts/restore_xroad_proxy_configuration.sh \
-F –f /var/lib/xroad/backup/conf_backup_20140703-110438.tar

13.3 Automatic Backups

By default the Security Server backs up its configuration automatically once every day. Backups older than 30 days are automatically removed from the server. If needed, the automatic backup policies can be adjusted by editing the /etc/cron.d/xroad-proxy file.

14 Diagnostics

14.1 Examine security server services status information

Access rights: System Administrator

Click on DIAGNOSTICS in the Navigation tabs.

On this page you can examine the statuses of the following services:

Service Status Message Previous Update Next Update
Global configuration Green/yellow/red Status message The time of the global configuration client's last run The estimated time of the global configuration client's next run
Timestamping Green/yellow/red Status message The time of the last timestamping operation Not used
OCSP-responders Green/yellow/red Status message The time of the last contact with the OCSP-responder The latest possible time for the next OCSP-refresh

To refresh the service statuses, refresh the page.

The status colors indicate the following:

The status message offers more detailed information on the current status.

If a section of the diagnostics view appears empty, it means that there either is no configured service available or that checking the service status has failed. If sections are empty, try refreshing the diagnostics view or check the service configuration.

15 Operational Monitoring

Operational monitoring data contains data about request exchange (such as the ID-s of the client and the service, various attributes of the message read from the message header, request and response timestamps, SOAP sizes etc.) of the X-Road security server(s).

The operational monitoring daemon collects and shares operational monitoring data of the X-Road security server(s) as part of request exchange, shares this data, calculates and shares health statistics (the timestamps and number of successful/unsuccessful requests, various metrics of the duration and the SOAP message size of the requests, etc.). The data fields that are stored and shared are described in [PR-OPMON].

The security server caches operational monitoring data in the operational monitoring buffer. One operational data record is created for each request during the message exchange. Security server forwards operational data cached in the operational monitoring buffer to the operational monitoring daemon. Successfully forwarded records are removed from the operational monitoring buffer.

The operational monitoring daemon makes operational and health data available to the owner of the security server, regular clients and the central monitoring client via the security server. Local health data are available for external monitoring systems (e.g. Zabbix) over the JMXMP interface described in [PR-OPMONJMX].

The owner of the security server and the central monitoring client are able to query the records of all clients. For a regular client, only the records associated with that client are available. The internal IP of the security server is included in the response only for the owner of the security server and central monitoring client.

NOTE: All the commands in the following sections must be carried out using root permissions.

15.1 Operational Monitoring Buffer

In general, the operational monitoring buffer is an internal component of the security server and thus being not directly used by the end user.

The configuration parameters available for configuring the operational monitoring buffer have been documented in [UG-OPMONSYSPAR].

The default values of the parameters have been chosen to be sufficient under expected average load using the minimum hardware recommended.

All overrides to the default configuration values must be made in the file /etc/xroad/conf.d/local.ini, in the [op-monitor-buffer] section.

15.1.1 Stopping the Collecting of Operational Data

If, for any reason, operational data should not be collected and forwarded to the operational monitoring daemon, the parameter size can be set to 0:

[op-monitor-buffer]
size = 0

After the configuration change, the xroad-proxy service must be restarted:

service xroad-proxy restart

In addition, the operational monitoring daemon should be stopped:

service xroad-opmonitor stop

For the service to stay stopped after reboot the following command should be run:

echo manual > /etc/init/xroad-opmonitor.override

15.2 Operational Monitoring Daemon

The configuration parameters available for configuring the operational monitoring daemon have been documented in [UG-OPMONSYSPAR].

Similarly to the operational monitoring buffer, the default values of the parameters have been chosen to be sufficient under expected average load using the minimum recommended hardware.

All overrides to the default configuration values must be made in the file /etc/xroad/conf.d/local.ini, in the [op-monitor] section.

In the following sections, some parameters are described which may be required to be changed more likely.

15.2.1 Configuring the Health Statistics Period

By default, health statistics are provided for a period of 600 seconds (10 minutes). This means that if no request exchange has taken place for 10 minutes, all the statistical metrics are reset. Please refer to [PR-OPMON] for a detailed overview of the health metrics available.

To change the health statistics period, the value of the parameter health-statistics-period-seconds should be set or edited in the [op-monitor] section of the file /etc/xroad/conf.d/local.ini.

15.2.2 Configuring the Parameters Related to Database Cleanup

Depending on the load and resources of the system, it may be necessary to change the interval of the removal of old database records.

The following parameters must be placed in the [op-monitor] section of the file /etc/xroad/conf.d/local.ini.

The parameter keep-records-for-days should be edited, for instance if the disk fills up before cleanup occurs, or alternatively, if the default period of 7 days is too short. The parameter clean-interval (a Cron expression [CRON]) defines how often the system checks whether cleanup should be done. If the default period of 12 hours is too long or short it should be edited according to your needs.

15.2.3 Configuring the Parameters related to the HTTP Endpoint of the Operational Monitoring Daemon

For configuring the endpoint of the operational monitoring daemon, the following parameters are available in the [op-monitor] section of the configuration:

host – listening host of the daemon (by default the value is set to localhost).

port – listening port (by default the value is set to 2080).

scheme – connection type (by default the value is set to HTTP).

If any of these values are changed, both the proxy and the operational monitoring daemon services must be restarted:

service xroad-proxy restart
service xroad-opmonitor restart

15.2.4 Installing an External Operational Monitoring Daemon

Technically, the operational monitoring daemon can be installed on a separate host from the security server. It is possible to configure several security servers to use that external operational monitoring daemon, but this setup is correct only if the security servers are identical clones installed behind a load balancer.

NOTE: The setup of clustered security servers is not officially supported yet and has been implemented for future compatibility.

NOTE: It is strongly advised to use HTTPS for requests between a security server and the associated external operational monitoring daemon.

For running a separate operational monitoring daemon, the xroad-opmonitor package must be installed. Please refer to [IG-SS] for general instructions on obtaining X-Road packages.

As a result of installation, the following services will be running:

xroad-confclient
xroad-signer
xroad-opmonitor

15.2.5 Configuring an External Operational Monitoring Daemon and the Corresponding Security Server

To make a security server communicate with an external operational monitoring daemon, it is necessary to configure both the daemon and the security server.

By default, the operational monitoring daemon listens on localhost. To make the daemon available to security servers on other hosts, the listening address must be set to the IP address that is relevant in the particular network, as described in the previous section.

As advised, the scheme parameter should be set to "https". For communication over HTTPS, the security server and the operational monitoring daemon must know each other's TLS certificates to enable the security server to authenticate to the monitoring daemon successfully.

NOTE: If an external operational monitoring daemon is used, the host, scheme (and optionally, port) parameters must be changed at both hosts.

The internal TLS certificate of the security server is used for authenticating the security server to the operational monitoring daemon. This certificate has been generated beforehand, during the installation process of the security server, and is available in PEM format in the file /etc/xroad/ssl/internal.crt. Please refer to Section 10.3 for the instructions on exporting the internal TLS certificate from UI. The file must be copied to the host running the operational monitoring daemon. The system user xroad must have permissions to read this file.

In the configuration of the external daemon, the corresponding path must be set in /etc/xroad/conf.d/local.ini:

[op-monitor]
client-tls-certificate = <path/to/security/server/internal/cert>

Next, a TLS key and the corresponding certificate must be generated on the host of the external monitoring daemon as well, using the command

generate-opmonitor-certificate

The script will prompt you for standard fields for input to TLS certificates and its output (key files and the certificate) will be generated to the directory /etc/xroad/ssl.

The generated certificate, in the file opmonitor.crt, must be copied to the corresponding security server. The system user xroad must have permissions to read this file. Its path at the security server must be written to the configuration (note the name of the section, although it is the proxy service that will read the configuration):

[op-monitor]
tls-certificate = <path/to/external/daemon/tls/cert>

For the external operational daemon to be used, the proxy service at the security server must be restarted:

service xroad-proxy restart

In addition, on the host running the corresponding security server, the operational monitoring daemon must be stopped:

service xroad-opmonitor stop

For the service to stay stopped after reboot the following command should be run:

echo manual > /etc/init/xroad-opmonitor.override

The configuration anchor (renamed as configuration-anchor.xml) file must be manually copied into the directory /etc/xroad of the external monitoring daemon in order for configuration client to be able to download the global configuration (by default configuration download interval is 60 seconds). The system user xroad must have permissions to read this file.

15.2.6 Monitoring Health Data over JMXMP

The operational monitoring daemon makes health data available over the JMXMP protocol. The Zabbix monitoring software can be configured to gather that data periodically, using its built in JMX interface type.

By default, the operational monitoring daemon JMXMP is disabled. JMXMP must be enabled for external tools such as Zabbix to be able to access the data. Please refer to the documentation at [JMX] for instructions on configuring access to the JMX interface of the operational monitoring daemon.

For Zabbix to be able to gather data over JMX, the Zabbix Java gateway must be installed. See [ZABBIX-GATEWAY] for instructions.

The JMX interface must be configured to each host item in Zabbix, for which health data needs to be obtained. See [ZABBIX-JMX] for instructions.

Please refer to [PR-OPMONJMX] for a specification of the names and attributes of the JMX objects exposed by the operational monitoring daemon.

The xroad-opmonitor package comes with sample host data that can be imported to Zabbix, containing a JMX interface, applications related to sample services and health data items under these services. Also, a script is provided for importing health data related applications and items to several hosts using the Zabbix API. Please find the example files in the directory /usr/share/doc/xroad-opmonitor/examples/zabbix/. Please refer to [ZABBIX-API] for information on the Zabbix API.

16 Environmental Monitoring

Environmental monitoring provides details of the security servers such as operating system, memory, disk space, CPU load, running processes and installed packages, etc.

16.1 Usage via SOAP API

Environmental monitoring provides SOAP API via X-Road message protocol extension. SOAP messages are described in [PR-ENVMONMES].

Monitoring extension schema is defined in [MONITORING_XSD].

16.2 Usage via JMX API

Environmental monitoring provides also a standard JMX endpoint which can be accessed with any JMX client (for example Java's jconsole application). See [ARC-ENVMON] for details.

JMX is disabled on default. JMX is enabled by adding standard JMX-related options to the executable java process as in example by [ZABBIX-JMX].

16.3 Limiting environmental monitoring remote data set

It is possibility to limit what allowed non-owners can request via environmental monotiring data request by changing monitor-env limit-remote-data-set parameter. By changing flag to be true non-owners who are allowed to query environmental monitoring data will get only certificate, operating system and xroad version information. This parameters is set by default false. Security server owner will always get full data set as requested.

17 Logs and System Services

To read logs, a user must have root user's rights or belong to the xroad and/or adm system group.

17.1 System Services

The most important system services of a security server are as follows.

Service Purpose Log
xroad-confclient Client process for the global configuration distributor /var/log/xroad/configuration_client.log
xroad-proxy Message exchanger /var/log/xroad/proxy.log
xroad-signer Manager process for key settings /var/log/xroad/signer.log
xroad-proxy-ui-api Management UI and REST API /var/log/xroad/proxy_ui_api.log and
/var/log/xroad/proxy_ui_api_access.log

System services are managed through the systemd facility.

To start a service, issue the following command as a root user:

service <service> start

To stop a service, enter:

service <service> stop

Services use the default unit start rate limits. An exception to this is xroad-proxy-ui-api, which uses a longer start rate limit (5 starts / 40 seconds) to prevent infinite restart-loop in some specific error situations.

17.2 Logging configuration

For logging, the Logback system is used. Logback configuration files are stored in the directory /etc/xroad/conf.d/.

Default settings for logging are the following:

17.3 Fault Detail UUID

In case a security server encounters an error condition during the message exchange, the security server returns a SOAP Fault message [PR-MESS] containing a UUID (a universally unique identifier, e.g. 1328e974-4fe5-412c-a4c4-f1ac36f20b14) as the fault detail to the service client's information system. The UUID can be used to find the details of the occurred error from the xroad-proxy log.

18 Federation

Federation allows security servers of two different X-Road instances to exchange messages with each other. The instances are federated at the central server level. After this, security servers can be configured to opt-in to the federation. By default, federation is disabled and configuration data for other X-Road instances will not be downloaded.

The federation can be allowed for all X-Road instances that the central server offers, or a list of specific (comma-separated) instances. The default is to allow none. The values are case-insensitive.

To override the default value, edit the file /etc/xroad/conf.d/local.ini and add or change the value of the system parameter allowed-federations for the server component configuration-client. To restore the default, either remove the system parameter entirely or set the value to none. X-Road services xroad-confclient and xroad-proxy need to be restarted (in that order) for any setting changes to take effect.

Below are some examples for /etc/xroad/conf.d/local.ini.

To allow federation with all offered X-Road instances:

[configuration-client]
allowed-federations=all

To allow federation with specific instances xe-test and ee-test:

[configuration-client]
allowed-federations=xe-test,ee-test

To disable federation, just remove the allowed-federations system parameter entirely or use:

[configuration-client]
allowed-federations=none

Please note that if the keyword all is present in the comma-separated list, it will override the single allowed instances. The keyword none will override all other values. This means that the following setting will allow all federations:

[configuration-client]
allowed-federations=xe-test, all, ee-test

And the following will allow none:

[configuration-client]
allowed-federations=xe-test, all, none, ee-test

19 Management REST API

Security server has a REST API that can be used to do all the same server configuration operations that can be done using the web UI.

Management REST API is protected with an API key based authentication. To execute REST calls, API keys need to be created.

REST API is protected by TLS. Since server uses self signed certificate, the caller needs to accept this (for example with curl you might use --insecure or -k option).

Requests sent to REST API have a limit for maximum size. If a too large request is sent to REST API, it will not be processed, and http status 413 Payload too large will be returned. There is a different limit for binary file uploads, and for other requests.

Limits are

REST API is also rate limited. Rate limits apply per each calling IP. If the number of calls from one IP address exceeds the limit, endpoints return http status 429 Too Many Requests.

Limits are

If the default limits are too restricting (or too loose), they can be overridden with command line arguments. Limits are set with application properties

Size limit parameters support formats from Formats from DataSize, for example 5MB.

Command line arguments can be modified using configuration file local.conf. Example from /etc/xroad/services/local.conf with modifications:

PROXY_UI_API_PARAMS=" $PROXY_UI_API_PARAMS -Dratelimit.requests.per.second=100"
PROXY_UI_API_PARAMS=" $PROXY_UI_API_PARAMS -Drequest.sizelimit.binary.upload=1MB"

19.1 API key management operations

Access rights: System Administrator

An API key is linked to a role or roles, and grants access to the operations that are allowed for that role/roles. Separate REST endpoints exist for API key management. API key management endpoints are authenticated to with HTTP basic authentication (username and password) or with session authentication (for admin web application). Basic authentication access is limited to localhost by default, but this can be changed using System Parameters [UG-SYSPAR].

19.1.1 Creating new API keys

A new API key is created with a POST request to /api/v1/api-keys. Message body must contain the roles to be associated with the key. Server responds with data that contains the actual API key. After this point the key cannot be retrieved, as it is not stored in plaintext.

curl -X POST -u <user>:<password> https://localhost:4000/api/v1/api-keys --data '["XROAD_SECURITYSERVER_OBSERVER","XROAD_REGISTRATION_OFFICER"]' --header "Content-Type: application/json" -k
{
  "roles": [
    "XROAD_REGISTRATION_OFFICER",
    "XROAD_SECURITYSERVER_OBSERVER"
  ],
  "id": 61,
  "key": "23bc57cd-b1ba-4702-9657-8d53e335c843"
}

In this example the created key was 23bc57cd-b1ba-4702-9657-8d53e335c843.

19.1.2 Listing API keys

Existing API keys can be listed with a GET request to /api/v1/api-keys. This lists all keys, regardless of who has created them.

curl -X GET -u <user>:<password> https://localhost:4000/api/v1/api-keys -k
[
  {
    "id": 59,
    "roles": [
      "XROAD_REGISTRATION_OFFICER",
      "XROAD_SECURITYSERVER_OBSERVER",
      "XROAD_SERVICE_ADMINISTRATOR"
    ]
  },
  {
    "id": 60,
...

You can also retrieve a single API key with a GET request to /api/v1/api-keys/{id}.

curl -X GET -u <user>:<password> https://localhost:4000/api/v1/api-keys/59 -k
{
  "id": 59,
  "roles": [
    "XROAD_REGISTRATION_OFFICER",
    "XROAD_SECURITYSERVER_OBSERVER",
    "XROAD_SERVICE_ADMINISTRATOR"
  ]
}

19.1.3 Updating API keys

An existing API key is updated with a PUT request to /api/v1/api-keys/{id}. Message body must contain the roles to be associated with the key. Server responds with data that contains the key id and roles associated with the key.

curl -X PUT -u <user>:<password> https://localhost:4000/api/v1/api-keys/60 --data '["XROAD_SECURITYSERVER_OBSERVER","XROAD_REGISTRATION_OFFICER"]' --header "Content-Type: application/json" -k
{
  "id": 60,
  "roles": [
    "XROAD_REGISTRATION_OFFICER",
    "XROAD_SECURITYSERVER_OBSERVER"
  ]
}

19.1.4 Revoking API keys

An API key can be revoked with a DELETE request to /api/v1/api-keys/{id}. Server responds with HTTP 200 if revocation was successful and HTTP 404 if key did not exist.

curl -X DELETE -u <user>:<password> https://localhost:4000/api/v1/api-keys/60  -k

19.1.5 API key caching

API keys are cached in memory. In typical security server configurations this does not create problems. However, if you have configured a setup where multiple security servers share the same serverconf database, and use multiple nodes to access REST API and execute API key management operations, the caches of different nodes can become out of sync.

For example, you may revoke an API key from node 1 but node 2 is not aware of this, and still grants access to REST API endpoints with this API key.

If you operate such a configuration, you need to target all REST API operations to the same security server node, or otherwise ensure that caching will not create problems (for example, always restart REST API modules when API key operations are executed).

19.2 Executing REST calls

Access rights: Depends on the API.

Once a valid API key has been created, it is used by providing an Authorization: X-Road-ApiKey token=<api key> HTTP header in the REST calls. For example

curl --header "Authorization: X-Road-ApiKey token=ff6f55a8-cc63-4e83-aa4c-55f99dc77bbf" "https://localhost:4000/api/v1/clients" -k
[
  {
    "id": "XRD2:GOV:999:foobar",
    "member_name": Foo Name,
    "member_class": "GOV",
    "member_code": "999",
    "subsystem_code": "SUBS_1",
    "status": "saved
...

The available APIs are documented in OpenAPI specification [REST_UI-API]. Access rights for different APIs follow the same rules as the corresponding UI operations. Access to regular APIs is allowed from all IP addresses by default, but this can be changed using System Parameters [UG-SYSPAR].

19.3 Correlation ID HTTP header

The REST API endpoints return an x-road-ui-correlation-id HTTP header. This header is also logged in proxy_ui_api.log, so it can be used to find the log messages related to a specific API call.

The correlation ID header is returned for all requests, both successful and failed ones.

For example, these log messages are related to an API call with correlation ID 3d5f193102435242:

2019-08-26 13:16:23,611 [https-jsse-nio-4000-exec-10] correlation-id:[3d5f193102435242] DEBUG o.s.s.w.c.HttpSessionSecurityContextRepository - The HttpSession is currently null, and the HttpSessionSecurityContextRepository is prohibited from creating an HttpSession (because the allowSessionCreation property is false) - SecurityContext thus not stored for next request
2019-08-26 13:16:23,611 [https-jsse-nio-4000-exec-10] correlation-id:[3d5f193102435242] WARN  o.s.w.s.m.m.a.ExceptionHandlerExceptionResolver - Resolved [org.niis.xroad.restapi.exceptions.ConflictException: local group with code koodi6 already added]
2019-08-26 13:16:23,611 [https-jsse-nio-4000-exec-10] correlation-id:[3d5f193102435242] DEBUG o.s.s.w.a.ExceptionTranslationFilter - Chain processed normally

19.4 Validation errors

An error response from the REST API can include validation errors if an unsupported parameter was provided with the request. When

Example request and response of adding a new subsystem with illegal characters:

POST https://ss1:4100/api/v1/clients

Request body:
{
  "client": {
    "member_class": "ORG",
    "member_code": "0/1234",
    "subsystem_code": "Subsystem%Code"
  },
  "ignore_warnings": false
}

Response body:
{
  "error": {
    "code": "validation_failure",
    "validation_errors": {
      "clientAdd.client.memberCode": [
        "NoForwardslashes"
      ],
      "clientAdd.client.subsystemCode": [
        "NoPercents"
      ]
    }
  },
  "status": 400
}

In addition to the validation messages declared in Java Validation API, the following validation errors are possible:

Error Explanation
NoControlChars The provided string contains ISO control characters or zero-width spaces
NoColons The provided string contains colons :
NoSemicolons The provided string contains semicolons ;
NoForwardslashes The provided string contains slashes /
NoBackslashes The provided string contains backslashes \
NoPercents The provided string contains percent symbol %

19.5 Warning responses

Error response from the Management API can include additional warnings that you can ignore if seen necessary. The warnings can be ignored by your decision, by executing the same operation with ignore_warnings boolean parameter set to true. Always consider the warning before making the decision to ignore it.

An example case:

  1. Client executes a REST request, without ignore_warnings parameter, to backend.
  2. Backend notices warnings and responds with error message that contains the warnings. Nothing is updated at this point.
  3. Client determines if warnings can be ignored.
  4. If the warnings can be ignored, client resends the REST request, but with ignore_warnings parameter set to true.
  5. Backend ignores the warnings and executes the operation.

Error response with warnings always contains the error code warnings_detected.

Like errors, warnings contain an identifier (code) and possibly some metadata.

Warning example when trying to register a WSDL that produces non-fatal validation warnings:

{
  "status": 400,
  "error": {
    "code": "warnings_detected"
  },
  "warnings": [
    {
      "code": "wsdl_validation_warnings",
      "metadata": [
        "WSDLValidator Error : Summary: Failures: 0, Warnings: 1 <<< WARNING! Operation 'someService' in PortType: {http://test.x-road.global/some-service}someService.servicePortType has no output message"
      ]
    }
  ]
}

Note that when you are using the admin UI and you encounter warnings, you will always be provided with a popup window with a CONTINUE button in it. When you click the CONTINUE button in the popup, the request is sent again but this time warnings will be ignored.

20 Migrating to Remote Database Host

Since version 6.22.0 Security Server supports using remote databases. In case you have an already running Security Server with local database, it is possible to migrate it to use remote database host instead. The instructions for this process are listed below.

  1. Shutdown X-Road processes.

    systemctl stop "xroad*"
    
  2. Dump the local databases to be migrated. You can find the passwords of users serverconf, messagelog and opmonitor in /etc/xroad/db.properties. Notice that the versions of the local PostgreSQL client and remote PostgreSQL server must match. Also take into account that on a busy system the messagelog database can be quite large and therefore dump and restore can take considerable amount of time and disk space.

    pg_dump -F t -h 127.0.0.1 -p 5432 -U serverconf -f serverconf.dat serverconf
    pg_dump -F t -h 127.0.0.1 -p 5432 -U messagelog -f messagelog.dat messagelog
    pg_dump -F t -h 127.0.0.1 -p 5432 -U opmonitor_admin -f op-monitor.dat op-monitor
    
  3. Shut down and mask local postgresql so it won't start when xroad-proxy starts.

    systemctl stop postgresql
    systemctl mask postgresql
    
  4. Connect to the remote database server as the superuser postgres and create roles, databases and access permissions as follows. Note that the line GRANT serverconf to postgres is AWS RDS specific and not necessary if the postgres user is a true super-user.

    psql -h <remote-db-url> -p <remote-db-port> -U postgres
    CREATE ROLE serverconf LOGIN PASSWORD '<serverconf-password>';
    GRANT serverconf to postgres;
    CREATE DATABASE serverconf OWNER serverconf ENCODING 'UTF-8';
    \c serverconf
    CREATE EXTENSION IF NOT EXISTS hstore;
    \c postgres
    
    CREATE ROLE messagelog LOGIN PASSWORD '<messagelog-password>';
    GRANT messagelog to postgres;
    CREATE DATABASE messagelog OWNER messagelog ENCODING 'UTF-8';
    
    CREATE ROLE opmonitor_admin LOGIN PASSWORD '<opmonitor_admin-password>';
    CREATE ROLE opmonitor LOGIN PASSWORD '<opmonitor-password>';
    GRANT opmonitor_admin to postgres;
    CREATE DATABASE "op-monitor" OWNER opmonitor_admin ENCODING "UTF-8";
    grant usage on schema public to opmonitor;
    
  5. Restore the database dumps on the remote database host.

    pg_restore -h <remote-db-url> -p <remote-db-port> -U serverconf -O -n public -1 -d serverconf serverconf.dat
    pg_restore -h <remote-db-url> -p <remote-db-port> -U messagelog -O -n public -1 -d messagelog messagelog.dat
    pg_restore -h <remote-db-url> -p <remote-db-port> -U opmonitor_admin -O -n public -1 -d op-monitor op-monitor.dat
    
  6. Create properties file /etc/xroad.properties containing the superuser password.

    sudo touch /etc/xroad.properties
    sudo chown root:root /etc/xroad.properties
    sudo chmod 600 /etc/xroad.properties
    
  7. Edit /etc/xroad.properties.

    postgres.connection.password = <postgres-password>
    op-monitor.database.admin_password = <opmonitor_admin-password>
    serverconf.database.initialized = true
    messagelog.database.initialized = true
    op-monitor.database.initialized = true
    
  8. Update /etc/xroad/db.properties contents with correct database host URLs and passwords.

    serverconf.hibernate.connection.url = jdbc:postgresql://<remote-db-url>:<remote-db-port>/serverconf
    messagelog.hibernate.connection.url = jdbc:postgresql://<remote-db-url>:<remote-db-port>/messagelog
    op-monitor.hibernate.connection.url = jdbc:postgresql://<remote-db-url>:<remote-db-port>/op-monitor
    serverconf.hibernate.connection.password = <serverconf-password>
    messagelog.hibernate.connection.password = <messagelog-password>
    op-monitor.hibernate.connection.password = <opmonitor-password>
    
  9. Start again the X-Road services.

    systemctl start "xroad*"