Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
log-sink-server
Advanced tools
A service for streaming, storage and query of log data.
This is the server-side implementation. For a nodejs implementation of the client-side, see log-sink.
example-config.js
to config.js
and edit what you wantnode index
or, if you have forever
, npm start
This service was created with some core design principles, explained bellow
Using a model based on streaming data reduces overhead when compared to request-response, since there is no round-trip and only one connection is kept open.
Log sink offers two live streams:
Log sink does not enforce a rigid log format, but offers some standard fields that it optimizes for. Those fields are divided in two groups:
Aside these standard fields, there is a 'anything fits' field, called extra
.
Use of standard fields is encouraged, since both transmission and query is faster and slimmer on them.
Log sink divides all log data in three groups, based on their relevance: bellow normal, normal and above normal. Logs with different relevance level are stored and indexed separately, improving querying on them.
This model was created to support a huge volume of not-so-relevant logs (eg, logs of pooling operations) mixed with some high-relevance logs (eg, logs of payments).
For more details on how storage deals with those relevance levels, read bellow.
Log sink gives native support for TLS connections, simply drop your own key and certificate path in the config.json
file. Please note that (for testing), we include a self-signed certificate. DO NOT USE them in practice, since those were made public and everybody knows its private key
The permission model is very simple and pragmatic:
node index add-user <user>
node index add-permission <user> <permission>
See CLI interface bellow for more.
Log sink uses mongoDB to store its data. This is a initial decision and may change in the future as we experiment with other tecnologies.
Logs with different relevance level are stored and indexed separately, improving querying on them. That is, logs are stored in three collections, based on their relevance.
Bellow normal and normal relevance logs are stored in capped collections, in order to avoid a huge growth in used space. High relevance logs are stored in a normal collection, so they are never removed.
The log sink software is not responsible for the database, it must be managed independently. The best topology is a replica set with the read preference set to 'secondaryPreferred'
.
The API exposed by this service is built on top of asynconnection protocol, a call-return/message protocol over tls.
The API is splitted in four parts:
The write API is also offered over HTTPS.
The log sink server offers a command line interface (CLI) to manage users and permissions. To use it, run node index [command] [args...]
in the project folder. (Use node index -h
for inline help)
The available commands are:
Add a new user to the system. All users can write data and read data created by itself. The user key (password) will be generated for you.
node index add-user <user>
Add permission for a user to read data from another one
node index add-permission <user> <permission>
Generate another password for this user. Note that it never lets you pick you own password, to avoid human laziness resulting in stupid and weak password (sorry about that)
node index change-key <user>
List all users, their permissions and last login datetime
node index list-users
remove a user from the system (their log data will be kept)
node index remove-user <user>
revoke a permission from a user to read data from another one
node index revoke-permission <user> <permission>
Since mongoDB does not allow '$' and '.' in key names, they are replaced by '\uFF0E' ($) and '\uFF04' (.) respectively. This only affects object key names in the extra field: {a: 'a.b$c'}
is fine, but {'a.b': 12}
will be saved as {'a.b': 12}
FAQs
A service for streaming, storage and query of log data
The npm package log-sink-server receives a total of 6 weekly downloads. As such, log-sink-server popularity was classified as not popular.
We found that log-sink-server demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.