Add new sections to SECURITY.md and CONTRIBUTING.md (#1408)

* Add testing to SECURITY.md

* Add White-hat Bootstrap

* Add node Makefile

* Add chain integrator guidance

* Small tweaks to language

* Tweaks to test coverage and security.md

* Add cosmwasm tests to CONTRIBUTING.md

* Fix typo

* Add deep link to CONTRIBUTING.md

* Update CONTRIBUTING.md

Co-authored-by: Jeff Schroeder <jeffschroeder@computer.org>

* Update SECURITY.md

Co-authored-by: Jeff Schroeder <jeffschroeder@computer.org>

* Update SECURITY.md

Co-authored-by: Jeff Schroeder <jeffschroeder@computer.org>

* Update SECURITY.md

Co-authored-by: Jeff Schroeder <jeffschroeder@computer.org>

* Update SECURITY.md

Co-authored-by: Jeff Schroeder <jeffschroeder@computer.org>

* Update SECURITY.md

Co-authored-by: Jeff Schroeder <jeffschroeder@computer.org>

* Update SECURITY.md

Co-authored-by: Jeff Schroeder <jeffschroeder@computer.org>

* Update SECURITY.md

Co-authored-by: Jeff Schroeder <jeffschroeder@computer.org>

* Update SECURITY.md

Co-authored-by: Jeff Schroeder <jeffschroeder@computer.org>

* Add newline to node Makefile

Co-authored-by: Jeff Schroeder <jeffschroeder@computer.org>
This commit is contained in:
Jonathan Claudius 2022-08-11 15:33:24 -04:00 committed by GitHub
parent 9bb598d949
commit 7a96b7de67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 70 additions and 0 deletions

View File

@ -87,3 +87,30 @@ You can enable it in VSCode with the following in your `settings.json`.
}
},
```
# Testing
We believe automated tests ensure the integrity of all Wormhole components. Anyone can verify or extend them transparently and they fit nicely with our software development lifecycle. This ensures Wormhole components operate as expected in both expected and failure cases.
Places to find out more about existing test coverage and how to run those tests:
- **Guardian Node**
- Tests: `./node/**/*_test.go`
- Run: `cd node && make test`
- **Ethereum Smart Contracts**
- Tests: `./ethereum/test/*.[js|sol]`
- Run: `cd ethereum && make test`
- **Solana Smart Contracts**
- Tests: `./solana/bridge/program/tests/*.rs`
- Run: `cd solana && make test`
- **Terra Smart Contracts**
- Tests: `./terra/test/*`
- Run: `cd terra && make test`
- **Terra2 Smart Contracts**
- Tests: `./cosmwasm/test/*`
- Run: `cd cosmwasm && make test`
- **Algorand Smart Contracts**
- Tests: `./algorand/test/*`
- Run: `cd algorand && make test`
The best place to understand how we invoke these tests via GitHub Actions on every commit can be found via `./.github/workflows/*.yml` and the best place to observe the results of these builds can be found via [https://github.com/certusone/wormhole/actions](https://github.com/certusone/wormhole/actions).

View File

@ -16,3 +16,43 @@ As these 3rd party audits are completed and issues are sufficiently addressed, w
- **Scopes**: *Ethereum Contracts, Solana Contracts, Terra Contracts, Guardian, and Solitaire*
- **[July 1, 2022 - Kudelski](https://storage.googleapis.com/wormhole-audits/2022-07-01_kudelski.pdf)**
- **Scopes**: *Ethereum Contracts, Solana Contracts, Terra Contracts, and Guardian*
## White-Hat Hacking on Wormhole
We want to lower the bar for White-hat hackers to find security bugs in Wormhole. Why? The easier we make this process, the more likely it will be for white-hats to find bugs in Wormhole and responsibly disclose them, helping to secure the network.
Here's a list of strategies we've found helpful for getting started on Wormhole:
- Review the existing unit and integration testing (found in [CONTRIBUTING.md](https://github.com/certusone/wormhole/blob/dev.v2/CONTRIBUTING.md)) and see what we're already testing for.
* Check out places were we might be missing test coverage entirely. This could be a ripe spot to look for something we missed.
* Check out places were we have unit/integration tests, but we lack sufficient [negative test](https://en.wikipedia.org/wiki/Negative_testing) coverage.
- Review our different smart contract implementations (eg. Solana, EVM, CosmWasm, Move) and attempt to understand how and why they are different.
* Does one chain have a safety check that another chain doesn't?
* Does one chain have a specific set of nuances / gotchas that that were missed on another chain?
- Consider going beyond the source code
* Review the deployed contracts on chain. Is something odd that we missed?
We'll continue to iterate on this list of white-hat bootstrap strategies as we grow our lessons learned internally hacking on Wormhole and from other white-hats who have been successful via our bug bounty program.
It's important to remember this is an iterative process. If you spend the time to come up with a new test case, but didn't actually find a bug, we'd be extremely appreciative if you'd be willing to send a [pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request) with additional positive and negative test cases. This process has shown repeatedly to improve your ability to understand Wormhole, and will increase your odds of success.
## Guidance to Chain Integrators
As the list of chains connected to Wormhole increases, so does the risk that a given connected could introduce risks to the Wormhole network. As a result, Wormhole does have built-in safety features (e.g.: [Governor white-paper](https://github.com/certusone/wormhole/blob/dev.v2/whitepapers/0007_governor.md)) to reduce the "blast radius" of such case. That said, a defense in depth strategy is required to do as much as possible to secure the network. As part of this methodology, the Wormhole project recommends that all connected chains current and future implement robust security programs of their own to do their part in managing chain compromise risk to the wormhole network.
Here are a few ways in which connected chains can maintain high security standards:
For source code ensure relevant bits are:
- All open source
- Audited by an independent third party with public audit reports
- Included in a public bug bounty program. The bounty rewards should be sufficiently large to incentivize white-hat mindshare in finding security bugs and responsibly disclosing them
- Version control systems contain adequate access controls and mandatory code review (e.g.: In github, use of branch protection and a minimum of one independent reviewer to merge code)
- Maintaining a [SECURITY.md](https://github.com/certusone/wormhole/blob/dev.v2/SECURITY.md) in the root of the repository (like this one) to offer guidance and transparency on security relevant topics
- Includes sufficient unit and integration test coverage (including negative tests), which are run on every commit via continuous integration. Ensure that the results of those test runs are visible to the public
Additionally, ensure:
- The Wormhole team has sufficient contact information and an associated call or page tree to reach you in the event of a security incident.
- That Wormhole has the full upgrade authority on relevant bridge contracts to act quickly in the case of a security incident.
- You have an established incident response program in place, with established patterns and playbooks to ensure deterministic outcomes for containment.
- When security issues do occur, that the chain makes every attempt to inform affected parties and leads with transparency.

3
node/Makefile Normal file
View File

@ -0,0 +1,3 @@
test:
go test -v -ldflags '-extldflags "-Wl,--allow-multiple-definition" ' ./...