
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
syslog-protocol
Advanced tools
![NPM version][npm-badge] [npm-badge]: https://badge.fury.io/js/syslog-protocol.png
SyslogProtocol.js is a Syslog (RFC 3164) format parser that supports high-precision timestamps (RFC 3339, ISO 8601).
Given a Syslog message with a high-precision timestamp:
<38>1987-06-18T15:20:30.337Z server sshd[42]: Accepted publickey for user
It'll return the following object (with time being an instance of Date):
{ facility: "auth",
facilityCode: 4,
severity: "info",
severityCode: 6,
time: new Date("1987-06-18T15:20:30.337Z"),
host: "server",
process: "sshd",
pid: 42,
message: "Accepted publickey for user" }
Ironically, SyslogProtocol.js does not support plain RFC 3164's timestamps, which are in who-knows-what time zone and lack a year part. If you can, don't use them. If you're really keen on them, please let me know and I'll see about implementing.
RSYSLOG_ForwardFormat uses those.<syslog.h> and
syslog(3) compatible.npm install syslog-protocol
Just require SyslogProtocol.js and use its parse function:
var SyslogProtocol = require("syslog-protocol")
var msg = "<38>1987-06-18T15:20:30.337Z server sshd[42]: Accepted publickey"
SyslogProtocol.parse(msg)
SyslogProtocol.js can also handle alphanumeric process identifiers (sshd[foo]).
For example, given Heroku's forwarded log:
<158>1987-06-18T15:20:30.337Z d.550e8400-e29b-41d4-a716-446655440000 heroku[router] at=info method=GET path=/
SyslogProtocol.js will return:
{ facility: "local3",
facilityCode: 19,
severity: "info",
severityCode: 6,
time: new Date("1987-06-18T15:20:30.337Z"),
host: "d.550e8400-e29b-41d4-a716-446655440000",
process: "heroku",
pid: "router",
message: "at=info method=GET path=/" }
The returned object from parse has the following properties:
| Property | Description |
|---|---|
| facility | Facility name. See below for a full list of facilities. |
| facilityCode | Facility numeric code. |
| severity | Severity name. See below for a full list of severities. |
| severityCode | Severity numeric code. |
| time | Date instance from the timestamp. |
| host | Hostname or IP address. |
| process | Process name. |
| pid | Process identifier (taken from brackets after process name). If the message lacks one, pid won't be set at all.If it looks like a number, it'll be cast to Number. |
| message | Rest of the message. |
Facility names returned by SyslogProtocol.js match <syslog.h> and
syslog(3).
| Code | Facility |
|---|---|
| 0 | kern |
| 1 | user |
| 2 | |
| 3 | daemon |
| 4 | auth |
| 5 | syslog |
| 6 | lpr |
| 7 | news |
| 8 | uucp |
| 9 | cron |
| 10 | authpriv |
| 11 | ftp |
| 12 | ntp |
| 13 | logaudit |
| 14 | logalert |
| 15 | clock |
| 16 | local0 |
| 17 | local1 |
| 18 | local2 |
| 19 | local3 |
| 20 | local4 |
| 21 | local5 |
| 22 | local6 |
| 23 | local7 |
Severity names returned by SyslogProtocol.js match <syslog.h> and
syslog(3).
Blame them for the inconsistent naming.
| Code | Severity |
|---|---|
| 0 | emerg |
| 1 | alert |
| 2 | crit |
| 3 | err |
| 4 | warning |
| 5 | notice |
| 6 | info |
| 7 | debug |
SyslogProtocol.js is released under a Lesser GNU Affero General Public License, which in summary means:
For more convoluted language, see the LICENSE file.
Andri Möll typed this and the code.
Monday Calendar supported the engineering work.
If you find SyslogProtocol.js needs improving, please don't hesitate to type to me now at andri@dot.ee or create an issue online.
FAQs
Syslog (RFC 3164) parser. Works with RFC 3339/ISO 8601 timestamps.
The npm package syslog-protocol receives a total of 14 weekly downloads. As such, syslog-protocol popularity was classified as not popular.
We found that syslog-protocol 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.