Skip to content

Netlink to Audit #21

@pwrdwnsys

Description

@pwrdwnsys

I'm looking to use Netlink to read audit events. To start with, I created a loop to read packets being sent over the bound Audit socket, but nothing seems to happen after creating the NetlinkReader (I'm running a nightly debug build as root, there are audits being generated by the system). Should I be expecting to see anything coming over Netlink? Have I misunderstood the binding? Thanks.

let mut nlsock = NetlinkSocket::bind(NetlinkProtocol::Audit, 0 as u32).unwrap();
let bufsz = nlsock.getrcvbuf().expect("Couln't getrcvbuf!");
let mut nlreader = NetlinkReader::new(&mut nlsock);
while let Ok(Some(pkt)) = nlreader.read_netlink() {
	let kind = pkt.get_kind();
	println!("Got packet: {:?}", kind);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions