Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
A small library for unified2 parsing in node.js. Unified2 is a common output format for network intrusion detection devices such as Snort + Suricata.
See Sourcefire's documentation for the unified2 protocol: http://manual.snort.org/node44.html
$ npm install unified2
var unified2 = require('unified2');
parser = new unified2unified2.Parser('unified2.alert.14560142132', { offset: 0 });
parser.on('data', function(data) {
// event data...
});
parser.on('error', function(error) {
// error
});
parser.on('eof', function() {
// triggered when an EOF (no data is received). Useful to save a bookmark
// when you are running in tail mode (see below).
});
parser.on('rollover', function() {
// triggered when a rollover is detected (the file shrinks in size)
});
parser.on('end', function(data) {
// triggered when parser ends (e.g., out of data)
});
parser.run()
It is often useful to wait for more data as the file is being written, e.g. by a Snort sensor.
Simply pass tail: true
in the options for the parser to wait for more logs, e.g.:
var unified2 = require('unified2');
parser = new unified2.Parser('unified2.alert.14560142132', { offset: 0, tail: true });
...
parser.run();
To stop the parser, you can do parser.stop()
which will trigger an end event.
To read the current bookmark, you can use parser.last_read_position
,
which is the offset after the last read unified2 event. Useful after a 'eof'
event or 'end' event if you wish to resume parsing again later,
you can pass this into the offset: <value>
parameter in the Parser
constructor.
pass in DEBUG=unified2
as an environment variable to turn on debug logging.
In tests, parsing happens at about ~7000k/events per second. Obviously, this slows down as you add processing and IO.
Here's reading ~4.6 MB and writing parsed objects (~34MB) to stdout.
unified2 (master*) $ time node tests/test.js > /tmp/test.js.output ~/src/unified2
node tests/test.js > /tmp/test 11.67s user 0.38s system 100% cpu 11.977 total
Right now, this is just a bare bones parser. E.g., the pcaps and extra data are not correlated with the ids event messages. This is intentional.
Please refer to Pigsty (https://github.com/threatstack/pigsty) for a more complete unified2 parser and plugin framework for handling the output.
Please use Github or email support@threatstack.com.
Copyright (C) 2013 Threat Stack, Inc (https://www.threatstack.com)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
FAQs
unified2 parser
The npm package unified2 receives a total of 6 weekly downloads. As such, unified2 popularity was classified as not popular.
We found that unified2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.