Skip to content

Commit

Permalink
Hex decode name value in PATH record (#21)
Browse files Browse the repository at this point in the history
The name field (filename) contained in PATH records can be hex encoded. This updates auparse to attempt hex decoding on the field.

Fixes #20
  • Loading branch information
andrewkroh authored and ruflin committed Mar 28, 2018
1 parent ffe11fb commit 08c2cb6
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).

### Changed

- auparse - Fixed an issue where the name value was not being hex decoded from
PATH records. #20

### Deprecated

### Removed
Expand Down
1 change: 1 addition & 0 deletions auparse/auparse.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ func enrichData(msg *AuditMessage) error {
}
case AUDIT_PATH:
parseSELinuxContext("obj", msg.fields)
hexDecode("name", msg.fields)
case AUDIT_USER_LOGIN:
// acct only exists in failed logins.
hexDecode("acct", msg.fields)
Expand Down
1 change: 1 addition & 0 deletions auparse/testdata/audit-ubuntu14.log
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
type=PATH msg=audit(1521758453.536:1428931): item=0 name=2F73686172652F67656E6572616C2F706174685F7265646163746564 inode=1442434 dev=fc:01 mode=042775 ouid=10067 ogid=7003 rdev=00:00 nametype=NORMAL
19 changes: 19 additions & 0 deletions auparse/testdata/audit-ubuntu14.log.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[
{
"@timestamp": "2018-03-22T22:40:53.536Z",
"record_type": "path",
"sequence": 1428931,
"raw_msg": "audit(1521758453.536:1428931): item=0 name=2F73686172652F67656E6572616C2F706174685F7265646163746564 inode=1442434 dev=fc:01 mode=042775 ouid=10067 ogid=7003 rdev=00:00 nametype=NORMAL",
"data": {
"dev": "fc:01",
"inode": "1442434",
"item": "0",
"mode": "042775",
"name": "/share/general/path_redacted",
"nametype": "NORMAL",
"ogid": "7003",
"ouid": "10067",
"rdev": "00:00"
}
}
]

0 comments on commit 08c2cb6

Please sign in to comment.