subgraph / roflcoptor

Tor Control Port Filter and State Tracker Daemon
BSD 3-Clause "New" or "Revised" License
25 stars 8 forks source link

Add "name" attribute to filter policy definition; include it when Roflcoptor logs events #58

Closed dma closed 7 years ago

dma commented 8 years ago

Roflcoptor filter policies need a name attribute for recording events to logs. Currently Roflcoptor records entries using ExePath, but this does not make sense for Oz as the "ExePath" is the same for all sandboxed apps.

In session.go:

log.Errorf("filter policy for %s DENY: %s A<-T: [%q]\n", s.policy.ExecPath, 
appName, responseStr)

The above results in log entries for events that cannot be distinguished among the Oz applications using Roflcoptor:

Sep 27 17:50:50 subgraph roflcoptor[25602]: ERRO 6ad filter policy 
for /usr/sbin/oz-daemon DENY: 
[/usr/sbin/oz-daemon] A<-T: ["650 STATUS_CLIENT NOTICE 
CIRCUIT_NOT_ESTABLISHED REASON=CLOCK_JUMPED"]

Policies should include a field that has an arbitrary value that exist for the purpose of identifying the listener to which the policy was attached when creating log entries.

david415 commented 8 years ago

my latest dev branch has got this feature addition; added Name field to policies. Name gets printed as appName in log messages. Works great with Oz apps. Need code review: https://github.com/subgraph/roflcoptor/pull/60

i think when we merge that PR we can close this ticket.