> Application software |
> Mobile app, software designed to run on smartphones and other mobile devices |
> Web application or web app, software designed to run inside a web browser |
To Bundle, or Not to Bundle?
Web vs Native
Trust boundary is a term used in computer science and security which describes a boundary where program data or execution changes its level of "trust," or where two principals with different capabilities exchange data or commands. (Wikipedia)
Communication across Trust Boundaries
#[tauri::command]
fn my_greeting(message: String) -> String {
format!("{message} from Rust!")
}
invoke('my_greeting'{ message: 'Hello!' }).then((greeting) => console.log(greeting))
Getting Beyond Basics
You can't trust anything!
Finding The Balance
Just Put It in a Box
Reasonable Applications
Define Command Exposure
[[permission]]
identifier = "my-permission"
description = "Reading files is only exposed on Windows"
platforms = ["Windows"]
commands.allow = [
"fs:read_file"
]
Define Fine Grained Access
[[scope.allow]]
path = "$HOME/*"
[[scope.deny]]
path = "$HOME/secret"
{
"identifier": "mobile-capability",
"windows": ["main"],
"platforms": ["iOS", "android"],
"permissions": [
"nfc:allow-scan",
"biometric:allow-authenticate",
"barcode-scanner:allow-scan"
]
}
Frontend Developer's Hidden Power
First Layer of Defense
default-src 'self'; connect-src ipc: http://ipc.localhost
The Weakest Link Defines Security
The Fragile Shoulders You Stand on
cargo audit
, cargo auditable
, cargo vet
, cargo crev
& cargo-supply-chain
npm audit
That's it?
It's Your Responsibility
Code Execution Everywhere
main.rs
fn main() {
// Super safe to run me!
println!("Hello, world!");
}
Hello, world!
warning: rust-build-demo@0.1.0: PWNED
Hello, world!
build.rs
fn main() {
println!("cargo:warning=PWNED");
// go wild here
}
A Developers Nightmare
dev.env
prod.env
idontknow.env
Trust, Trust, Trust?!
The Same As Always, Please!
# Keep This Secret!!!
PROD_SECRET="Correct Horse Battery Staple"
It's Too Late Now, But it's Okay