OpenFL Public Key Infrastructure (PKI) Solutions
Overview
Transport Layer Security (TLS) encryption is used for network connections in federated learning. Therefore, security keys and certificates will need to be created for the aggregator and collaborators to negotiate the connection securely.
If you have trusted workspaces and connections, you can start your experiment with the disable_tls
option.
Otherwise, you can certify nodes with your own PKI solution or use the PKI solution workflows provided by OpenFL.
Note
The OpenFL PKI solution is based on step-ca as a server and step as a client utilities. They are downloaded during the workspace setup.
Note
Different certificates can be created for each project workspace.
Manual certificate generation and signing
Step-ca certificate generation and signing
Semi-Automatic PKI Workflow
The OpenFL PKI pipeline involves creating a local certificate authority (CA) on a HTTPS server that listens for signing requests. Certificates from each client are signed by the CA via a token. The token must be copied to clients in a secure manner.
Create the CA.
fx pki install -p </path/to/ca/dir> --ca-url <host:port>
where-p
defines the path to the directory that contains CA files, and--ca-url
defines the host and port that the CA server will listen, if not specified,--ca-url
will be “localhost:9123”When executing this command, you will be prompted for a password and password confirmation. The password will encrypt some CA files. This command will also download step-ca and step binaries.
Run the CA server.
fx pki run -p </path/to/ca/dir>
where-p
defines the path to the directory that contains CA files.Create a token for client.
fx pki get-token -n <subject> --ca-path </path/to/ca/dir> --ca-url <host:port>
where-n
defines the subject name, FQDN for director, collaborator name for envoy, or API name for the API-layer node.--ca-path
defines the path to the directory that contains CA files.--ca-url
defines the host and port that the CA server will listen, if not specified,--ca-url
will be “localhost:9123”Run this command from the CA directory on the CA server. The output is a token which contains a JWT (JSON web token) from the CA server and the CA root certificate concatenated together. This JWT is valid for 24 hours.
Copy the token to the clients (director or envoy) via a secure channel, and certify the token.
cd <path/to/subject/folder> fx pki certify -n <subject> -t <generated token for subject>
where-n
defines the subject name, FQDN for director, collaborator name for envoy, or API name for the API-layer node.-t
defines the output token from the previous command.With this command, the client connects to the CA server over HTTPS, which is provided by the root certificate which was copied together with the JWT. The CA server authenticates the client via the JWT, and the client authenticates the server via the root certificate.
The signed certificate and private key are stored on each node in the federation. The signed certificate is valid for one year. You should certify all nodes that will participate in the federation director, which includes all envoys and API-layer nodes.
Manual PKI Workflow
This solution is embedded into the aggregator-based workflow. See Configure the Federation for details.