Coordinator Client API
Coordinator Client API (0.4.0)
Download OpenAPI specification:Download
The Client API is designed as an HTTP-REST interface. Responses follow the JSend style, though only the response types success and error are returned so far.
Get the currently set manifest.
The endpoint returns a SHA-256 of the currently set manifest. Further, the manifest itself is returned as base64 encoded bytes. Both values do not change when an update has been applied.
Users can retrieve and inspect the manifest through this endpoint before interacting with the application.
Example for verifying the deployed manifest with curl:
curl --cacert marblerun.crt "https://$MARBLERUN/manifest" | jq '.data.ManifestSignature' --raw-output
Responses
Response samples
- 200
- 500
{- "Data": {
- "Manifest": [
- 0
], - "ManifestSignature": "3fff78e99dd9bd801e0a3a22b7f7a24a492302c4d00546d18c7f7ed6e26e95c3"
}, - "Status": "success"
}
Set a manifest.
Before deploying the application to the cluster the manifest needs to be set once by the provider. On success, an array containing key-value mapping for encrypted secrets to be used for recovering the Coordinator in case of disaster recovery. The key matches each supplied key from RecoveryKeys in the Manifest.
Example for setting the manifest with curl:
curl --cacert marblerun.crt --data-binary @manifest.json "https://$MARBLERUN/manifest"
Request Body schema: application/json
object Infrastructures contains the allowed infrastructure providers and their properties. | |
object Marbles contains the allowed services with their corresponding enclave and configuration parameters. | |
object Packages contains the allowed enclaves and their properties. | |
object RecoveryKeys holds one or multiple RSA public keys to encrypt multiple secrets, which can be used to decrypt the sealed state again in case the encryption key on disk was corrupted somehow. | |
object Roles contains role definitions to manage permissions across the MarbleRun mesh | |
object Secrets holds user-specified secrets, which should be generated and later on stored in a marble (if not shared) or in the core (if shared). | |
object TLS contains tags which can be assiged to Marbles to specify which connections should be elevated to TLS | |
object Users contains user definitions, including certificates used for authentication and permissions. |
Responses
Request samples
- Payload
{- "Infrastructures": {
- "property1": {
- "CPUSVN": [
- 0
], - "PCESVN": 0,
- "QESVN": 0,
- "RootCA": [
- 0
]
}, - "property2": {
- "CPUSVN": [
- 0
], - "PCESVN": 0,
- "QESVN": 0,
- "RootCA": [
- 0
]
}
}, - "Marbles": {
- "property1": {
- "MaxActivations": 0,
- "Package": "string",
- "Parameters": {
- "Argv": [
- "string"
], - "Env": {
- "property1": {
- "Data": "string",
- "Encoding": "string",
- "NoTemplates": true
}, - "property2": {
- "Data": "string",
- "Encoding": "string",
- "NoTemplates": true
}
}, - "Files": {
- "property1": {
- "Data": "string",
- "Encoding": "string",
- "NoTemplates": true
}, - "property2": {
- "Data": "string",
- "Encoding": "string",
- "NoTemplates": true
}
}
}, - "TLS": [
- "string"
]
}, - "property2": {
- "MaxActivations": 0,
- "Package": "string",
- "Parameters": {
- "Argv": [
- "string"
], - "Env": {
- "property1": {
- "Data": "string",
- "Encoding": "string",
- "NoTemplates": true
}, - "property2": {
- "Data": "string",
- "Encoding": "string",
- "NoTemplates": true
}
}, - "Files": {
- "property1": {
- "Data": "string",
- "Encoding": "string",
- "NoTemplates": true
}, - "property2": {
- "Data": "string",
- "Encoding": "string",
- "NoTemplates": true
}
}
}, - "TLS": [
- "string"
]
}
}, - "Packages": {
- "property1": {
- "Debug": true,
- "ProductID": 0,
- "SecurityVersion": 0,
- "SignerID": "string",
- "UniqueID": "string"
}, - "property2": {
- "Debug": true,
- "ProductID": 0,
- "SecurityVersion": 0,
- "SignerID": "string",
- "UniqueID": "string"
}
}, - "RecoveryKeys": {
- "property1": "string",
- "property2": "string"
}, - "Roles": {
- "property1": {
- "Actions": [
- "string"
], - "ResourceNames": [
- "string"
], - "ResourceType": "string"
}, - "property2": {
- "Actions": [
- "string"
], - "ResourceNames": [
- "string"
], - "ResourceType": "string"
}
}, - "Secrets": {
- "property1": {
- "Cert": null,
- "Private": [
- 0
], - "Public": [
- 0
], - "Shared": true,
- "Size": 0,
- "Type": "string",
- "UserDefined": true,
- "ValidFor": 0
}, - "property2": {
- "Cert": null,
- "Private": [
- 0
], - "Public": [
- 0
], - "Shared": true,
- "Size": 0,
- "Type": "string",
- "UserDefined": true,
- "ValidFor": 0
}
}, - "TLS": {
- "property1": {
- "Incoming": [
- {
- "Addr": "string",
- "Cert": "string",
- "DisableClientAuth": true,
- "Port": "string"
}
], - "Outgoing": [
- {
- "Addr": "string",
- "Cert": "string",
- "DisableClientAuth": true,
- "Port": "string"
}
]
}, - "property2": {
- "Incoming": [
- {
- "Addr": "string",
- "Cert": "string",
- "DisableClientAuth": true,
- "Port": "string"
}
], - "Outgoing": [
- {
- "Addr": "string",
- "Cert": "string",
- "DisableClientAuth": true,
- "Port": "string"
}
]
}
}, - "Users": {
- "property1": {
- "Certificate": "string",
- "Roles": [
- "string"
]
}, - "property2": {
- "Certificate": "string",
- "Roles": [
- "string"
]
}
}
}
Response samples
- 200
- 500
{- "Data": {
- "RecoverySecrets": {
- "property1": "string",
- "property2": "string"
}
}, - "Status": "success"
}
Retrieve a remote attestation quote and certificates.
For retrieving a remote attestation quote over the whole cluster and the root certificate. The quote is an SGX-DCAP quote, you can learn more about DCAP in the official Intel DCAP orientation. Both the provider and the users of the confidential application can use this endpoint to verify the integrity of the Coordinator and the cluster at any time.
The returned certificate chain is PEM-encoded, contains the Coordinator's Root CA and Intermediate CA, and can be used for trust establishment between a client and the Coordinator. The quote is base64-encoded and can be used for Remote Attestation, as described in Verifying a deployment.
We provide a tool to automatically verify the quote and output the trusted certificate:
# Either install era for the current user
wget -P ~/.local/bin https://github.com/edgelesssys/era/releases/latest/download/era
chmod +x ~/.local/bin/era
# Or install it globally on your machine (requires root permissions)
sudo wget -O /usr/local/bin/era https://github.com/edgelesssys/era/releases/latest/download/era
sudo chmod +x /usr/local/bin/era
era -c coordinator-era.json -h $MARBLERUN -o marblerun.crt
On Ubuntu,
~/.local/bin
is added to PATH only if the directory exists when the bash environment is initialized during login. You might need to re-login after creating the directory. Also, non-default shells such aszsh
do not add this path by default. Therefore, if you receivecommand not found: era
as an error message for a local user installation, either make sure~/.local/bin
was added to your PATH successfully, or simply use the machine-wide installation method.
The file coordinator-era.json
contains the Packages information for the Coordinator.
The example coordinator-era.json
for our provided testing image can be downloaded from GitHub:
wget https://github.com/edgelesssys/marblerun/releases/latest/download/coordinator-era.json
Responses
Response samples
- 200
- 500
{- "Data": {
- "Cert": "string",
- "Quote": [
- 0
]
}, - "Status": "success"
}
Recover the Coordinator when unsealing of the existing state fails.
This API endpoint is only available when the coordinator is in recovery mode. Before you can use the endpoint, you need to decrypt the recovery secret which you may have received when setting the manifest initially. See Recovering the Coordinator to retrieve the recovery key needed to use this API endpoint correctly.
Example for recovering the Coordinator with curl:
curl -k -X POST --data-binary @recovery_key_decrypted "https://$MARBLERUN/recover"
Request Body schema: application/json
Responses
Request samples
- Payload
[- 0
]
Response samples
- 200
- 500
{- "Data": {
- "StatusMessage": "string"
}, - "Status": "success"
}
Retrieve secrets.
Each requests allows specifying one or more secrets in the form of a query string, where each parameter s
specifies one secret.
A query string for the secrets symmetricKeyShared
and certShared
may look like the following:
s=symmetricKeyShared&s=certShared
This API endpoint only works when Users
were defined in the manifest.
The user connects via mutual TLS using the user client certificate in the TLS Handshake.
For more information, look up Managing secrets.
Example for retrieving the secrets symmetricKeyShared
and certShared
:
curl --cacert marblerun.crt --cert user_certificate.crt --key user_private.key https://$MARBLERUN/secrets?s=symmetricKeyShared&s=certShared
query Parameters
s | Array of strings[ items non-empty ] |
Responses
Response samples
- 200
- 401
- 500
{- "Data": { },
- "Status": "success"
}
Set secrets.
Setting secrets requires uploading them in JSON format.
This API endpoint only works when Users
were defined in the manifest.
The user connects via mutual TLS using the user client certificate in the TLS Handshake.
For more information, look up Managing secrets.
Example for setting secrets from the file secrets.json
:
curl --cacert marblerun.crt --cert user_certificate.crt --key user_private.key --data-binary @secrets.json https://$MARBLERUN/secrets
Request Body schema: application/json
additional property | object (UserSecret) UserSecret is a secret uploaded by a user | ||||||
|
Responses
Request samples
- Payload
{- "property1": {
- "Cert": null,
- "Key": [
- 0
], - "Private": [
- 0
]
}, - "property2": {
- "Cert": null,
- "Key": [
- 0
], - "Private": [
- 0
]
}
}
Response samples
- 200
- 400
- 401
- 500
{- "Data": {
- "property1": {
- "Cert": null,
- "Private": [
- 0
], - "Public": [
- 0
], - "Shared": true,
- "Size": 0,
- "Type": "string",
- "UserDefined": true,
- "ValidFor": 0
}, - "property2": {
- "Cert": null,
- "Private": [
- 0
], - "Public": [
- 0
], - "Shared": true,
- "Size": 0,
- "Type": "string",
- "UserDefined": true,
- "ValidFor": 0
}
}, - "Status": "success"
}
Get the current status of the Coordinator.
The status indicates the current state of the coordinator, and can be one of the following:
- Coordinator is in recovery mode. Either upload a key to unseal the saved state, or set a new manifest. Waiting for user input on /recover.
- Coordinator is ready to accept a manifest on /manifest
- Coordinator is running correctly and ready to accept marbles through the Marble API
Responses
Response samples
- 200
- 500
{- "Data": {
- "StatusCode": 2,
- "StatusMessage": "Coordinator is ready to accept a manifest."
}, - "Status": "success"
}
Get a log of all performed updates.
Returns a structured log of all updates performed via the /update
or /secrets
endpoint, including timestamp, author, and affected resources.
Responses
Response samples
- 200
- 500
{- "Data": "SecurityVersion increased {\"user\": \"someuser\", \"package\": \"somepackage\", \"new version\": 4}",
- "Status": "success"
}
Update a specific package set in the manifest.
This API endpoint only works if Users
are defined in the Manifest.
For more information, have a look at updating a Manifest.
Example for updating the manifest with curl:
curl --cacert marblerun.crt --cert user_certificate.crt --key user_private.key -w "%{http_code}" --data-binary @update_manifest.json https://$MARBLERUN/update
Request Body schema: application/json
object Infrastructures contains the allowed infrastructure providers and their properties. | |
object Marbles contains the allowed services with their corresponding enclave and configuration parameters. | |
object Packages contains the allowed enclaves and their properties. | |
object RecoveryKeys holds one or multiple RSA public keys to encrypt multiple secrets, which can be used to decrypt the sealed state again in case the encryption key on disk was corrupted somehow. | |
object Roles contains role definitions to manage permissions across the MarbleRun mesh | |
object Secrets holds user-specified secrets, which should be generated and later on stored in a marble (if not shared) or in the core (if shared). | |
object TLS contains tags which can be assiged to Marbles to specify which connections should be elevated to TLS | |
object Users contains user definitions, including certificates used for authentication and permissions. |
Responses
Request samples
- Payload
{- "Infrastructures": {
- "property1": {
- "CPUSVN": [
- 0
], - "PCESVN": 0,
- "QESVN": 0,
- "RootCA": [
- 0
]
}, - "property2": {
- "CPUSVN": [
- 0
], - "PCESVN": 0,
- "QESVN": 0,
- "RootCA": [
- 0
]
}
}, - "Marbles": {
- "property1": {
- "MaxActivations": 0,
- "Package": "string",
- "Parameters": {
- "Argv": [
- "string"
], - "Env": {
- "property1": {
- "Data": "string",
- "Encoding": "string",
- "NoTemplates": true
}, - "property2": {
- "Data": "string",
- "Encoding": "string",
- "NoTemplates": true
}
}, - "Files": {
- "property1": {
- "Data": "string",
- "Encoding": "string",
- "NoTemplates": true
}, - "property2": {
- "Data": "string",
- "Encoding": "string",
- "NoTemplates": true
}
}
}, - "TLS": [
- "string"
]
}, - "property2": {
- "MaxActivations": 0,
- "Package": "string",
- "Parameters": {
- "Argv": [
- "string"
], - "Env": {
- "property1": {
- "Data": "string",
- "Encoding": "string",
- "NoTemplates": true
}, - "property2": {
- "Data": "string",
- "Encoding": "string",
- "NoTemplates": true
}
}, - "Files": {
- "property1": {
- "Data": "string",
- "Encoding": "string",
- "NoTemplates": true
}, - "property2": {
- "Data": "string",
- "Encoding": "string",
- "NoTemplates": true
}
}
}, - "TLS": [
- "string"
]
}
}, - "Packages": {
- "property1": {
- "Debug": true,
- "ProductID": 0,
- "SecurityVersion": 0,
- "SignerID": "string",
- "UniqueID": "string"
}, - "property2": {
- "Debug": true,
- "ProductID": 0,
- "SecurityVersion": 0,
- "SignerID": "string",
- "UniqueID": "string"
}
}, - "RecoveryKeys": {
- "property1": "string",
- "property2": "string"
}, - "Roles": {
- "property1": {
- "Actions": [
- "string"
], - "ResourceNames": [
- "string"
], - "ResourceType": "string"
}, - "property2": {
- "Actions": [
- "string"
], - "ResourceNames": [
- "string"
], - "ResourceType": "string"
}
}, - "Secrets": {
- "property1": {
- "Cert": null,
- "Private": [
- 0
], - "Public": [
- 0
], - "Shared": true,
- "Size": 0,
- "Type": "string",
- "UserDefined": true,
- "ValidFor": 0
}, - "property2": {
- "Cert": null,
- "Private": [
- 0
], - "Public": [
- 0
], - "Shared": true,
- "Size": 0,
- "Type": "string",
- "UserDefined": true,
- "ValidFor": 0
}
}, - "TLS": {
- "property1": {
- "Incoming": [
- {
- "Addr": "string",
- "Cert": "string",
- "DisableClientAuth": true,
- "Port": "string"
}
], - "Outgoing": [
- {
- "Addr": "string",
- "Cert": "string",
- "DisableClientAuth": true,
- "Port": "string"
}
]
}, - "property2": {
- "Incoming": [
- {
- "Addr": "string",
- "Cert": "string",
- "DisableClientAuth": true,
- "Port": "string"
}
], - "Outgoing": [
- {
- "Addr": "string",
- "Cert": "string",
- "DisableClientAuth": true,
- "Port": "string"
}
]
}
}, - "Users": {
- "property1": {
- "Certificate": "string",
- "Roles": [
- "string"
]
}, - "property2": {
- "Certificate": "string",
- "Roles": [
- "string"
]
}
}
}
Response samples
- 200
- 400
- 500
{- "Data": { },
- "Status": "success"
}