Skip to content

Instantly share code, notes, and snippets.

View huitseeker's full-sized avatar

François Garillot huitseeker

View GitHub Profile
@jessfraz
jessfraz / proposal.md
Created February 3, 2017 00:09
High-Level Security Profile Generator

High-Level Security Profile Generator

(originally from my proposal on moby/moby#17142 (comment) but generic)

The profile would generate artificats of an apparmor profile and seccomp filters.

Obviously doesn't have to be toml since that's super hipster :p

Assumptions

  • no one is going to sit and write out all the syscalls/capabilities their app needs
  • automatic profiling would be super cool but like aa-genprof it is never
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
@rust-play
rust-play / playground.rs
Created October 3, 2019 19:12
Code shared from the Rust Playground
fn main() {
let mut last_commit_hash = HashValue::zero(); // Genesis hash
let mut last_commit_round = 0;
fn get_and_check(untrusted_store: BlockStore, hash: HashValue) -> Result<Block, Error> {
let block_candidate = untrusted_store
.get(hash)
.ok_or(format_err!("Block store is incomplete, lacks {}", hash))?;
// this calls BlockHasher::hash()
if block_candidate.hash() == hash {
@rust-play
rust-play / playground.rs
Created October 3, 2019 19:22
Code shared from the Rust Playground
fn main() {
let mut last_commit_hash = HashValue::zero(); // Genesis hash
let mut last_commit_round = 0;
fn get_and_check(untrusted_store: BlockStore, hash: HashValue) -> Result<Block, Error> {
let block_candidate = untrusted_store
.get(hash)
.ok_or(format_err!("Block store is incomplete, lacks {}", hash))?;
// this calls BlockHasher::hash()
if block_candidate.hash() == hash {