Project

General

Profile

Actions

Bug #361

closed

AF_PACKET fails to initialize when running with limited privileges

Added by Doug Burks about 13 years ago. Updated about 13 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

Actions #1

Updated by Eric Leblond about 13 years ago

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

Updated by Victor Julien about 13 years ago

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

Actions #3

Updated by Eric Leblond about 13 years ago

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

Actions #4

Updated by Victor Julien about 13 years ago

  • Status changed from New to Assigned
  • Priority changed from Normal to High
Actions #5

Updated by Eric Leblond about 13 years ago

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

Actions #6

Updated by Victor Julien about 13 years ago

  • 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.

Actions #7

Updated by Eric Leblond about 13 years ago

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

Actions #8

Updated by Eric Leblond about 13 years ago

  • % Done changed from 90 to 100

Check done. This is working fine.

Actions #9

Updated by Victor Julien about 13 years ago

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

Cool, thanks for checking.

Actions

Also available in: Atom PDF