Source Code Validation — Ensuring Integrity of XRPL Builds #235
dangell7
started this conversation in
Ideas (pre standard proposal)
Replies: 2 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 |
Beta Was this translation helpful? Give feedback.
0 replies
-
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 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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.cfg
file to include new stanzas for public keys and signatures.New Configuration Stanzas
The
rippled.cfg
file will be updated to include the following new stanzas:strict
: A list of public keys / signatures used for verification.Example
rippled.cfg
entries: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
computeBinaryHash
function, which reads the binary file and generates the hash.Configuration File Parsing: The software will read the
strict
stanzapublic keys
andsignatures
from therippled.cfg
file. 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::verify
function.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:
Beta Was this translation helpful? Give feedback.
All reactions