You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Digital Bill of Materials (DBoM) Consortium Linux Foundation project seeks to improve supply chain efficiency by enabling more effective attestation sharing among supply chain partners. Find us at `dbom.io <http://dbom.io/>`_ .
6
6
To know more go to :doc:`what-dbom` or if you want to get started and set up a DBoM Node go to :doc:`getting-started`.
Copy file name to clipboardExpand all lines: source/key-concepts.rst
+15-2
Original file line number
Diff line number
Diff line change
@@ -62,10 +62,17 @@ The Gateway is the component that manages connections to one or more agents and
62
62
- Detach Subasset
63
63
- Get Asset Audit Trail
64
64
65
-
The main function of a Gateway include:
65
+
The gateway additionally has extension APIs that allow you to:
66
+
67
+
- Transfer assets across repositories and channels
68
+
- Export assets with expanded parent and child links as a JSON Tree
69
+
- Validate a signed asset using PKI
70
+
71
+
For instructions on using these extension APIs, refer to the API Specification or the :ref:`gateway extension APIs tutorial <gw-extension-apis>`.
72
+
73
+
The main function of the DBoM Gateway include:
66
74
67
75
- Maintain and validate the connection configuration for its agent(s)
68
-
- Manage authentication and authorization using a Role Based Access Control model
69
76
- Convert API calls by its external service users to the correponding calls to corresponding Agent.
70
77
- Validate the semantic structure of the asset being written to the repository by leveraging JSONSchema defined in the REST-Schema folder.
71
78
@@ -96,6 +103,8 @@ Agents can be created for
96
103
- Transparency Logs (Eg. Trillian_)
97
104
98
105
.. _Trillian: https://github.com/google/trillian
106
+
107
+
99
108
==========
100
109
Extensions
101
110
==========
@@ -117,6 +126,10 @@ The current policy that is applied to any subscriber of a channel is Read/Write.
117
126
118
127
For a more granular management of permissions, a policy management plugin is required for each channel to ensure that they have policies-based accesses by its subscribers.
119
128
129
+
.. note::
130
+
131
+
This subsection describes functionality that has not yet been implemented in the OSS DBoM Gateway
132
+
120
133
The plugin will provide a framework for governance of information and attestations.
121
134
Policies will be enforced on channels that are created by the Designated Repository Owner (DRO).
Copy file name to clipboardExpand all lines: source/tutorials.rst
+168-6
Original file line number
Diff line number
Diff line change
@@ -51,12 +51,174 @@ Parameters
51
51
The agent is configured to automatically reload the agent config if any
52
52
changes occur on the configmap or in the file-system
53
53
54
+
======================
55
+
Customized Deployments
56
+
======================
54
57
55
-
=================================================
56
-
Connecting Multiple Nodes to a MongoDB Repository
57
-
=================================================
58
+
This section covers non-default deployment configurations that may be useful when deploying DBoM core services in production or niche use cases
58
59
60
+
Using TLS and x.509 authentication with MongoDB
61
+
-----------------------------------------------
59
62
60
-
==============================================
61
-
Connecting multiple nodes to IOTA MAM Channels
62
-
==============================================
63
+
In a production deployment, if you are choosing to use the mongodb repository implementation (database-agent), the recommended way to securely communicate to the repository is to use the built-in TLS support and x.509 user authentication.
64
+
65
+
This is fairly simple to do as database agent, and the mongodb-audit watcher (which is run by the repository owner) has built in support for mutual TLS authentication and authorization.
66
+
67
+
To begin with, you will have to configure your mongodb deployment to use tls and x.509 client authentication. The generation of certificates and configuration of the mongodb server is outside the scope of the DBoM documentation.
68
+
69
+
However, if you want to try out this deployment by creating a local CA which can sign a certificate, follow the official mongoDB documentation:
70
+
71
+
- `Creating CA Certificates <https://docs.mongodb.com/manual/appendix/security/appendixA-openssl-ca/>`_
72
+
- `Creating Certificates for your MongoDB Server <https://docs.mongodb.com/manual/appendix/security/appendixB-openssl-server/>`_
73
+
- `Creating Certificates for Mongo clients <https://docs.mongodb.com/manual/appendix/security/appendixC-openssl-client/>`_
74
+
75
+
You will need to generate multiple client certificates and associated user roles, as follows:
76
+
77
+
- One for the mongodb-audit-watcher, having read access to your channels collection as well as the ability to listen to change streams
78
+
- One for each DBoM node that you want joined to the repository, having appropriate access control to the channel collections
79
+
80
+
The details for creating these roles are present in the `MongoDB documentation for Users and Roles <https://docs.mongodb.com/manual/tutorial/manage-users-and-roles/>`_ and `x.509 authentication for clients <https://docs.mongodb.com/manual/tutorial/configure-x509-client-authentication/>`_
81
+
82
+
Once you have configured mongodb with the certificates that you have generated, it is now time to configure the database agent instances and the mongoDB audit watcher appropriately
83
+
84
+
This is done using environment variables. Set the appropriate environment variables, as specified in the README for `database-agent <https://github.com/DBOMproject/database-agent>`_ and `mongodb-audit-watcher <https://github.com/DBOMproject/mongodb-audit-watcher>`_. If you are using docker, ensure that the certificates that you are providing are available within the container as a volume mount.
85
+
86
+
.. list-table:: Example Environment Variables
87
+
:header-rows: 1
88
+
:align: center
89
+
90
+
* - Key
91
+
- Value
92
+
* - MONGO_TLS_MODE_ENABLED
93
+
- ``1``
94
+
* - MONGO_TLS_CLIENT_CERT_PATH
95
+
- ``.secrets/client_cert.pem``
96
+
* - MONGO_TLS_CA_CERT_PATH
97
+
- ``.secrets/ca_cert.pem``
98
+
99
+
If you are using Helm Charts to deploy on Kubernetes, these keys are stored within a secret. Refer to the helm chart READMEs for further details.
100
+
101
+
102
+
=========================
103
+
Connecting Multiple Nodes
104
+
=========================
105
+
106
+
107
+
MongoDB (Database Agent)
108
+
------------------------
109
+
110
+
This can be done by configuring the same mongoDB URI for the database-agent deployment for each node, either by using docker environment variables or the appropriate keys in the Kubernetes configmap
Ensure that both nodes have the agent configuration correctly set with the same names for the repositories. Access control to channels is facilitated by MongoDB Collection Level Role Based Access Control. Find how that can be setup by referring to the `official MongoDB documentation <https://docs.mongodb.com/manual/core/collection-level-access-control/>`__
118
+
119
+
IOTA (IOTA MAM Agent)
120
+
---------------------
121
+
122
+
To know more about setting up multiple channels for the IOTA MAM Agent, go to the `official repository <https://github.com/DBOMproject/iota-agent#multi-node-channel-support>`__
123
+
124
+
.. _gw-extension-apis:
125
+
126
+
================================
127
+
Using The Gateway Extension APIs
128
+
================================
129
+
130
+
In addition to the core create, update, attach, detach and audit APIs, the gateway has extension APIs that provide utility functions. These tutorials guide you through using them
131
+
132
+
133
+
Transfer API
134
+
------------
135
+
136
+
The Transfer API allows you to copy over an asset from one attestation channel to another. This could be useful when you're moving an asset downstream in the supply chain, where entities only have visibility into a limited set of the channels
137
+
138
+
.. image:: _static/img/transfer-asset-example.png
139
+
:alt:Example transfer scenario
140
+
141
+
Pictured above is an example scenario where the "Supplier-Manufacturer" channel's policy restricts it to be read by just the supplier and the manufacturer.
142
+
143
+
If the manufacturer wanted to share this asset downstream with the distributor, they can transfer it to the "Manufacturer-Distributor" channel, whose policies allow the distributor to read it
144
+
145
+
When a transfer occurs, the metadata required to find the transfer destination and source are embedded into the asset payload. This allows you to track the asset's audit trail throughout it's lifetime
146
+
147
+
Using the REST API
148
+
^^^^^^^^^^^^^^^^^^
149
+
150
+
Import the `postman files for the Gateway <https://github.com/DBOMproject/api-specs/tree/master/gateway/postman>`__ to experiment with the REST API.
151
+
152
+
Open up the postman collection and navigate to the "Transfer an Asset" request. Enter your parameters for repo ID, channel ID and asset ID (source) into the http parameters tab
153
+
154
+
When you navigate to the "body" tab, you will see the following payload
155
+
156
+
.. code-block:: json
157
+
158
+
{
159
+
"transferDescription": "...",
160
+
"repoID": "...",
161
+
"channelID": "...",
162
+
"assetID": "..."
163
+
}
164
+
165
+
The ``repoID``, ``channelID`` and ``assetID`` referred to in the body must be replaced with the destination repo, channel and asset id that you want the asset to assume after the transfer operation. You can also provide a ``transferDescription`` to provide context for the transfer operation
166
+
167
+
Once transferred, the source and destination assets will be amended with a ``custodyTransferEvents`` JSON array, which reflects all the transfer events that have occured on the asset. As this is part of the asset payload, it is immutably reflected in the asset audit trail.
168
+
169
+
.. note::
170
+
171
+
By default, the source asset is also marked 'read-only' by the gateway.
172
+
173
+
If you retrieve the destination or source asset that you transferred right now, you'll find the following key added to the asset payload:
174
+
175
+
.. code-block:: json
176
+
177
+
"custodyTransferEvents ": [
178
+
{
179
+
"timestamp": "2021-03-22T11:22:14.589Z",
180
+
"transferDescription": "moved",
181
+
"sourceRepoID": "DB1",
182
+
"sourceChannelID": "C1",
183
+
"sourceAssetID": "ABC02",
184
+
"destinationRepoID": "DB1",
185
+
"destinationChannelID": "C2",
186
+
"destinationAssetID": "ABC02"
187
+
}
188
+
],
189
+
190
+
This event tells the requestor that this asset was moved from DB1,C1 to DB1,C2 at the shown timestamp with the description "moved". The presence of this event on the asset can be used in your applications to recursively retrieve the state of the asset across multiple channels in order to trace and establish provenance of the asset.
191
+
192
+
193
+
Transfer Policies
194
+
^^^^^^^^^^^^^^^^^^
195
+
.. note::
196
+
197
+
This subsection describes functionality that has not yet been implemented in the OSS DBoM Gateway
198
+
199
+
There are cases where you would want to mark assets on a channel as being transferrable only if it meets the criteria set by channel-wide or asset-specific policies.
200
+
201
+
This is where transfer policies come in. They allow you to set channel wide or asset specific policies for transfer including
202
+
203
+
- the ability to disable transfers altogether
204
+
- controlled transfers that are limited to specific repositories and channels
205
+
206
+
Channels will have a default transfer policy, which will apply to all assets that don't have an explicit channel policy specified, however if the asset references a specific policy as part of the asset metadata, that policy will override the default policy set at the channel level
207
+
208
+
209
+
Export API
210
+
------------
211
+
212
+
The export api lets you retrieve an entire asset tree from the DBoM (i.e. including all parent and child assets). This could be useful if you are moving an asset and all associated sub assets into another system for processing
213
+
214
+
Take an example where you create a bunch of assets and attach them as shown below.
215
+
216
+
.. image:: _static/img/export-example.png
217
+
:width:300px
218
+
:align:center
219
+
:alt:Example export scenario
220
+
221
+
If you wanted to export these assets out at once into another system, you can run export on any of these assets and the entire tree will be returned as JSON.
222
+
223
+
For instance, let's say we try exporting `ExportTestA1`, we will get a JSON payload with all its children upto the leaf level (i.e `ExportTestA2`, `ExportTestA3` and `ExportTestA4`).
224
+
However, if we try to export `ExportTestA2`, we will get all children and direct ancestors (i.e `ExportTestA1` and `ExportTestA4`)
0 commit comments