Bump ubuntu (#3874)
Bumps the docker-deps group with 1 update in the /examples/deployment/kubernetes/mysql/image directory: ubuntu.
Updates
ubuntufromce4a593to5e5b128
updated-dependencies:
- dependency-name: ubuntu dependency-version: jammy dependency-type: direct:production dependency-group: docker-deps …
Signed-off-by: dependabot[bot] support@github.com Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
Trillian: General Transparency
Overview
Trillian is an implementation of the concepts described in the Verifiable Data Structures white paper, which in turn is an extension and generalisation of the ideas which underpin Certificate Transparency.
Trillian implements a Merkle tree whose contents are served from a data storage layer, to allow scalability to extremely large trees. On top of this Merkle tree, Trillian provides the following:
Note that Trillian requires particular applications to provide their own personalities on top of the core transparent data store functionality.
Certificate Transparency (CT) is the most well-known and widely deployed transparency application, and an implementation of CT as a Trillian personality is available in the certificate-transparency-go repo.
Other examples of Trillian personalities are available in the trillian-examples repo.
Support
Using the Code
The Trillian codebase is stable and is used in production by multiple organizations, including many large-scale Certificate Transparency log operators.
Given this, we do not plan to add any new features to this version of Trillian, and will try to avoid any further incompatible code and schema changes but cannot guarantee that they will never be necessary.
The current state of feature implementation is recorded in the Feature implementation matrix.
To build and test Trillian you need:
To run many of the tests (and production deployment) you need:
Note that this repository uses Go modules to manage dependencies; Go will fetch and install them automatically upon build/test.
To fetch the code, dependencies, and build Trillian, run the following:
To build slimmer Trillian binaries that only include the storage and quota implementations that you need, consider specifying build tags.
To build and run tests, use:
The repository also includes multi-process integration tests, described in the Integration Tests section below.
MySQL Setup
To run Trillian’s integration tests you need to have an instance of MySQL running and configured to:
mysql --host=127.0.0.1 --port=3306connects OK)rootuserYou can then set up the expected tables in a
testdatabase like so:Integration Tests
Trillian includes an integration test suite to confirm basic end-to-end functionality, which can be run with:
This runs a multi-process test:
Deployment
You can find instructions on how to deploy Trillian in deployment and examples/deployment directories.
Working on the Code
Developers who want to make changes to the Trillian codebase need some additional dependencies and tools, described in the following sections. The Cloud Build configuration and the scripts it depends on are also a useful reference for the required tools and scripts, as it may be more up-to-date than this document.
Anyone wanting to add a new storage and/or quota implementation should understand how Trillian uses build tags.
Rebuilding Generated Code
Some of the Trillian Go code is autogenerated from other files:
fmt.Stringerinterface) created using the stringer tool (go get golang.org/x/tools/cmd/stringer).Re-generating mock or protobuffer files is only needed if you’re changing the original files. The recommended way to do this is by using the Docker image used by the Cloud Build:
These commands first create a docker image from the Dockerfile in this repo, and then launch a container based on this image with the local directory mounted. The correct versions of the tools are determined using the
go.modfile in this repo, and these tools are installed. Finally, all of the generated files are regenerated and Docker exits.Alternatively, you can install the prerequisites locally:
a series of tools, using
go installto ensure that the versions are compatible and tested:and run the following:
Updating Dependencies
The Trillian codebase uses go.mod to declare fixed versions of its dependencies. With Go modules, updating a dependency simply involves running
go get:To update ALL dependencies to the latest version run
go get -u. Be warned however, that this may undo any selected versions that resolve issues in other non-module repos.While running
go buildandgo test, go will add any ambiguous transitive dependencies togo.modTo clean these up run:Running Codebase Checks
The
scripts/presubmit.shscript runs various tools and tests over the codebase.Install golangci-lint.
Run code generation, build, test and linters
Or just run the linters alone
Design
Design Overview
Trillian is primarily implemented as a gRPC service; this service receives get/set requests over gRPC and retrieves the corresponding Merkle tree data from a separate storage layer (currently using MySQL), ensuring that the cryptographic properties of the tree are preserved along the way.
The Trillian service is multi-tenanted – a single Trillian installation can support multiple Merkle trees in parallel, distinguished by their
TreeId– and each tree operates in one of two modes:In either case, Trillian’s key transparency property is that cryptographic proofs of inclusion/consistency are available for data items added to the service.
Personalities
To build a complete transparent application, the Trillian core service needs to be paired with additional code, known as a personality, that provides functionality that is specific to the particular application.
In particular, the personality is responsible for:
This is described in more detail in a separate document. General design considerations for transparent Log applications are also discussed separately.
Log Mode
When running in Log mode, Trillian provides a gRPC API whose operations are similar to those available for Certificate Transparency logs (cf. RFC 6962). These include:
GetLatestSignedLogRootreturns information about the current root of the Merkle tree for the log, including the tree size, hash value, timestamp and signature.GetLeavesByRangereturns leaf information for particular leaves, specified by their index in the log.QueueLeafrequests inclusion of the specified item into the log.AddSequencedLeavesrequests the inclusion of specified items into the log at specified places in the tree.GetInclusionProof,GetInclusionProofByHashandGetConsistencyProofreturn inclusion and consistency proof data.In Log mode (whether normal or pre-ordered), Trillian includes an additional Signer component; this component periodically processes pending items and adds them to the Merkle tree, creating a new signed tree head as a result.
(Note that each of the components in this diagram can be distributed, for scalability and resilience.)
Use Cases
Certificate Transparency Log
The most obvious application for Trillian in Log mode is to provide a Certificate Transparency (RFC 6962) Log. To do this, the CT Log personality needs to include all of the certificate-specific processing – in particular, checking that an item that has been suggested for inclusion is indeed a valid certificate that chains to an accepted root.