Git Product home page Git Product logo

aushape's People

Contributors

git001 avatar spbnick 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aushape's Issues

Implement support for delivery to ElasticSearch

To be able to decide on the specific JSON schema to use, implement the necessary code to support log delivery to ElasticSearch. This includes running under audispd and accepting input from it #14, outputting one message per line #5, and logging to syslog(3) #7.

Ignore EOE events

Ignore events consisting of a single EOE records, which are produced by auparse sometimes.

Consider having separate executables for streaming and converting

At the moment aushape has a single executable, which can be used for both streaming audit log to syslog (and possibly other targets) and doing single-shot conversion. This results in a somewhat complicated interface, which might be confusing and difficult to understand for new users.

Consider making two separate programs using the same library: one for single-shot conversion, another for streaming.

The benefits can be simpler interface and clearer separation of purpose. The downside can be either inability to stream an already saved file, or having the interface complexity of the streaming program to be about the same.

Differentiate between continuous and discrete outputs

Make converter differentiate between and act differently for continuous and discrete outputs. E.g. a file and a syslog output. Continuous outputs can receive data in whatever pieces, discrete outputs can receive only complete documents.

Don't assume there are only two formats

Make sure the conv code never assumes that there are only two formats possible and doesn't do something like:

if (format == AUSHAPE_FORMAT_XML) {
    /* Format is XML */
} else {
    /* *Assume* format is JSON */
}

Instead do this:

if (format == AUSHAPE_FORMAT_XML) {
    /* Format is XML */
} else if (format == AUSHAPE_FORMAT_JSON) {
    /* Format *is* JSON */
}

This way in case another format is added, there won't be a possibility of
output in mixed format.

Output raw representation as array of lines

At the moment raw representation is concatenated together with a newline at the end, which is hard to read when viewing human-oriented output.

Instead output each raw line in its own (array) element.

Consider improving formatting code structure

Consider improving formatting code structure. E.g. make an entity output code not care about entity separators, let the invoking code deal with that. Look for other logic failures.

Ignore or warn about event not being trimmed to the required maximum

As events can be sized arbitrarily by users specifying arbitrary indent sizes and long hostnames, it is not possible to guarantee a minimum event size (unless we calculate that based on other settings, which would be complicated to implement and use).

Therefore don't fail the assertion on failing to trim, but instead produce a warning somewhere or just ignore it.

Move raw record output to the event level

Since one input record can affect several output records, put the raw records directly under the event layer. This has a nice benefit of removing the need to have "fields" container in JSON, and also simplifying record collectors.

Implement reporting conversion errors in-band

Various errors can occur during conversion, such as unknown records/fields, invalid field/record format, unexpected duplicated record types, etc.

Since aushape is supposed to run reliably under auditd, and can't simply stop processing the log, it needs to handle and report those errors somewhere.

Output events which failed to parse as a special type of event, containing the raw records and description of the failure.

Limit event size

Provide an option to limit event size. Events exceeding the size can be replaced with an event with a special attribute saying event was truncated. This can be a good start. Later adaptive truncation can be implemented, such as truncating some records, perhaps with a separate record size limit, or truncating execve record argument list, also with a separate limit.

Handle repeated record types

Since JSON can't represent duplicate records in objects, and object arrays are hard to use in ElasticSearch, figure out what to do with repeated records of the same type in one event.

At the moment repeated execve records are stitched together. There are still other repeated record types: AVC (in permissive mode), PATH, and OBJ_PID (if signal is sent to multiple processes), at the least.

One option is to aggregate them, similarly to execve, but more complicated records would still have a problem of array of objects and ElasticSearch flattening.

Another option is to multiply events with repeated records, outputting each event with a single record from the sequence.

Third option is to simply output records in an array, but this will be hit hardest by ElasticSearch array flattening, and will be hard to access.

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.