https://github.com/copyleftdev/osilog
a simple osi layer log util
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.5%) to scientific vocabulary
Keywords
Repository
a simple osi layer log util
Basic Info
Statistics
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
Readme.md
osilog

osilog is a powerful network monitoring tool designed to capture and analyze network packets. It provides detailed insights into network activities, including TCP, UDP, ICMP, and ARP packets, with advanced logging features. Additionally, osilog can detect SSL/TLS handshake issues and alerts, making it an invaluable tool for network engineers and DevOps professionals.
Features
- Network Packet Capture: Captures TCP, UDP, ICMP, and ARP packets.
- TLS/SSL Detection: Identifies and logs TLS handshake messages and alerts.
- Structured Logging: Uses
logrusfor color-coded and emoji-enhanced logs. - Log Level Filtering: Allows filtering logs by severity (info, warn, error).
Installation
Prerequisites
- Go 1.18 or higher
- libpcap (required for
gopacket)
Build from Source
- Clone the repository:
sh
git clone https://github.com/copyleftdev/osilog.git
cd osilog
- Build the project:
sh
go build -o osilog main.go
- Run the tool:
sh
sudo ./osilog --interface <your-network-interface>
Usage
Command-line Options
--interface,-i: Specify the network interface to capture packets from (required).--loglevels,-l: Set log levels to filter output (default:info). Possible values:info,warn,error.
Examples
- Capture packets on interface
enp0s3and show all log levels:
sh
sudo ./osilog --interface enp0s3
- Capture packets on interface
enp0s3and filter logs to show warnings and errors only:
sh
sudo ./osilog --loglevels warn,error --interface enp0s3
Log Output
The tool uses logrus for structured logging with color coding and emojis for better readability. Here are some examples of the log output:
- Info:
[2024-07-12T20:06:17-07:00] INFO 📦 Packet captured timestamp=2024-07-12T20:06:17-07:00 length=123
- Warning:
[2024-07-12T20:06:17-07:00] WARN 🚨 TCP Reset (RST) detected src_ip=192.168.0.35 src_port=55092 dst_ip=172.64.155.141 dst_port=443
- Error:
[2024-07-12T20:06:17-07:00] ERROR 🔒 TLS alert message detected src_ip=192.168.0.35 dst_ip=172.64.155.141
Internals
Project Structure
main.go: Entry point of the application.cmd/: Contains CLI command definitions.capture/: Handles packet capturing and processing.logger/: Configures and manages logging.tls/: Contains logic for inspecting and detecting TLS-related issues.
Code Highlights
Command Handling (cmd/root.go)
Defines the root command and initializes the required flags for network interface and log levels.
Packet Capture (capture/capture.go)
Handles the core packet capturing logic using gopacket and processes each packet to detect network issues.
Logging Configuration (logger/logger.go)
Configures logrus for structured logging with different log levels and color-coded output.
TLS Issue Detection (tls/tls.go)
Inspects TCP payloads for TLS handshake messages and alerts, logging them as appropriate.
Contribution
We welcome contributions from the community! Feel free to fork the repository and create pull requests. Here are some areas where you can contribute:
- Adding new features
- Improving existing functionalities
- Bug fixes
- Documentation improvements
Contact
For any questions or issues, please open an issue on GitHub or contact the maintainers. y.
Owner
- Name: Donald Johnson
- Login: copyleftdev
- Kind: user
- Location: Los Angeles
- Repositories: 39
- Profile: https://github.com/copyleftdev
GitHub Events
Total
Last Year
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
- Total downloads: unknown
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 0
proxy.golang.org: github.com/copyleftdev/osilog
Rankings
Dependencies
- github.com/google/gopacket v1.1.19
- github.com/inconshreveable/mousetrap v1.1.0
- github.com/mattn/go-colorable v0.1.13
- github.com/mattn/go-isatty v0.0.16
- github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d
- github.com/sirupsen/logrus v1.9.3
- github.com/spf13/cobra v1.8.1
- github.com/spf13/pflag v1.0.5
- github.com/x-cray/logrus-prefixed-formatter v0.5.2
- golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550
- golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab
- github.com/cpuguy83/go-md2man/v2 v2.0.4
- github.com/davecgh/go-spew v1.1.0
- github.com/davecgh/go-spew v1.1.1
- github.com/google/gopacket v1.1.19
- github.com/inconshreveable/mousetrap v1.1.0
- github.com/mattn/go-colorable v0.1.13
- github.com/mattn/go-isatty v0.0.16
- github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d
- github.com/pmezard/go-difflib v1.0.0
- github.com/russross/blackfriday/v2 v2.1.0
- github.com/sirupsen/logrus v1.9.3
- github.com/spf13/cobra v1.8.1
- github.com/spf13/pflag v1.0.5
- github.com/stretchr/objx v0.1.0
- github.com/stretchr/testify v1.7.0
- github.com/x-cray/logrus-prefixed-formatter v0.5.2
- golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
- golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550
- golang.org/x/lint v0.0.0-20200302205851-738671d3881b
- golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee
- golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3
- golang.org/x/net v0.0.0-20190620200207-3b0461eec859
- golang.org/x/sync v0.0.0-20190423024810-112230192c58
- golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a
- golang.org/x/sys v0.0.0-20190412213103-97732733099d
- golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8
- golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab
- golang.org/x/text v0.3.0
- golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7
- golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898
- gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
- gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
- gopkg.in/yaml.v3 v3.0.1
- actions/checkout v4 composite
- actions/setup-go v4 composite