Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds initial content for Rust and Go #18

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions docs/best-practice-memory-safe-by-default-languages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Best Practices - Memory-Safe By Default Languages

While Memory-Safe by default languages are, by definition, memory safe by default, there are ways that the can be used unsafely (or less safely). Here are best developer practices for using these languages.

## Python

TO DO

## Rust

* Use unsafe blocks sparingly and follow careful practices - see [The Rustonomicon](https://doc.rust-lang.org/nomicon/intro.html)
* When using unsafe code in Rust, the safety boundary is the module boundary. When examining snippets of unsafe code in Rust, you generally need to assess the entire module in which the unsafe code appears. [Source](https://github.com/ossf/Memory-Safety/issues/15#issuecomment-1847939439)
* Avoid using the [no_mangle](https://github.com/rust-lang/rust/issues/28179) attribute

## Go

* Using the [unsafe package](https://pkg.go.dev/unsafe#pkg-overview) is sometimes necessary when using C from Go. Be careful (TO DO: Add more about how to be careful)
* Use the [Go data race detector](https://go.dev/doc/articles/race_detector) to check for data race conditions
* Follow the [Security Best Practices for Go Developers](https://go.dev/doc/security/best-practices)

## .NET

TO DO

## Java

TO DO