This guide assumes familiarity with Kubernetes and how your Kingdom cluster is configured.
The CreateResource Tool
Resources can be created using theCreateResource command-line tool.
Building the Tool
If you don’t have access to a pre-built version of theCreateResource tool, you can build it using Bazel:
See the Building guide for more information on system requirements.
mTLS Authentication for Resources
Some resources also act as principals for authentication using mutual TLS (mTLS). These resource types include:- DataProvider - Organizations that provide event-level data
- ModelProvider - Organizations that provide ML models
- Duchy - Computation participants in the MPC protocol
Configuration Steps
After creating a resource that uses mTLS authentication, you must complete two additional configuration steps:Update trusted certificate collection
The Kingdom’s trusted certificate collection must include the root certificate for the new resource.If your Kingdom cluster follows the
dev environment configuration:- Locate the
all_root_certs.pemfile in thecerts-and-configsK8s Secret - Add the new root certificate to this file
- Regenerate the Secret
- Update the K8s resource in your Kingdom cluster
This step is also required for Measurement Consumer reporting tools that authenticate with the Kingdom using mTLS.
Update AKID to principal map
Map the client certificate’s Authority Key Identifier (AKID) to the resource name.For Duchy resources:Update the
DuchyCertConfig file:- Located in
duchy_cert_config.textprotoin thecerts-and-configsK8s Secret - Regenerate the secret after updating
- Update the K8s resource in your Kingdom cluster
AuthorityKeyToPrincipalMap file:- Located in
authority_key_identifier_to_principal_map.textprotoin theconfig-filesConfigMap - Update the file within the ConfigMap
- Restart the Kingdom deployments
Configuration File Format
The configuration files use Protocol Buffer text format. Each entry maps an AKID (as bytes) to a principal resource name.Extracting the AKID
Use theopenssl command to extract the Authority Key Identifier from an X.509 certificate:
Example Configuration
The AKID bytes are represented using the\x escape sequence followed by two-digit hex values:
Best Practices
Kubernetes Secrets ManagementWhen updating Secrets and ConfigMaps:
- Make changes to your local configuration files
- Regenerate the K8s resources
- Apply using
kubectl apply - Restart affected deployments if needed