0086 XLS-86d: Firewall #255
Replies: 3 comments 5 replies
-
Very interesting proposal!
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I was thinking we should also add protection against malicious actors. |
Beta Was this translation helpful? Give feedback.
-
XLS-86d - Firewall
Abstract
This proposal introduces a new security feature for the XRP Ledger, referred to as the "Firewall."
The proposed Firewall feature allows account owners to configure time-based, value-limited safeguards on outgoing transactions. These restrictions ensure that even if a private key is compromised, an attacker cannot immediately drain the account, giving the owner time to secure their assets. The Firewall will integrate seamlessly with existing transaction flows and is an optional feature that users can enable at their discretion. Additionally, the proposal outlines the creation of a whitelist mechanism, allowing trusted accounts to bypass the firewall restrictions, to strike a balance between security and usability, allowing the feature to be configured so that it does not interfere with genuine day-to-day transactions.
This feature is particularly beneficial for retail users and small enterprises, offering a simpler alternative or complement to multisig protection.
Rationale
The XRPL protocol currently does not have a native mechanism to prevent a compromised account from being instantly drained by an attacker. This risk is a substantial deterrent to the mainstream adoption of self-custody solutions.
Multisignature (multisig) functionality was introduced to mitigate this risk by adding additional layers of authorization. However, in practice, this solution has not been widely adopted. Major XRP Ledger wallets do not support multisig in a way that allows average users to easily benefit from the functionality; also the complexity of setting up and managing multisig accounts makes it inaccessible for many users. Additionally, even multisig protected accounts can be drained if multiple private keys are compromised by a malicious actor.
The objective of this amendment is to propose a user-friendly and secure mechanism that can be easily implemented as an alternative to multisig or used in combination with multisig to further enhance security.
When enabled on an account, it will prevent an attacker from instantly draining an account and provide the user with an opportunity to move their funds to an alternative authorized backup account.
The system will seamlessly integrate with the current transaction flow and activate only when the user's predefined rules are triggered. Additionally, the amendment is entirely optional, requiring users to opt-in to benefit from its features.
Overhead
(tx.Amount + firewall.runningTotal) > firewall.Amount
.Basic Flows
Account compromise without firewall engaged
Account compromise with firewall engaged
FirewallWhitelistSet
transaction now require the transaction to be signed by the account specified insfPublicKey
.AccountDelete
transaction when theFirewall
is enabled.Owner wants to delete their account
Day to Day use
FirewallWhitelist
. The payment is sent as normal and the firewall allows the payment to proceed with no noticeable difference.SuperCoolNewProject
to subscribe to a new app. The payment is for 75 XRP. The payment is sent as normal because the payment expends 75 XRP of the users defined 500 XRP daily limit (within the 24 hours period). The firewall allows the payment to proceed as normal.Limitations
This proposal only protects XRP; it does not prevent the draining of any other asset held on an account. However, with broad support, the specification could be updated to include protection for issued assets and potentially other assets like NFTs.
Audience
This proposal is not a replacement for multisig; it is proposed as an easier alternative for retail and small enterprises and as an additional feature that could be used to further enhance multisig-protected accounts.
Amendment
The proposed amendment introduces a new feature that allows for configuration of time based, value limits on outgoing transactions.
When a transaction is submitted, it will only be accepted if the value (including the SUM of all other successful transactions, within the defined time-period), is less than the amount defined on the firewall; OR the transaction destination is listed on the firewall whitelist OR the transaction destination is the BackupAccount on the firewall ledger entry.
The amendment adds the following:
Firewall
FirewallSet
FirewallDelete
FirewallWhitelist
FirewallWhitelistSet
New Ledger Entry:
Firewall
The
Firewall
ledger entry is a new on-ledger object that stores the rules to be applied to all outgoing transactions, as well as a safeguard for authorization of updates to the object once set.The object has the following fields:
Firewall
is set.Firewall
andFirewallWhitelist
.This field is only updatable from within rippled.
This field is only updatable from within rippled.
Example
Firewall
object:New Transaction Type:
FirewallSet
The
FirewallSet
transaction is used to set and update theFirewall
.To set the
Firewall
thesfPublicKey
andsfBackupAccount
are required.To update the
Firewall
sfSignature
field is required, which will be validated against thesfPublicKey
on the firewall ledger entry object.FirewallSet
.Firewall
is set.Firewall
andFirewallWhitelist
PublicKey
on the firewall ledger entry object.FirewallSet
- CreateFailure Conditions
State Changes
Firewall
Ledger Entry, setting the fields.FirewallSet
- UpdateFailure Conditions
State Changes
Firewall
Ledger Entry, setting the fields.New Transaction Type:
FirewallDelete
The
FirewallDelete
transaction is used to delete theFirewall
object.To delete the
Firewall
the transaction must includesfSignature
of the transaction which will be validated against thesfPublicKey
on the firewall ledger entry object.FirewallDelete
.Firewall
is set.PublicKey
on the firewall ledger entry object.FirewallDelete
Failure Conditions
State Changes
Firewall
ledger entry.FirewallWhitelist
entries.New Ledger Entry:
FirewallWhitelist
The
FirewallWhitelist
ledger entry is a new on-ledger object that stores the accountID of an account that is authorized to bypass the configured rules of the firewall.It closely mirrors the implementation of
DepositPreauth
in reverse.The object has the following fields:
Example
FirewallWhitelist
object:New Transaction Type:
FirewallWhitelistSet
The
FirewallWhitelistSet
transaction is used to authorize specific accounts to bypass the configured firewall rules.To be a valid transaction one of these fields must contain a valid active accountID.
Security:
To add an account to the whitelist or remove an account from the whitelist the transaction must include a signature of the transaction which will be validated against the
PublicKey
on the firewall ledger entry object.FirewallWhitelistSet
.PublicKey
on the firewall ledger entry object.FirewallWhitelistSet
- AuthorizeFirewallWhitelistSet
- UnauthorizeFailure Conditions
Authorize account is not active(removed on the basis you may want to register an account to activate)State Changes
FirewallWhitelist
Ledger Entry, setting the fields.Transaction Processing
When a transaction is submitted from an account with the firewall enabled, the following rules apply:
BackupAccount
set on the firewall ledger entry, the transaction is successful (tesSUCCESS
).tesSUCCESS
).TotalOut
, is less than the configured firewall amount, the transaction is successful (tesSUCCESS
)tecFIREWALL_REJECTION
)Calculating
TotalOut
To implement the time based amount limit, we must have access to a total amount of XRP that has already left the account within the defined time period and this method must be very efficient.
First: The calculation of total amount should be deferred, so it only runs, after all other guards have passed and it is now required.
Proposed Algorithm
Key Points to Understand
start time
) within a new period and the length of the user-defined (time period
). When the period expires, the (total out
) is reset, and a new period begins on the next successful transaction.total out
), which helps in tracking the total outgoing amount within the defined period.total out
) is set to 0 to ensure that the firewall only considers transactions within the new current period.total out
) and this code would never run.Compromised Account Protection
Upon enabling the firewall feature, the following measures are implemented:
AccountSet
transaction attempts to disable the master key (tfDisableMaster
), the transaction is rejected. This is to prevent an attacker from locking the owner out of their account.The combination of requiring a second level of security to modify the firewall feature, along with the prevention of an attacker from locking a user out of their account, means that while an attacker may have the private key, the maximum damage they can do is drain the account of an amount less than that configured by the user within their given timeframe. The account owner can at any time instigate a payment of their full account balance to either their chosen backup account or any other account on their whitelist.
Ideas
Use with Batch (XLS 56)
One interesting use case could be with combining Firewall with Batch (XLS 56) on high balance accounts that make regular automated payments.
Consider an account essentially locked down by enabling firewall with an Amount of zero. The only way to make a payment is to a whitelisted account.
Create a batch TX.
The balance cannot be drained even if the private key is compromised.
Implementing a design pattern where the signature account
sfPublicKey
is sufficiently segregated from the main account would result in a lightweight form of multiSig.FAQ
A.1 What happens if my seed/private key is compromised?
If you keys are compromised then you would want to move your funds from your account to a whitelisted account.
A.2 Can the attacker disable my keys?
No, with firewall the disable master key functionality is disabled
A.3 Can the attacker add themselves as a whitelisted account?
No, not without approval from the account that you intrusted during setup.
A.4 Does the PublicKey that is signing firewall updates need to be a 3rd party?
No, this could be another account that you own or a 3rd party you trust
A.5 Do I need to set an
BackupAccount
?Yes, you are required to set the backup account when you setup the firewall for the first time.
A.6 Do I need to set an
Amount
and aTimePeriod
?No, this is optional functionality to allow you to send small amounts without having to add the account to the whitelist.
Beta Was this translation helpful? Give feedback.
All reactions