Mitigation Strategy: Strong Preference for Pinned Content and Mutable Pointers (IPNS/DNSLink) with Signature Verification
Description:
- Identify Critical Data: Determine which data your application absolutely relies on.
- Pin Critical Data: Use the
go-ipfs pin add <CID>
command (or the equivalent API call) to pin this data on yourgo-ipfs
node(s). - Create Mutable Pointers (IPNS): For data that needs updates, use IPNS. Use
go-ipfs name publish <CID>
to create an IPNS record. This generates a key pair; the public key is the IPNS identifier. - Update Content (IPNS): When updating, publish the new CID using
go-ipfs name publish --key=<key-name> <new-CID>
. Use the private key associated with the IPNS record. - Signature Verification (IPNS): Crucially, before resolving an IPNS name, verify its signature using
go-ipfs
's API. This involves:- Retrieving the IPNS record.
- Extracting the public key.
- Verifying the signature using the public key.
- Only if valid, resolve the IPNS name to the CID.
- Regular Key Rotation (IPNS): Periodically rotate IPNS keys using
go-ipfs key
commands to mitigate key compromise risk.
-
Threats Mitigated:
- Malicious Data Injection (High Severity): Prevents attackers from tricking the application into using a malicious CID by hijacking an IPNS name.
- Data Corruption (High Severity): Ensures retrieval of intended data.
- Data Unavailability (Medium Severity): Pinning ensures local data availability.
-
Impact:
- Malicious Data Injection: Risk significantly reduced due to signature verification.
- Data Corruption: Risk significantly reduced.
- Data Unavailability: Risk reduced (local garbage collection protection).
-
Currently Implemented:
- Example: "IPNS is used for the application's configuration file, with signature verification in
config.go
. Pinning is used for the core binary, managed bydeploy.sh
."
- Example: "IPNS is used for the application's configuration file, with signature verification in
-
Missing Implementation:
- Example: "IPNS is not used for user-generated content. Key rotation for IPNS is not automated."
Mitigation Strategy: Redundant Pinning
Description:
- Multiple Pinning Nodes: Set up multiple
go-ipfs
nodes. - Pin to All Nodes: Pin critical data to all of these nodes using
go-ipfs pin add <CID>
on each node.
-
Threats Mitigated:
- Data Unavailability (Medium Severity): Increases the likelihood of data availability.
-
Impact:
- Data Unavailability: Risk significantly reduced due to redundancy.
-
Currently Implemented:
- Example: "Data is pinned to two geographically diverse nodes."
-
Missing Implementation:
- Example: "Automated health checks for pinning nodes are not implemented."
Mitigation Strategy: Careful Peer Selection and Bootstrapping
Description:
- Curated Bootstrap List: Create a custom list of trusted bootstrap nodes instead of using the default
go-ipfs
list. Update this list regularly. This is done by modifying theBootstrap
list in thego-ipfs
configuration file. - Peer Filtering: Use
go-ipfs
's API to filter peers based on:- Latency: Prefer low-latency peers.
- Protocols: Connect only to peers supporting necessary protocols.
- Blacklist/Whitelist: Maintain lists of known-bad/good peers (using
go-ipfs swarm peers
and related commands for management).
- Limit Connections: Configure
go-ipfs
(via the configuration file, specifically theSwarm.ConnMgr
section) to limit the number of concurrent connections. AdjustSwarm.ConnMgr.HighWater
andSwarm.ConnMgr.LowWater
.
-
Threats Mitigated:
- Connecting to Malicious Nodes (Medium Severity): Reduces the chance of connecting to malicious nodes.
- Denial-of-Service (DoS) (Low Severity): Limiting connections helps prevent resource exhaustion.
-
Impact:
- Connecting to Malicious Nodes: Risk reduced.
- Denial-of-Service (DoS): Risk slightly reduced.
-
Currently Implemented:
- Example: "A curated bootstrap list is used. Connection limits are set in the
go-ipfs
config. Latency-based filtering is inpeer_manager.go
."
- Example: "A curated bootstrap list is used. Connection limits are set in the
-
Missing Implementation:
- Example: "A peer reputation system is not implemented."
Mitigation Strategy: Rate Limiting and Resource Quotas (within go-ipfs
)
Description:
go-ipfs
Configuration: Configurego-ipfs
(via the configuration file) to limit:- Connections: Maximum concurrent connections (
Swarm.ConnMgr
). - Requests: Number of requests per peer per time unit (This is less directly configurable in
go-ipfs
itself and often requires external tools, but connection limits indirectly affect this). - Bandwidth: Inbound and outbound bandwidth per peer (
Swarm.ResourceMgr
- though fine-grained per-peer control is limited; system-level tools are often better for this). - Resource usage: Configure circuit relay v2 with reservations and limits.
- Connections: Maximum concurrent connections (
-
Threats Mitigated:
- Denial-of-Service (DoS) (Medium Severity): Prevents resource exhaustion.
-
Impact:
- Denial-of-Service (DoS): Risk reduced (within the capabilities of
go-ipfs
's internal limits).
- Denial-of-Service (DoS): Risk reduced (within the capabilities of
-
Currently Implemented:
- Example: "
go-ipfs
is configured with connection and bandwidth limits in the configuration file."
- Example: "
-
Missing Implementation:
- Example: "Fine-grained per-peer request rate limiting is not directly implemented within
go-ipfs
."
- Example: "Fine-grained per-peer request rate limiting is not directly implemented within
Mitigation Strategy: Stay Updated
Description:
- Regular Updates: Update
go-ipfs
to the latest stable version using the appropriate package manager or by downloading and installing the new version.
-
Threats Mitigated:
- Exploitation of
go-ipfs
Vulnerabilities (High Severity): Reduces the risk of exploiting known vulnerabilities.
- Exploitation of
-
Impact:
- Exploitation of
go-ipfs
Vulnerabilities: Risk significantly reduced.
- Exploitation of
-
Currently Implemented:
- Example: "A process is in place to update
go-ipfs
weekly."
- Example: "A process is in place to update
-
Missing Implementation:
- Example: "No specific examples, as this is a fundamental practice."
Mitigation Strategy: Secure Gateway Configuration (If Applicable)
Description:
- Disable Unnecessary Features: If running a gateway, disable unneeded features via command-line flags or the configuration file. For example, use
--disable-writeable-gateway
if you only need to serve content. - Authentication and Authorization: If the gateway requires administrative access, configure authentication and authorization within the
go-ipfs
configuration (though this is often better handled by a reverse proxy in front ofgo-ipfs
).
-
Threats Mitigated:
- Unauthorized Access (High Severity): Prevents unauthorized modification of the gateway.
- Exploitation of Gateway Vulnerabilities (High Severity): Reduces the attack surface.
-
Impact:
- All Threats: Risk reduced by limiting functionality and securing access.
-
Currently Implemented:
- Example: "The gateway runs with
--disable-writeable-gateway
."
- Example: "The gateway runs with
-
Missing Implementation:
- Example: "More robust authentication (beyond basic auth) within
go-ipfs
is not configured."
- Example: "More robust authentication (beyond basic auth) within