Skip to content
Merged
Show file tree
Hide file tree
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
106 changes: 100 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ serde = { version = "1.0", features = ["derive", "rc"] }
serde_cbor = "0.11"
serde_json = "1.0"
serde_with = "3"
sysinfo = "0.38"
tempfile = "3"
thiserror = "1.0"
time = "0.3"
Expand Down
8 changes: 4 additions & 4 deletions agent/src/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use anyhow::{Context as _, Result, bail};
use core::future::Future;
use crypto_auditing::types::{ContextID, EventGroup};
use crypto_auditing::types::{ContextId, EventGroup};
use libbpf_rs::{
RingBufferBuilder,
skel::{OpenSkel, SkelBuilder},
Expand Down Expand Up @@ -46,7 +46,7 @@ fn bump_memlock_rlimit() -> Result<()> {
Ok(())
}

fn encrypt_context(key: impl AsRef<[u8]>, context: &ContextID) -> Result<ContextID> {
fn encrypt_context(key: impl AsRef<[u8]>, context: &ContextId) -> Result<ContextId> {
let cipher = Cipher::aes_128_ecb();
let mut encryptor = Crypter::new(cipher, Mode::Encrypt, key.as_ref(), None).unwrap();
encryptor.pad(false);
Expand Down Expand Up @@ -237,7 +237,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
}

// Encrypt context IDs that appear in the event read
if let Err(e) = group.encrypt_context(|context: &mut ContextID| {
if let Err(e) = group.encrypt_context(|context: &mut ContextId| {
*context = encrypt_context(&encryption_key[..], context)?;
Ok(())
}) {
Expand Down Expand Up @@ -303,7 +303,7 @@ mod tests {
let mut group =
EventGroup::from_bytes(&buffer).expect("unable to deserialize to EventGroup");
group
.encrypt_context(|context: &mut ContextID| {
.encrypt_context(|context: &mut ContextId| {
*context = encrypt_context(&encryption_key[..], context)?;
Ok(())
})
Expand Down
1 change: 1 addition & 0 deletions crypto-auditing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ libc.workspace = true
serde.workspace = true
serde_cbor.workspace = true
serde_with = { workspace = true, features = ["hex"] }
sysinfo.workspace = true
thiserror.workspace = true
tokio = { workspace = true, features = ["net", "rt"] }
tokio-serde.workspace = true
Expand Down
Loading