What are security best practices?
This document provides security best practices for developing canisters and web apps served by canisters on ICP. These best practices are mostly inspired by issues found in security reviews.
The goal of these best practices is to enable developers to identify and address potential issues early during development of new dapps, and not only in the end when (if at all) a security review is done. Ideally, this will make the development of secure dapps more efficient.
Some excellent canister best practices linked here are from effective Rust canisters and how to audit an ICP canister. The relevant sections are linked in the individual best practices.
Target audience
The target audience for these documents is any developer working on ICP canisters or web apps, and anyone who reviews of such code.
Disclaimers and limitations
The collection of best practices may grow over time. While it is useful to improve security of dapps on ICP, such a list will never be complete and will never cover all potential security concerns. For example, there will always be attack vectors very specific to a dapps use cases that cannot be covered by general best practices. Thus, following the best practices can complement, but not replace security reviews. Especially for security critical dapps, it is recommended to perform security reviews or audits. Furthermore, please note that the best practices are currently not ordered according to risk or priority.