Project

General

Profile

Actions

Bug #361

closed
DB EL

AF_PACKET fails to initialize when running with limited privileges

Bug #361: AF_PACKET fails to initialize when running with limited privileges

Added by Doug Burks over 14 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
High
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

If I run Suricata with AF_PACKET as shown below, everything is fine:
suricata -c /etc/suricata/suricata.yaml --af-packet=eth0

However, if I tell Suricata to drop to a non-root user like this:
suricata --user sguil --group sguil -c /etc/suricata/suricata.yaml --af-packet=eth0

it drops the capabilities and then AF_PACKET fails to initialize.

Should Suricata initialize AF_PACKET first, and then drop capabilities?


Files

EL Updated by Eric Leblond over 14 years ago Actions #1

  • Target version changed from 1.1beta3 to 1.1rc1
  • Estimated time set to 4.00 h

VJ Updated by Victor Julien over 14 years ago Actions #2

I think the device reopening if it goes up and down won't work either after dropping privs. So we better handle that gracefully :)

EL Updated by Eric Leblond over 14 years ago Actions #3

Agreed on this point. Will have to find something clever there.

VJ Updated by Victor Julien over 14 years ago Actions #4

  • Status changed from New to Assigned
  • Priority changed from Normal to High

EL Updated by Eric Leblond over 14 years ago Actions #5

AF_PACKET behaves like pcap from a capability point of view. The attached patch just translate this in code.

VJ Updated by Victor Julien over 14 years ago Actions #6

  • Target version changed from 1.1rc1 to 1.2beta1

Applied, thanks Eric!

Leaving the ticket open for tracking the device reopening when privs have been dropped.

EL Updated by Eric Leblond over 14 years ago Actions #7

Good idea. It should work as we are not dropping the raw socket capability but nothing is better than a real test!

EL Updated by Eric Leblond over 14 years ago Actions #8

  • % Done changed from 90 to 100

Check done. This is working fine.

VJ Updated by Victor Julien over 14 years ago Actions #9

  • Status changed from Assigned to Closed
  • Target version changed from 1.2beta1 to 1.1rc1

Cool, thanks for checking.

Actions

Also available in: PDF Atom