Git Product home page Git Product logo

audit-go's Introduction

#Linux Audit Heka Plugin (GO)

Note:

The project has now been divided into two parts, the API to deal with linux kernel audit framework is now provided by libaudit-go (in current development) and the client (audit-go) which provides an example to leverage libaudit-go.


This project aims to deliver the same functionality as Linux Audit (auditd, audispd) + audisp-cef/json but in native Go as a plugin to Heka.

Currently the project listen for events from the kernel via the Netlink protocol and parse the messages and save them in /tmp/log.

Currently the Heka plugin is provided externally. Heka reads input using Logstreamer from the file saved by audit-go and uses a custom lua decoder (SandBoxed decoder in Heka) defined in audit_decoder.lua which parses the audit messages and convert them to Heka Messages.

The messages are then converted to JSON format using ESJsonEncoder of Heka.

To run with heka:

  • Move the decoder to decoders directory of Heka.

    cp audit_decoder.lua /usr/share/heka/lua_decoders/

  • Run heka with the config file heka.toml.

hekad -config=heka.toml

  • You can change the config settings as per your convenience and enable additional outputs in Heka. For example, to feed the JSON messages to an Elasticsearch server, uncomment lines 68-73 in heka.toml (assuming the ES server is running on localhost:9200).

Goals:

  • To reduce complexity while integrating with log aggregation, visualization tools (eg. Kibana) and security tools (eg. MozDef).
  • Easier configuration and rule management.

###Project Wiki

Feedback

Open an issue https://github.com/mozilla/audit-go/issues to report a bug or request a new feature. Other comments and suggestions can be directly emailed to the authors.

audit-go's People

Contributors

aalekh avatar arunk-s avatar hardikj avatar hxjuneja avatar jvehent avatar mozilla-github-standards avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

audit-go's Issues

libaudit.go errors

Running the code manually often gives me errors like the one bellow :

2015/01/26 15:55:35 Acknowledged!!
2015/01/26 15:55:35 NLMSG_ERROR Received..
2015/01/26 15:55:35 Enabled Audit!!
2015/01/26 15:55:35 Acknowledged!!
2015/01/26 15:55:35 Acknowledged!!
2015/01/26 15:55:35 Acknowledged!!
2015/01/26 15:55:35 Set pid successful!!
2015/01/26 15:55:35 Deleting all rules
2015/01/26 15:55:35 NLMSG_ERROR

unexpected fault address 0x0
fatal error: fault
[signal 0xb code=0x80 addr=0x0 pc=0x42b124]

goroutine 16 [running]:
runtime.throw(0x5d20a2)
/usr/lib/golang/src/pkg/runtime/panic.c:520 +0x69 fp=0x7fbb8870a2e8 sp=0x7fbb8870a2d0
runtime.sigpanic()
/usr/lib/golang/src/pkg/runtime/os_linux.c:240 +0x13f fp=0x7fbb8870a300 sp=0x7fbb8870a2e8
runtime.memmove(0xc208017190, 0x6f70732f7261762f, 0x13)
/usr/lib/golang/src/pkg/runtime/memmove_amd64.s:141 +0x214 fp=0x7fbb8870a308 sp=0x7fbb8870a300
_/audit-go/netlinkAudit.(*AuditRuleData).ToWireFormat(0xc208060010, 0x0, 0x0, 0x0)
/audit-go/netlinkAudit/libaudit.go:96 +0x34d fp=0x7fbb8870a3a8 sp=0x7fbb8870a308
_/audit-go/netlinkAudit.AuditDeleteRuleData(0xc20803e020, 0xc208060010, 0x200000004, 0x0, 0x0)
/audit-go/netlinkAudit/libaudit.go:732 +0x19c fp=0x7fbb8870a8d0 sp=0x7fbb8870a3a8
_/audit-go/netlinkAudit.DeleteAllRules(0xc20803e020, 0x0, 0x0)
/audit-go/netlinkAudit/libaudit.go:805 +0xa32 fp=0x7fbb8870aa90 sp=0x7fbb8870a8d0
_/audit-go/netlinkAudit.SetRules(0xc20803e020, 0x0, 0x0)
/audit-go/netlinkAudit/libaudit.go:866 +0x4a7 fp=0x7fbb8870ae70 sp=0x7fbb8870aa90
main.main()
/audit-go/main.go:53 +0x867 fp=0x7fbb8870af50 sp=0x7fbb8870ae70
runtime.main()
/usr/lib/golang/src/pkg/runtime/proc.c:247 +0x11a fp=0x7fbb8870afa8 sp=0x7fbb8870af50
runtime.goexit()
/usr/lib/golang/src/pkg/runtime/proc.c:1445 fp=0x7fbb8870afb0 sp=0x7fbb8870afa8
created by _rt0_go
/usr/lib/golang/src/pkg/runtime/asm_amd64.s:97 +0x120

goroutine 17 [runnable]:
runtime.MHeap_Scavenger()
/usr/lib/golang/src/pkg/runtime/mheap.c:507
runtime.goexit()
/usr/lib/golang/src/pkg/runtime/proc.c:1445

goroutine 18 [runnable]:
bgsweep()
/usr/lib/golang/src/pkg/runtime/mgc0.c:1976
runtime.goexit()
/usr/lib/golang/src/pkg/runtime/proc.c:1445

goroutine 19 [runnable]:
runfinq()
/usr/lib/golang/src/pkg/runtime/mgc0.c:2606
runtime.goexit()
/usr/lib/golang/src/pkg/runtime/proc.c:1445
exit status 2

Goaudit log file is generating as binary file

Go-audit log files are generating as a binary file. whenever we try to open the file we are prompted with below message.

"goaudit.log" may be a binary file. See it anyway?

If we give "yes" and we can able to view but the contents are filled with some junk characters(^@^@^@^@^@^@^@^@^@^) for few pages. After scrolling few pages down then we can able to view the actual logs.

Can you suggest us how to avoid junk characters getting appended to the log file?

Also let us know why the file format is showing as binary file?

CODE_OF_CONDUCT.md file missing

As of January 1 2019, Mozilla requires that all GitHub projects include this CODE_OF_CONDUCT.md file in the project root. The file has two parts:

  1. Required Text - All text under the headings Community Participation Guidelines and How to Report, are required, and should not be altered.
  2. Optional Text - The Project Specific Etiquette heading provides a space to speak more specifically about ways people can work effectively and inclusively together. Some examples of those can be found on the Firefox Debugger project, and Common Voice. (The optional part is commented out in the raw template file, and will not be visible until you modify and uncomment that part.)

If you have any questions about this file, or Code of Conduct policies and procedures, please see Mozilla-GitHub-Standards or email [email protected].

(Message COC001)

Add support for all Message Types in Getreply endpoint

basically eliminate-

2015/11/20 15:34:23 Unknown: 1327
2015/11/20 15:35:11 Unknown: 1326
2015/11/20 15:35:53 Unknown: 1326
2015/11/20 15:36:18 Unknown: 1326
2015/11/20 15:36:23 Unknown: 1326
2015/11/20 15:36:23 Unknown: 1326
2015/11/20 15:36:29 Unknown: 1326

Stream events from go-audit files to s3 bucket

Hi,

Is there any way to stream events from go-audit log files to s3 bucket in realtime? Can you suggest how this can be achieved. Couldn't find any plugins relevant to this feature enabled with go-audit or will it be achieved only via any third party tools like logstash or anything else. Kindly suggest.

audit_constant.go constants

I did notice that from time to time the MAX_AUDIT_MESSAGE_LENGTH is exceeded. What is a safe value there ? Will this options be documented ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.