Граф коммитов

13 Коммитов

Автор SHA1 Сообщение Дата
Aaron Meihm ebfabc8fed add ErrorAuditParse which describes parser errors
Add ErrorAuditParse which is a custom error type that includes the audit
message that could'nt be parser, for inspection by calling programs.
2017-08-28 15:31:23 -05:00
Aaron Meihm 9c7dede7ab when creating field map, provide a size hint 2017-08-25 10:58:16 -05:00
Aaron Meihm cea48bb842 if interpret is set, don't delay interpretation of field values
Interpret field values immediately before setting them in the map,
avoids requiring iteration over the map keys and subsequent value
reassignment.
2017-08-24 16:42:05 -05:00
Aaron Meihm 6e4cfa3119 correct spelling for fixPunctuations 2017-08-24 10:57:48 -05:00
Aaron Meihm 909b2c086a minor cleanup in parser 2017-08-24 10:55:55 -05:00
Aaron Meihm 9ebea7bb56 remove regex parser 2017-08-23 17:05:08 -05:00
Aaron Meihm 288d90b4cd add license header to source, remove example from package comments 2017-08-23 09:36:27 -05:00
Arun Sori c9100b8a77 Remove stripping of double quotes from audit fields
Fix bug in setting of raw msg in AuditEvent [earlier the raw message was
stripped off]
Reason for stripping: It leads to bugs while parsing AUDIT_EXECVE argc
fields and quotes are used there as indication to left the field as is,
otherwise they are treated as hex encoded.
Update parser tests to reflect the same.(Note: Tests avoid interpretation
of fields as different systems will lead to different names, eg: uid=>1000
will translate differently on different systems.
2016-08-10 23:42:33 +05:30
Arun Sori ad0e284a73 Move field look up tables under a common directory (see #15) 2016-07-29 01:01:22 +05:30
Arun Sori 7c3a5396cd Change exported internal functions and types to unexported
Reason: We had a lot of exported functions that are used for internal
purposes and would not make sense directly on the client side. One such
example can be of auditRuleFieldPairData where we are setting the fields
of the rule struct according to passed operator, flags and field values.
It is unnecessary to expose such complex API to the user as they would
hardly use them.
Things that have been unexported:
fieldType => denoting the integer values of audit rule fields
type* => particular field types such as typeA0.
interpretField() => translates the encoded field values to simple strings
auditStatus => c compatible struct used for sending status messages to audit framework
auditGetReply() => used for receiving acks/replies from kernel
auditRuleData => c compatible struct used for storing audit rules
fieldArray => internal type to hold array of field values
fmap => internal type denoting a particular field
auditDeleteRuleData() => used for deleting rules: marks auditRuleData and send them to kernel
auditRuleSyscallData() => makes changes in auditRuleData according to syscall number
auditNameToFtype() => converts string fieldtypes to integer counterparts
auditRuleFieldPairData()
auditAddRuleData() => used for adding rules: marks auditRuleData and send them to kernel
auditSetupAndAddWatchDir() => marks auditRuleData to include watch params
auditAddWatchDir() => internal function for auditSetupAndAddWatchDir()
auditSetupAndUpdatePerms() => marks auditRuleData to include perms string
auditUpdateWatchPerms() => internal function for auditSetupAndUpdatePerms()
2016-07-28 01:57:28 +05:30
Arun Sori 0a45716ac1 Replace logging of warnings by errors, Fix typos in error strings, comments 2016-07-23 00:31:36 +05:30
Arun Sori 1b7ecea957 Add better error reporting in library 2016-07-21 23:58:06 +05:30
Arun Sori c266d65335 Add Changes done in GSoC'16
Add native parser for audit messages and test cases for parser, for performance benefits
Add interpretation support for audit message fields (further support can be added as needed)
Remove json files and include the tables directly as Go variables
Change package name to libaudit
2016-07-17 13:28:59 +05:30