syslog2cef 0.4.0__tar.gz → 0.4.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {syslog2cef-0.4.0/syslog2cef.egg-info → syslog2cef-0.4.1}/PKG-INFO +34 -24
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/README.md +31 -21
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/pyproject.toml +3 -3
- {syslog2cef-0.4.0 → syslog2cef-0.4.1/syslog2cef.egg-info}/PKG-INFO +34 -24
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/syslogcef/_version.py +1 -1
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/syslogcef/cli.py +5 -3
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/tests/test_cli.py +56 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/LICENSE +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/setup.cfg +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/syslog2cef.egg-info/SOURCES.txt +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/syslog2cef.egg-info/dependency_links.txt +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/syslog2cef.egg-info/entry_points.txt +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/syslog2cef.egg-info/requires.txt +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/syslog2cef.egg-info/top_level.txt +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/syslogcef/__init__.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/syslogcef/__main__.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/syslogcef/adaptive.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/syslogcef/api.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/syslogcef/cef.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/syslogcef/custom.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/syslogcef/dictionary.json +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/syslogcef/dictionary.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/syslogcef/mappings/__init__.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/syslogcef/mappings/cisco_asa.json +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/syslogcef/mappings/cisco_ios.json +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/syslogcef/mappings/f5.json +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/syslogcef/mappings/fortinet.json +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/syslogcef/mappings/linux.json +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/syslogcef/mappings/sophos.json +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/syslogcef/mappings/vmware.json +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/syslogcef/net.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/syslogcef/normalizer.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/syslogcef/parsers.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/syslogcef/utils.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/syslogcef/validation.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/tests/test_adaptive.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/tests/test_cef.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/tests/test_cli_validation.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/tests/test_custom_parsers.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/tests/test_dictionary.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/tests/test_fuzz_grammar.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/tests/test_fuzz_properties.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/tests/test_macos_logs.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/tests/test_net.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/tests/test_normalizer.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/tests/test_parsers.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/tests/test_parsers_extra.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/tests/test_pipeline.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/tests/test_real_world.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/tests/test_rfc5424_epoch.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/tests/test_security_hardening.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/tests/test_tail_rotation.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/tests/test_utils.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/tests/test_validation.py +0 -0
- {syslog2cef-0.4.0 → syslog2cef-0.4.1}/tests/test_zipapp_safe.py +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: syslog2cef
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.1
|
|
4
4
|
Summary: Convert RFC3164/RFC5424 syslog lines into ArcSight CEF
|
|
5
5
|
Author-email: Tamir Suliman <allamiro@gmail.com>
|
|
6
|
-
Project-URL: Homepage, https://github.com/allamiro/
|
|
7
|
-
Project-URL: Issues, https://github.com/allamiro/
|
|
6
|
+
Project-URL: Homepage, https://github.com/allamiro/syslog2cef
|
|
7
|
+
Project-URL: Issues, https://github.com/allamiro/syslog2cef/issues
|
|
8
8
|
Keywords: syslog,cef,logging,security
|
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
|
10
10
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
@@ -28,7 +28,7 @@ Requires-Dist: hypothesis>=6; extra == "fuzz"
|
|
|
28
28
|
Dynamic: license-file
|
|
29
29
|
|
|
30
30
|
<p align="center">
|
|
31
|
-
<img src="https://raw.githubusercontent.com/allamiro/
|
|
31
|
+
<img src="https://raw.githubusercontent.com/allamiro/syslog2cef/main/docs/logo.svg" alt="syslog2cef logo" width="540">
|
|
32
32
|
</p>
|
|
33
33
|
|
|
34
34
|
<p align="center">
|
|
@@ -37,16 +37,16 @@ Dynamic: license-file
|
|
|
37
37
|
<a href="https://pypi.org/project/syslog2cef/"><img src="https://img.shields.io/pypi/pyversions/syslog2cef" alt="Supported Python versions"></a>
|
|
38
38
|
<a href="https://pypistats.org/packages/syslog2cef"><img src="https://img.shields.io/pypi/dm/syslog2cef" alt="PyPI downloads per month"></a>
|
|
39
39
|
<a href="https://copr.fedorainfracloud.org/coprs/allamiro/syslogcef/"><img src="https://copr.fedorainfracloud.org/coprs/allamiro/syslogcef/package/syslogcef/status_image/last_build.png" alt="COPR build status"></a>
|
|
40
|
-
<a href="https://github.com/allamiro/syslog2cef/pkgs/container/
|
|
40
|
+
<a href="https://github.com/allamiro/syslog2cef/pkgs/container/syslog2cef"><img src="https://img.shields.io/badge/container-ghcr.io-blue?logo=docker" alt="Container image on ghcr.io"></a>
|
|
41
41
|
<a href="https://github.com/allamiro/syslog2cef/actions/workflows/fuzz.yml"><img src="https://img.shields.io/github/actions/workflow/status/allamiro/syslog2cef/fuzz.yml?branch=main&label=deep%20fuzz" alt="Deep fuzz status"></a>
|
|
42
42
|
<a href="https://github.com/astral-sh/ruff"><img src="https://img.shields.io/badge/lint-ruff-261230" alt="Linted with Ruff"></a>
|
|
43
43
|
<a href="LICENSE"><img src="https://img.shields.io/github/license/allamiro/syslog2cef" alt="MIT license"></a>
|
|
44
44
|
<a href="CITATION.cff"><img src="https://img.shields.io/badge/cite-CITATION.cff-informational" alt="Citation file"></a>
|
|
45
45
|
</p>
|
|
46
46
|
|
|
47
|
-
#
|
|
47
|
+
# syslog2cef
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
syslog2cef converts syslog events into ArcSight Common Event Format (CEF). It
|
|
50
50
|
is a small, dependency-free Python package with a command line interface,
|
|
51
51
|
built for feeding syslog data from network devices and Linux hosts into SIEM
|
|
52
52
|
platforms that consume CEF.
|
|
@@ -76,19 +76,25 @@ platforms that consume CEF.
|
|
|
76
76
|
|
|
77
77
|
## Installation
|
|
78
78
|
|
|
79
|
-
From PyPI
|
|
80
|
-
name on PyPI belongs to an unrelated project; the import package and CLI
|
|
81
|
-
are still `syslogcef`):
|
|
79
|
+
From PyPI:
|
|
82
80
|
|
|
83
81
|
```bash
|
|
84
82
|
pip install syslog2cef
|
|
85
83
|
```
|
|
86
84
|
|
|
85
|
+
> **Naming.** The project, this repository, the PyPI distribution and the
|
|
86
|
+
> RPM/DEB/APK packages are all `syslog2cef`. The command you run and the
|
|
87
|
+
> Python package you import are `syslogcef`, unchanged — as are the config
|
|
88
|
+
> paths (`/etc/syslogcef/`), the systemd units and the log directory, so
|
|
89
|
+
> upgrading from an earlier release needs no changes. The `syslogcef` name
|
|
90
|
+
> on PyPI belongs to an unrelated project, which is why the distribution
|
|
91
|
+
> has always been `syslog2cef`.
|
|
92
|
+
|
|
87
93
|
From source:
|
|
88
94
|
|
|
89
95
|
```bash
|
|
90
|
-
git clone https://github.com/allamiro/
|
|
91
|
-
cd
|
|
96
|
+
git clone https://github.com/allamiro/syslog2cef.git
|
|
97
|
+
cd syslog2cef
|
|
92
98
|
pip install .
|
|
93
99
|
```
|
|
94
100
|
|
|
@@ -96,21 +102,21 @@ The GitHub releases page also provides, for every version:
|
|
|
96
102
|
|
|
97
103
|
- An RPM package (Fedora/RHEL) with a systemd service — see "Running as a
|
|
98
104
|
Service" below.
|
|
99
|
-
- A Debian package (`
|
|
100
|
-
service: `sudo apt install ./
|
|
105
|
+
- A Debian package (`syslog2cef_X.Y.Z-1_all.deb`) with the same systemd
|
|
106
|
+
service: `sudo apt install ./syslog2cef_X.Y.Z-1_all.deb`.
|
|
101
107
|
- An Alpine APK with an OpenRC service:
|
|
102
|
-
`apk add --allow-untrusted
|
|
108
|
+
`apk add --allow-untrusted syslog2cef-X.Y.Z-r0.apk` (or install the
|
|
103
109
|
signing key from [packaging/apk/syslogcef.rsa.pub](packaging/apk/syslogcef.rsa.pub)
|
|
104
110
|
into `/etc/apk/keys/` first to verify).
|
|
105
|
-
- A standalone executable (`
|
|
106
|
-
with Python 3.9+: `chmod +x
|
|
111
|
+
- A standalone executable (`syslog2cef-X.Y.Z.pyz`) that runs on any system
|
|
112
|
+
with Python 3.9+: `chmod +x syslog2cef-X.Y.Z.pyz && ./syslog2cef-X.Y.Z.pyz`.
|
|
107
113
|
- A source zip and sdist/wheel files.
|
|
108
114
|
|
|
109
115
|
A multi-arch (amd64/arm64) container image is published to GitHub
|
|
110
116
|
Container Registry on each release:
|
|
111
117
|
|
|
112
118
|
```bash
|
|
113
|
-
docker run -i ghcr.io/allamiro/
|
|
119
|
+
docker run -i ghcr.io/allamiro/syslog2cef < /var/log/syslog
|
|
114
120
|
```
|
|
115
121
|
|
|
116
122
|
Fedora, RHEL/Alma/Rocky 9 and 10, and CentOS Stream users can install
|
|
@@ -119,9 +125,13 @@ which rebuilds automatically from every commit:
|
|
|
119
125
|
|
|
120
126
|
```bash
|
|
121
127
|
sudo dnf copr enable allamiro/syslogcef
|
|
122
|
-
sudo dnf install
|
|
128
|
+
sudo dnf install syslog2cef
|
|
123
129
|
```
|
|
124
130
|
|
|
131
|
+
The COPR project keeps its original name (`allamiro/syslogcef`) so that
|
|
132
|
+
already-enabled repositories keep working; the package it builds is
|
|
133
|
+
`syslog2cef`.
|
|
134
|
+
|
|
125
135
|
Every asset ships with a detached GPG signature (`.asc`) and is listed in
|
|
126
136
|
a signed `SHA256SUMS` file; RPMs additionally carry embedded `rpmsign`
|
|
127
137
|
signatures. The public key is committed at
|
|
@@ -130,7 +140,7 @@ signatures. The public key is committed at
|
|
|
130
140
|
## Command Line Usage
|
|
131
141
|
|
|
132
142
|
<p align="center">
|
|
133
|
-
<img src="https://raw.githubusercontent.com/allamiro/
|
|
143
|
+
<img src="https://raw.githubusercontent.com/allamiro/syslog2cef/main/docs/demo.svg" alt="Animated demo of syslog2cef converting different formats" width="820">
|
|
134
144
|
</p>
|
|
135
145
|
|
|
136
146
|
```bash
|
|
@@ -342,7 +352,7 @@ configuration in `/etc/conf.d/syslogcef`):
|
|
|
342
352
|
- `/etc/logrotate.d/syslogcef` — daily rotation for flat `.cef` archives.
|
|
343
353
|
|
|
344
354
|
```bash
|
|
345
|
-
sudo dnf install
|
|
355
|
+
sudo dnf install syslog2cef-*.rpm
|
|
346
356
|
sudo vi /etc/syslogcef/syslogcef.conf
|
|
347
357
|
sudo systemctl enable --now syslogcef
|
|
348
358
|
```
|
|
@@ -425,8 +435,8 @@ issues for security reports.
|
|
|
425
435
|
## Development
|
|
426
436
|
|
|
427
437
|
```bash
|
|
428
|
-
git clone https://github.com/allamiro/
|
|
429
|
-
cd
|
|
438
|
+
git clone https://github.com/allamiro/syslog2cef.git
|
|
439
|
+
cd syslog2cef
|
|
430
440
|
python -m venv .venv
|
|
431
441
|
source .venv/bin/activate
|
|
432
442
|
pip install -e .[test]
|
|
@@ -446,7 +456,7 @@ repository" button produces APA and BibTeX from it.
|
|
|
446
456
|
@software{suliman_syslog2cef,
|
|
447
457
|
author = {Suliman, Tamir},
|
|
448
458
|
title = {syslog2cef: Convert syslog to ArcSight Common Event Format (CEF)},
|
|
449
|
-
version = {0.4.
|
|
459
|
+
version = {0.4.1},
|
|
450
460
|
year = {2026},
|
|
451
461
|
url = {https://github.com/allamiro/syslog2cef},
|
|
452
462
|
license = {MIT}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="https://raw.githubusercontent.com/allamiro/
|
|
2
|
+
<img src="https://raw.githubusercontent.com/allamiro/syslog2cef/main/docs/logo.svg" alt="syslog2cef logo" width="540">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
@@ -8,16 +8,16 @@
|
|
|
8
8
|
<a href="https://pypi.org/project/syslog2cef/"><img src="https://img.shields.io/pypi/pyversions/syslog2cef" alt="Supported Python versions"></a>
|
|
9
9
|
<a href="https://pypistats.org/packages/syslog2cef"><img src="https://img.shields.io/pypi/dm/syslog2cef" alt="PyPI downloads per month"></a>
|
|
10
10
|
<a href="https://copr.fedorainfracloud.org/coprs/allamiro/syslogcef/"><img src="https://copr.fedorainfracloud.org/coprs/allamiro/syslogcef/package/syslogcef/status_image/last_build.png" alt="COPR build status"></a>
|
|
11
|
-
<a href="https://github.com/allamiro/syslog2cef/pkgs/container/
|
|
11
|
+
<a href="https://github.com/allamiro/syslog2cef/pkgs/container/syslog2cef"><img src="https://img.shields.io/badge/container-ghcr.io-blue?logo=docker" alt="Container image on ghcr.io"></a>
|
|
12
12
|
<a href="https://github.com/allamiro/syslog2cef/actions/workflows/fuzz.yml"><img src="https://img.shields.io/github/actions/workflow/status/allamiro/syslog2cef/fuzz.yml?branch=main&label=deep%20fuzz" alt="Deep fuzz status"></a>
|
|
13
13
|
<a href="https://github.com/astral-sh/ruff"><img src="https://img.shields.io/badge/lint-ruff-261230" alt="Linted with Ruff"></a>
|
|
14
14
|
<a href="LICENSE"><img src="https://img.shields.io/github/license/allamiro/syslog2cef" alt="MIT license"></a>
|
|
15
15
|
<a href="CITATION.cff"><img src="https://img.shields.io/badge/cite-CITATION.cff-informational" alt="Citation file"></a>
|
|
16
16
|
</p>
|
|
17
17
|
|
|
18
|
-
#
|
|
18
|
+
# syslog2cef
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
syslog2cef converts syslog events into ArcSight Common Event Format (CEF). It
|
|
21
21
|
is a small, dependency-free Python package with a command line interface,
|
|
22
22
|
built for feeding syslog data from network devices and Linux hosts into SIEM
|
|
23
23
|
platforms that consume CEF.
|
|
@@ -47,19 +47,25 @@ platforms that consume CEF.
|
|
|
47
47
|
|
|
48
48
|
## Installation
|
|
49
49
|
|
|
50
|
-
From PyPI
|
|
51
|
-
name on PyPI belongs to an unrelated project; the import package and CLI
|
|
52
|
-
are still `syslogcef`):
|
|
50
|
+
From PyPI:
|
|
53
51
|
|
|
54
52
|
```bash
|
|
55
53
|
pip install syslog2cef
|
|
56
54
|
```
|
|
57
55
|
|
|
56
|
+
> **Naming.** The project, this repository, the PyPI distribution and the
|
|
57
|
+
> RPM/DEB/APK packages are all `syslog2cef`. The command you run and the
|
|
58
|
+
> Python package you import are `syslogcef`, unchanged — as are the config
|
|
59
|
+
> paths (`/etc/syslogcef/`), the systemd units and the log directory, so
|
|
60
|
+
> upgrading from an earlier release needs no changes. The `syslogcef` name
|
|
61
|
+
> on PyPI belongs to an unrelated project, which is why the distribution
|
|
62
|
+
> has always been `syslog2cef`.
|
|
63
|
+
|
|
58
64
|
From source:
|
|
59
65
|
|
|
60
66
|
```bash
|
|
61
|
-
git clone https://github.com/allamiro/
|
|
62
|
-
cd
|
|
67
|
+
git clone https://github.com/allamiro/syslog2cef.git
|
|
68
|
+
cd syslog2cef
|
|
63
69
|
pip install .
|
|
64
70
|
```
|
|
65
71
|
|
|
@@ -67,21 +73,21 @@ The GitHub releases page also provides, for every version:
|
|
|
67
73
|
|
|
68
74
|
- An RPM package (Fedora/RHEL) with a systemd service — see "Running as a
|
|
69
75
|
Service" below.
|
|
70
|
-
- A Debian package (`
|
|
71
|
-
service: `sudo apt install ./
|
|
76
|
+
- A Debian package (`syslog2cef_X.Y.Z-1_all.deb`) with the same systemd
|
|
77
|
+
service: `sudo apt install ./syslog2cef_X.Y.Z-1_all.deb`.
|
|
72
78
|
- An Alpine APK with an OpenRC service:
|
|
73
|
-
`apk add --allow-untrusted
|
|
79
|
+
`apk add --allow-untrusted syslog2cef-X.Y.Z-r0.apk` (or install the
|
|
74
80
|
signing key from [packaging/apk/syslogcef.rsa.pub](packaging/apk/syslogcef.rsa.pub)
|
|
75
81
|
into `/etc/apk/keys/` first to verify).
|
|
76
|
-
- A standalone executable (`
|
|
77
|
-
with Python 3.9+: `chmod +x
|
|
82
|
+
- A standalone executable (`syslog2cef-X.Y.Z.pyz`) that runs on any system
|
|
83
|
+
with Python 3.9+: `chmod +x syslog2cef-X.Y.Z.pyz && ./syslog2cef-X.Y.Z.pyz`.
|
|
78
84
|
- A source zip and sdist/wheel files.
|
|
79
85
|
|
|
80
86
|
A multi-arch (amd64/arm64) container image is published to GitHub
|
|
81
87
|
Container Registry on each release:
|
|
82
88
|
|
|
83
89
|
```bash
|
|
84
|
-
docker run -i ghcr.io/allamiro/
|
|
90
|
+
docker run -i ghcr.io/allamiro/syslog2cef < /var/log/syslog
|
|
85
91
|
```
|
|
86
92
|
|
|
87
93
|
Fedora, RHEL/Alma/Rocky 9 and 10, and CentOS Stream users can install
|
|
@@ -90,9 +96,13 @@ which rebuilds automatically from every commit:
|
|
|
90
96
|
|
|
91
97
|
```bash
|
|
92
98
|
sudo dnf copr enable allamiro/syslogcef
|
|
93
|
-
sudo dnf install
|
|
99
|
+
sudo dnf install syslog2cef
|
|
94
100
|
```
|
|
95
101
|
|
|
102
|
+
The COPR project keeps its original name (`allamiro/syslogcef`) so that
|
|
103
|
+
already-enabled repositories keep working; the package it builds is
|
|
104
|
+
`syslog2cef`.
|
|
105
|
+
|
|
96
106
|
Every asset ships with a detached GPG signature (`.asc`) and is listed in
|
|
97
107
|
a signed `SHA256SUMS` file; RPMs additionally carry embedded `rpmsign`
|
|
98
108
|
signatures. The public key is committed at
|
|
@@ -101,7 +111,7 @@ signatures. The public key is committed at
|
|
|
101
111
|
## Command Line Usage
|
|
102
112
|
|
|
103
113
|
<p align="center">
|
|
104
|
-
<img src="https://raw.githubusercontent.com/allamiro/
|
|
114
|
+
<img src="https://raw.githubusercontent.com/allamiro/syslog2cef/main/docs/demo.svg" alt="Animated demo of syslog2cef converting different formats" width="820">
|
|
105
115
|
</p>
|
|
106
116
|
|
|
107
117
|
```bash
|
|
@@ -313,7 +323,7 @@ configuration in `/etc/conf.d/syslogcef`):
|
|
|
313
323
|
- `/etc/logrotate.d/syslogcef` — daily rotation for flat `.cef` archives.
|
|
314
324
|
|
|
315
325
|
```bash
|
|
316
|
-
sudo dnf install
|
|
326
|
+
sudo dnf install syslog2cef-*.rpm
|
|
317
327
|
sudo vi /etc/syslogcef/syslogcef.conf
|
|
318
328
|
sudo systemctl enable --now syslogcef
|
|
319
329
|
```
|
|
@@ -396,8 +406,8 @@ issues for security reports.
|
|
|
396
406
|
## Development
|
|
397
407
|
|
|
398
408
|
```bash
|
|
399
|
-
git clone https://github.com/allamiro/
|
|
400
|
-
cd
|
|
409
|
+
git clone https://github.com/allamiro/syslog2cef.git
|
|
410
|
+
cd syslog2cef
|
|
401
411
|
python -m venv .venv
|
|
402
412
|
source .venv/bin/activate
|
|
403
413
|
pip install -e .[test]
|
|
@@ -417,7 +427,7 @@ repository" button produces APA and BibTeX from it.
|
|
|
417
427
|
@software{suliman_syslog2cef,
|
|
418
428
|
author = {Suliman, Tamir},
|
|
419
429
|
title = {syslog2cef: Convert syslog to ArcSight Common Event Format (CEF)},
|
|
420
|
-
version = {0.4.
|
|
430
|
+
version = {0.4.1},
|
|
421
431
|
year = {2026},
|
|
422
432
|
url = {https://github.com/allamiro/syslog2cef},
|
|
423
433
|
license = {MIT}
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "syslog2cef"
|
|
7
|
-
version = "0.4.
|
|
7
|
+
version = "0.4.1"
|
|
8
8
|
description = "Convert RFC3164/RFC5424 syslog lines into ArcSight CEF"
|
|
9
9
|
authors = [{name = "Tamir Suliman", email = "allamiro@gmail.com"}]
|
|
10
10
|
readme = "README.md"
|
|
@@ -25,8 +25,8 @@ keywords = ["syslog", "cef", "logging", "security"]
|
|
|
25
25
|
dependencies = []
|
|
26
26
|
|
|
27
27
|
[project.urls]
|
|
28
|
-
Homepage = "https://github.com/allamiro/
|
|
29
|
-
Issues = "https://github.com/allamiro/
|
|
28
|
+
Homepage = "https://github.com/allamiro/syslog2cef"
|
|
29
|
+
Issues = "https://github.com/allamiro/syslog2cef/issues"
|
|
30
30
|
|
|
31
31
|
[project.optional-dependencies]
|
|
32
32
|
test = [
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: syslog2cef
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.1
|
|
4
4
|
Summary: Convert RFC3164/RFC5424 syslog lines into ArcSight CEF
|
|
5
5
|
Author-email: Tamir Suliman <allamiro@gmail.com>
|
|
6
|
-
Project-URL: Homepage, https://github.com/allamiro/
|
|
7
|
-
Project-URL: Issues, https://github.com/allamiro/
|
|
6
|
+
Project-URL: Homepage, https://github.com/allamiro/syslog2cef
|
|
7
|
+
Project-URL: Issues, https://github.com/allamiro/syslog2cef/issues
|
|
8
8
|
Keywords: syslog,cef,logging,security
|
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
|
10
10
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
@@ -28,7 +28,7 @@ Requires-Dist: hypothesis>=6; extra == "fuzz"
|
|
|
28
28
|
Dynamic: license-file
|
|
29
29
|
|
|
30
30
|
<p align="center">
|
|
31
|
-
<img src="https://raw.githubusercontent.com/allamiro/
|
|
31
|
+
<img src="https://raw.githubusercontent.com/allamiro/syslog2cef/main/docs/logo.svg" alt="syslog2cef logo" width="540">
|
|
32
32
|
</p>
|
|
33
33
|
|
|
34
34
|
<p align="center">
|
|
@@ -37,16 +37,16 @@ Dynamic: license-file
|
|
|
37
37
|
<a href="https://pypi.org/project/syslog2cef/"><img src="https://img.shields.io/pypi/pyversions/syslog2cef" alt="Supported Python versions"></a>
|
|
38
38
|
<a href="https://pypistats.org/packages/syslog2cef"><img src="https://img.shields.io/pypi/dm/syslog2cef" alt="PyPI downloads per month"></a>
|
|
39
39
|
<a href="https://copr.fedorainfracloud.org/coprs/allamiro/syslogcef/"><img src="https://copr.fedorainfracloud.org/coprs/allamiro/syslogcef/package/syslogcef/status_image/last_build.png" alt="COPR build status"></a>
|
|
40
|
-
<a href="https://github.com/allamiro/syslog2cef/pkgs/container/
|
|
40
|
+
<a href="https://github.com/allamiro/syslog2cef/pkgs/container/syslog2cef"><img src="https://img.shields.io/badge/container-ghcr.io-blue?logo=docker" alt="Container image on ghcr.io"></a>
|
|
41
41
|
<a href="https://github.com/allamiro/syslog2cef/actions/workflows/fuzz.yml"><img src="https://img.shields.io/github/actions/workflow/status/allamiro/syslog2cef/fuzz.yml?branch=main&label=deep%20fuzz" alt="Deep fuzz status"></a>
|
|
42
42
|
<a href="https://github.com/astral-sh/ruff"><img src="https://img.shields.io/badge/lint-ruff-261230" alt="Linted with Ruff"></a>
|
|
43
43
|
<a href="LICENSE"><img src="https://img.shields.io/github/license/allamiro/syslog2cef" alt="MIT license"></a>
|
|
44
44
|
<a href="CITATION.cff"><img src="https://img.shields.io/badge/cite-CITATION.cff-informational" alt="Citation file"></a>
|
|
45
45
|
</p>
|
|
46
46
|
|
|
47
|
-
#
|
|
47
|
+
# syslog2cef
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
syslog2cef converts syslog events into ArcSight Common Event Format (CEF). It
|
|
50
50
|
is a small, dependency-free Python package with a command line interface,
|
|
51
51
|
built for feeding syslog data from network devices and Linux hosts into SIEM
|
|
52
52
|
platforms that consume CEF.
|
|
@@ -76,19 +76,25 @@ platforms that consume CEF.
|
|
|
76
76
|
|
|
77
77
|
## Installation
|
|
78
78
|
|
|
79
|
-
From PyPI
|
|
80
|
-
name on PyPI belongs to an unrelated project; the import package and CLI
|
|
81
|
-
are still `syslogcef`):
|
|
79
|
+
From PyPI:
|
|
82
80
|
|
|
83
81
|
```bash
|
|
84
82
|
pip install syslog2cef
|
|
85
83
|
```
|
|
86
84
|
|
|
85
|
+
> **Naming.** The project, this repository, the PyPI distribution and the
|
|
86
|
+
> RPM/DEB/APK packages are all `syslog2cef`. The command you run and the
|
|
87
|
+
> Python package you import are `syslogcef`, unchanged — as are the config
|
|
88
|
+
> paths (`/etc/syslogcef/`), the systemd units and the log directory, so
|
|
89
|
+
> upgrading from an earlier release needs no changes. The `syslogcef` name
|
|
90
|
+
> on PyPI belongs to an unrelated project, which is why the distribution
|
|
91
|
+
> has always been `syslog2cef`.
|
|
92
|
+
|
|
87
93
|
From source:
|
|
88
94
|
|
|
89
95
|
```bash
|
|
90
|
-
git clone https://github.com/allamiro/
|
|
91
|
-
cd
|
|
96
|
+
git clone https://github.com/allamiro/syslog2cef.git
|
|
97
|
+
cd syslog2cef
|
|
92
98
|
pip install .
|
|
93
99
|
```
|
|
94
100
|
|
|
@@ -96,21 +102,21 @@ The GitHub releases page also provides, for every version:
|
|
|
96
102
|
|
|
97
103
|
- An RPM package (Fedora/RHEL) with a systemd service — see "Running as a
|
|
98
104
|
Service" below.
|
|
99
|
-
- A Debian package (`
|
|
100
|
-
service: `sudo apt install ./
|
|
105
|
+
- A Debian package (`syslog2cef_X.Y.Z-1_all.deb`) with the same systemd
|
|
106
|
+
service: `sudo apt install ./syslog2cef_X.Y.Z-1_all.deb`.
|
|
101
107
|
- An Alpine APK with an OpenRC service:
|
|
102
|
-
`apk add --allow-untrusted
|
|
108
|
+
`apk add --allow-untrusted syslog2cef-X.Y.Z-r0.apk` (or install the
|
|
103
109
|
signing key from [packaging/apk/syslogcef.rsa.pub](packaging/apk/syslogcef.rsa.pub)
|
|
104
110
|
into `/etc/apk/keys/` first to verify).
|
|
105
|
-
- A standalone executable (`
|
|
106
|
-
with Python 3.9+: `chmod +x
|
|
111
|
+
- A standalone executable (`syslog2cef-X.Y.Z.pyz`) that runs on any system
|
|
112
|
+
with Python 3.9+: `chmod +x syslog2cef-X.Y.Z.pyz && ./syslog2cef-X.Y.Z.pyz`.
|
|
107
113
|
- A source zip and sdist/wheel files.
|
|
108
114
|
|
|
109
115
|
A multi-arch (amd64/arm64) container image is published to GitHub
|
|
110
116
|
Container Registry on each release:
|
|
111
117
|
|
|
112
118
|
```bash
|
|
113
|
-
docker run -i ghcr.io/allamiro/
|
|
119
|
+
docker run -i ghcr.io/allamiro/syslog2cef < /var/log/syslog
|
|
114
120
|
```
|
|
115
121
|
|
|
116
122
|
Fedora, RHEL/Alma/Rocky 9 and 10, and CentOS Stream users can install
|
|
@@ -119,9 +125,13 @@ which rebuilds automatically from every commit:
|
|
|
119
125
|
|
|
120
126
|
```bash
|
|
121
127
|
sudo dnf copr enable allamiro/syslogcef
|
|
122
|
-
sudo dnf install
|
|
128
|
+
sudo dnf install syslog2cef
|
|
123
129
|
```
|
|
124
130
|
|
|
131
|
+
The COPR project keeps its original name (`allamiro/syslogcef`) so that
|
|
132
|
+
already-enabled repositories keep working; the package it builds is
|
|
133
|
+
`syslog2cef`.
|
|
134
|
+
|
|
125
135
|
Every asset ships with a detached GPG signature (`.asc`) and is listed in
|
|
126
136
|
a signed `SHA256SUMS` file; RPMs additionally carry embedded `rpmsign`
|
|
127
137
|
signatures. The public key is committed at
|
|
@@ -130,7 +140,7 @@ signatures. The public key is committed at
|
|
|
130
140
|
## Command Line Usage
|
|
131
141
|
|
|
132
142
|
<p align="center">
|
|
133
|
-
<img src="https://raw.githubusercontent.com/allamiro/
|
|
143
|
+
<img src="https://raw.githubusercontent.com/allamiro/syslog2cef/main/docs/demo.svg" alt="Animated demo of syslog2cef converting different formats" width="820">
|
|
134
144
|
</p>
|
|
135
145
|
|
|
136
146
|
```bash
|
|
@@ -342,7 +352,7 @@ configuration in `/etc/conf.d/syslogcef`):
|
|
|
342
352
|
- `/etc/logrotate.d/syslogcef` — daily rotation for flat `.cef` archives.
|
|
343
353
|
|
|
344
354
|
```bash
|
|
345
|
-
sudo dnf install
|
|
355
|
+
sudo dnf install syslog2cef-*.rpm
|
|
346
356
|
sudo vi /etc/syslogcef/syslogcef.conf
|
|
347
357
|
sudo systemctl enable --now syslogcef
|
|
348
358
|
```
|
|
@@ -425,8 +435,8 @@ issues for security reports.
|
|
|
425
435
|
## Development
|
|
426
436
|
|
|
427
437
|
```bash
|
|
428
|
-
git clone https://github.com/allamiro/
|
|
429
|
-
cd
|
|
438
|
+
git clone https://github.com/allamiro/syslog2cef.git
|
|
439
|
+
cd syslog2cef
|
|
430
440
|
python -m venv .venv
|
|
431
441
|
source .venv/bin/activate
|
|
432
442
|
pip install -e .[test]
|
|
@@ -446,7 +456,7 @@ repository" button produces APA and BibTeX from it.
|
|
|
446
456
|
@software{suliman_syslog2cef,
|
|
447
457
|
author = {Suliman, Tamir},
|
|
448
458
|
title = {syslog2cef: Convert syslog to ArcSight Common Event Format (CEF)},
|
|
449
|
-
version = {0.4.
|
|
459
|
+
version = {0.4.1},
|
|
450
460
|
year = {2026},
|
|
451
461
|
url = {https://github.com/allamiro/syslog2cef},
|
|
452
462
|
license = {MIT}
|
|
@@ -5,7 +5,7 @@ suite). A module constant rather than importlib.metadata, because the
|
|
|
5
5
|
standalone .pyz has no installed distribution metadata to read.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
__version__ = "0.4.
|
|
8
|
+
__version__ = "0.4.1"
|
|
9
9
|
__author__ = "Tamir Suliman"
|
|
10
10
|
__email__ = "allamiro@gmail.com"
|
|
11
11
|
__copyright__ = "Copyright (c) 2023 Tamir Suliman"
|
|
@@ -396,10 +396,12 @@ VERSION_TEXT = (
|
|
|
396
396
|
|
|
397
397
|
|
|
398
398
|
def main(argv: Optional[list[str]] = None) -> int:
|
|
399
|
-
#
|
|
400
|
-
#
|
|
401
|
-
#
|
|
399
|
+
# prog is explicit so "python -m syslogcef --help" reports the command
|
|
400
|
+
# name rather than "__main__.py". RawDescriptionHelpFormatter keeps
|
|
401
|
+
# VERSION_TEXT's line breaks; argparse otherwise reflows the version
|
|
402
|
+
# string onto one line. Option help is still wrapped as before.
|
|
402
403
|
parser = argparse.ArgumentParser(
|
|
404
|
+
prog="syslogcef",
|
|
403
405
|
description="Convert syslog lines to ArcSight CEF",
|
|
404
406
|
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
405
407
|
)
|
|
@@ -178,6 +178,62 @@ def test_cli_output_template_end_to_end(tmp_path: Path):
|
|
|
178
178
|
assert "CEF:0" in files[0].read_text(encoding="utf-8")
|
|
179
179
|
|
|
180
180
|
|
|
181
|
+
def test_cli_reports_the_command_name_not_the_module_file():
|
|
182
|
+
# "python -m syslogcef --help" used to report "usage: __main__.py".
|
|
183
|
+
import subprocess
|
|
184
|
+
import sys
|
|
185
|
+
|
|
186
|
+
out = subprocess.run(
|
|
187
|
+
[sys.executable, "-m", "syslogcef", "--help"],
|
|
188
|
+
capture_output=True, text=True, check=True,
|
|
189
|
+
).stdout
|
|
190
|
+
assert out.startswith("usage: syslogcef ")
|
|
191
|
+
assert "__main__.py" not in out
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
def test_man_page_source_field_names_the_project():
|
|
195
|
+
# The third .TH field is the source package, which is syslog2cef; the
|
|
196
|
+
# page name stays SYSLOGCEF because that is the command.
|
|
197
|
+
from pathlib import Path
|
|
198
|
+
|
|
199
|
+
first = Path(__file__).resolve().parent.parent.joinpath(
|
|
200
|
+
"packaging/rpm/syslogcef.1"
|
|
201
|
+
).read_text().splitlines()[0]
|
|
202
|
+
assert first.startswith(".TH SYSLOGCEF 1 ")
|
|
203
|
+
assert '"syslog2cef ' in first
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
def test_external_resource_names_are_not_renamed():
|
|
207
|
+
"""Names owned by external services keep their original spelling.
|
|
208
|
+
|
|
209
|
+
The GitHub repository rename does not rename the COPR project or the
|
|
210
|
+
signing keys, and a blanket search-and-replace across the docs silently
|
|
211
|
+
turns those into dead references.
|
|
212
|
+
"""
|
|
213
|
+
from pathlib import Path
|
|
214
|
+
|
|
215
|
+
root = Path(__file__).resolve().parent.parent
|
|
216
|
+
readme = root.joinpath("README.md").read_text()
|
|
217
|
+
assert "copr.fedorainfracloud.org/coprs/allamiro/syslogcef/" in readme
|
|
218
|
+
assert "dnf copr enable allamiro/syslogcef" in readme
|
|
219
|
+
# No COPR reference may point at the non-existent renamed project.
|
|
220
|
+
assert "coprs/allamiro/syslog2cef" not in readme
|
|
221
|
+
assert "copr enable allamiro/syslog2cef" not in readme
|
|
222
|
+
assert root.joinpath("packaging/rpm/RPM-GPG-KEY-syslogcef").exists()
|
|
223
|
+
assert root.joinpath("packaging/apk/syslogcef.rsa.pub").exists()
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
def test_changelog_history_is_not_rewritten():
|
|
227
|
+
# Entries predating 0.4.1 must keep the names that were true then.
|
|
228
|
+
from pathlib import Path
|
|
229
|
+
|
|
230
|
+
text = Path(__file__).resolve().parent.parent.joinpath("CHANGELOG.md").read_text()
|
|
231
|
+
history = text.split("## [0.4.0]", 1)[1]
|
|
232
|
+
assert "ghcr.io/allamiro/syslogcef" in history
|
|
233
|
+
assert "`allamiro/syslogcef`" in history
|
|
234
|
+
assert "ghcr.io/allamiro/syslog2cef" not in history
|
|
235
|
+
|
|
236
|
+
|
|
181
237
|
def _run_cli(*args: str) -> subprocess.CompletedProcess:
|
|
182
238
|
return subprocess.run(
|
|
183
239
|
[sys.executable, "-m", "syslogcef", *args],
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|