Repository navigation
Source Code Validation — Ensuring Integrity of XRPL Builds #235
Replies: 3 comments
|
The hashes are already published on xrpl.org as a norm - for example, see https://xrpl.org/blog/2024/rippled-2.2.3#install-/-upgrade |
|
Would the config file need to be updated every time the operator installs a new version? If that's the case, how about adding a link to an external file (similar to |
|
Superseded by #659. It keeps the idea here of signatures from parties the operator chooses, and moves verification out of the binary: releases build reproducibly, rebuilders attest each release on ledger, and the installed node checks the next package before install. @ximinez your external file suggestion became the trust policy file. |
Uh oh!
There was an error while loading. Please reload this page.
Source Code Validation — Ensuring Integrity of XRPL Builds
Title: Source Code Validation
Type: Draft
Author:
Denis Angell, XRPL-Labs (dangell7)
Affiliation: XRPL-Labs
Problem Statement
In the development and deployment of software, ensuring the integrity and authenticity of the source code is paramount, especially for systems handling financial transactions like the XRPL. Currently, there is no standardized method to verify that the source code used to build the software matches the original source code. This lack of verification can lead to security vulnerabilities, as malicious alterations to the code could go undetected. To address this issue, we propose a new amendment that introduces a robust framework for validating the source code used in XRPL builds. This will enhance security by ensuring that the software being executed is indeed the software that was intended to be built.
Limitations of GPG Key Verification
While GPG key verification is a useful method for ensuring the authenticity of software packages, it is not as secure as hash verification. GPG keys can be compromised, and if an attacker gains access to a trusted key, they could sign malicious code, making it appear legitimate. In contrast, hash verification directly compares the generated hash of the source code with the expected hash, providing a more robust assurance that the code has not been altered.
Optional Implementation
It is important to note that the implementation of this source code validation framework is optional. Developers and organizations can choose to adopt this mechanism based on their security requirements and risk assessments. For those who prioritize enhanced security, especially in production environments, this validation process can serve as an additional layer of protection against unauthorized code modifications.
Amendment
The proposed amendment introduces a new framework for validating the source code used in XRPL builds, providing a method to ensure that the software being executed matches the original source code.
The amendment adds:
rippled.cfgfile to include new stanzas for public keys and signatures.New Configuration Stanzas
The
rippled.cfgfile will be updated to include the following new stanzas:strict: A list of public keys / signatures used for verification.Example
rippled.cfgentries:Verification Process
When starting the software, the following steps will be executed:
Hash Generation: The software will compute the SHA256 hash of the binary file generated from the source code. This is done using the
computeBinaryHashfunction, which reads the binary file and generates the hash.Configuration File Parsing: The software will read the
strictstanzapublic keysandsignaturesfrom therippled.cfgfile. Each entry in the[strict]section will be split into a public key and its corresponding signature.Signature Verification: For each public key and signature pair, the software will:
ripple::verifyfunction.Execution Control: If any verification fails, the software will not start, ensuring that only valid source code is executed.
Example Hashing Script
A Bash script is provided to compute the hash of the binary:
All reactions