-
Notifications
You must be signed in to change notification settings - Fork 8
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
Release 0.2.0 #44
Release 0.2.0 #44
Changes from all commits
c3344ae
bc9b041
c417b6d
a6166ac
0177e4a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,48 @@ | ||
[workspace] | ||
|
||
members = ["agent", "client", "crypto-auditing", "event-broker", "log-parser"] | ||
members = [ | ||
"agent", | ||
"agent/tests/agenttest", | ||
"client", | ||
"crypto-auditing", | ||
"event-broker", | ||
"log-parser" | ||
] | ||
resolver = "2" | ||
|
||
[workspace.package] | ||
version = "0.2.0" | ||
edition = "2021" | ||
license = "GPL-3.0-or-later" | ||
authors = ["The crypto-auditing developers"] | ||
|
||
[workspace.dependencies] | ||
anyhow = "1.0" | ||
bindgen = "0.63" | ||
bytes = "1.2" | ||
clap = "4" | ||
crypto-auditing = { version = "=0.2.0", path = "crypto-auditing" } | ||
futures = "0.3" | ||
hex = "0.4" | ||
inotify = "0.10.2" | ||
libbpf-rs = { version = "0.21", features = ["novendor"] } | ||
libbpf-cargo = { version = "0.21", features = ["novendor"] } | ||
libc = "0.2" | ||
nix = "0.26" | ||
openssl = "0.10" | ||
page_size = "0.6" | ||
probe = "0.5" | ||
plain = "0.2" | ||
serde = { version = "1.0", features = ["derive"] } | ||
serde_cbor = "0.11" | ||
serde_json = "1.0" | ||
serde_with = "3" | ||
tempfile = "3" | ||
thiserror = "1.0" | ||
time = "0.3" | ||
tokio = "1.23" | ||
tokio-serde = { version = "0.8", features = ["cbor"] } | ||
tokio-stream = "0.1" | ||
tokio-util = { version = "0.7", features = ["codec"] } | ||
toml = "0.7" | ||
tracing = "0.1" | ||
tracing-subscriber = "0.3" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,39 @@ | ||
[package] | ||
name = "crypto-auditing-agent" | ||
description = "Event collector agent for crypto-auditing project" | ||
version = "0.1.0" | ||
edition = "2021" | ||
license = "GPL-3.0-or-later" | ||
authors = ["The crypto-auditing developers"] | ||
version.workspace = true | ||
edition.workspace = true | ||
license.workspace = true | ||
authors.workspace = true | ||
|
||
[features] | ||
default = ["tokio-uring"] | ||
|
||
[dependencies] | ||
anyhow = "1.0" | ||
bytes = "1.2" | ||
clap = { version = "4", features = ["cargo", "derive"] } | ||
crypto-auditing = { version = "0.1", path = "../crypto-auditing" } | ||
futures = "0.3" | ||
libbpf-rs = { version = "0.20", features = ["novendor"] } | ||
libc = "0.2" | ||
nix = "0.26" | ||
openssl = "0.10" | ||
page_size = "0.5" | ||
serde = "1.0" | ||
serde_cbor = "0.11" | ||
time = { version = "0.3", features = ["formatting", "local-offset", "macros"] } | ||
tokio = { version = "1.23", features = ["fs", "io-util", "signal"] } | ||
anyhow.workspace = true | ||
bytes.workspace = true | ||
clap = { workspace = true, features = ["cargo", "derive"] } | ||
crypto-auditing.workspace = true | ||
futures.workspace = true | ||
libbpf-rs.workspace = true | ||
libc.workspace = true | ||
nix.workspace = true | ||
openssl.workspace = true | ||
page_size.workspace = true | ||
serde.workspace = true | ||
serde_cbor.workspace = true | ||
time = { workspace = true, features = ["formatting", "local-offset", "macros"] } | ||
tokio = { workspace = true, features = ["fs", "io-util", "signal"] } | ||
tokio-uring = { version = "0.4", optional = true } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. any reason to single it out? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to the documentation, optional dependencies cannot be declared in workspace.dependencies. |
||
toml = "0.6" | ||
tracing = "0.1" | ||
tracing-subscriber = { version = "0.3", features = ["env-filter"] } | ||
probe = "0.3" | ||
toml.workspace = true | ||
tracing.workspace = true | ||
tracing-subscriber = { workspace = true, features = ["env-filter"] } | ||
probe.workspace = true | ||
|
||
[build-dependencies] | ||
libbpf-cargo = { version = "0.20", features = ["novendor"] } | ||
libbpf-cargo.workspace = true | ||
|
||
[dev-dependencies] | ||
tempfile = "3" | ||
plain = "0.2" | ||
tempfile.workspace = true | ||
plain.workspace = true | ||
agenttest = { path = "tests/agenttest" } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,41 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
|
||
use libbpf_cargo::SkeletonBuilder; | ||
use std::{env, path::PathBuf}; | ||
|
||
const SRC: &str = "src/bpf/audit.bpf.c"; | ||
use std::{ | ||
env, | ||
fs::{self, File}, | ||
path::PathBuf, | ||
process::Command, | ||
}; | ||
|
||
fn main() { | ||
let mut out = | ||
let builddir = | ||
PathBuf::from(env::var_os("OUT_DIR").expect("OUT_DIR must be set in build script")); | ||
out.push("audit.skel.rs"); | ||
let srcdir = PathBuf::from( | ||
env::var_os("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR must be set in build script"), | ||
); | ||
|
||
let vmlinux_h = srcdir.join("src").join("bpf").join("vmlinux.h"); | ||
if vmlinux_h.exists() { | ||
fs::copy(&vmlinux_h, &builddir.join("vmlinux.h")).expect("unable to copy vmlinux.h"); | ||
} else { | ||
let file = File::create(&builddir.join("vmlinux.h")).expect("unable to create vmlinux.h"); | ||
Command::new("bpftool") | ||
.arg("btf") | ||
.arg("dump") | ||
.arg("file") | ||
.arg("/sys/kernel/btf/vmlinux") | ||
.arg("format") | ||
.arg("c") | ||
.stdout(file) | ||
.status() | ||
.expect("unable to run bpftool"); | ||
} | ||
let src = srcdir.join("src").join("bpf").join("audit.bpf.c"); | ||
SkeletonBuilder::new() | ||
.source(SRC) | ||
.build_and_generate(&out) | ||
.source(&src) | ||
.clang_args(&format!("-I{}", builddir.display())) | ||
.build_and_generate(&builddir.join("audit.skel.rs")) | ||
.unwrap(); | ||
println!("cargo:rerun-if-changed={}", SRC); | ||
println!("cargo:rerun-if-changed={}", src.display()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I know it's not changed in here, but I'd still like to ask)
is either a rather confusing feature description or a rather confusing feature. My testing seems to support the idea that the enabled feature set becomes the superset of the packages' features of the invocation. That suggests that 1.
cargo build
result would differ frommake
, 2. library featureset depends on whichever application target was built first, etc.a. Should we strive for more isolation, e.g., by building the library first in a separate invocation?
b. Given that it still doesn't guarantee we've specified the features correctly, should we, maybe, give up and define just the all-encompassing superset at the top level and at least have the consistency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if I get it right, but I can for example turn off io_uring in the agent while keeping libsystemd in the event-broker with
make RELEASE=1 CARGO_ARGS="--no-default-features --features=libsystemd"
. Isn't that sufficient?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(clarified off-PR. We don't have builds that go "one app + library" and library inheriting a featureset of whatever app is built first, as I've mistakenly thought after seeing four app targets in Makefile. We'll either build the entire workspace at once with the union-of-all featureset or build subprojects one-by-one with their individual featuresets. As long as we test all of the approaches we use, this is fine.)