{"id":25911409,"url":"https://github.com/copyleftdev/osilog","last_synced_at":"2025-08-17T12:42:59.092Z","repository":{"id":248219417,"uuid":"828108117","full_name":"copyleftdev/osilog","owner":"copyleftdev","description":"a simple osi layer log util","archived":false,"fork":false,"pushed_at":"2024-07-13T14:49:15.000Z","size":2733,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-17T12:42:55.856Z","etag":null,"topics":["advent-of-code-2023","blueteam","cli","devops","network-analysis","redteam","security","tools"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/copyleftdev.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-07-13T06:27:32.000Z","updated_at":"2025-08-07T20:20:27.000Z","dependencies_parsed_at":"2025-08-17T12:42:58.601Z","dependency_job_id":null,"html_url":"https://github.com/copyleftdev/osilog","commit_stats":null,"previous_names":["copyleftdev/osilog"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/copyleftdev/osilog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/copyleftdev%2Fosilog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/copyleftdev%2Fosilog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/copyleftdev%2Fosilog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/copyleftdev%2Fosilog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/copyleftdev","download_url":"https://codeload.github.com/copyleftdev/osilog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/copyleftdev%2Fosilog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270850080,"owners_count":24656448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["advent-of-code-2023","blueteam","cli","devops","network-analysis","redteam","security","tools"],"created_at":"2025-03-03T09:17:26.173Z","updated_at":"2025-08-17T12:42:59.019Z","avatar_url":"https://github.com/copyleftdev.png","language":"Go","readme":"# osilog\n\n![osilog logo](./logo.png)\n\n`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.\n\n## Features\n\n- **Network Packet Capture**: Captures TCP, UDP, ICMP, and ARP packets.\n- **TLS/SSL Detection**: Identifies and logs TLS handshake messages and alerts.\n- **Structured Logging**: Uses `logrus` for color-coded and emoji-enhanced logs.\n- **Log Level Filtering**: Allows filtering logs by severity (info, warn, error).\n\n## Installation\n\n### Prerequisites\n\n- Go 1.18 or higher\n- libpcap (required for `gopacket`)\n\n### Build from Source\n\n1. **Clone the repository:**\n\n   ```sh\n   git clone https://github.com/copyleftdev/osilog.git\n   cd osilog\n   ```\n\n2. **Build the project:**\n\n   ```sh\n   go build -o osilog main.go\n   ```\n\n3. **Run the tool:**\n\n   ```sh\n   sudo ./osilog --interface \u003cyour-network-interface\u003e\n   ```\n\n## Usage\n\n### Command-line Options\n\n- `--interface`, `-i`: Specify the network interface to capture packets from (required).\n- `--loglevels`, `-l`: Set log levels to filter output (default: `info`). Possible values: `info`, `warn`, `error`.\n\n### Examples\n\n- **Capture packets on interface `enp0s3` and show all log levels:**\n\n  ```sh\n  sudo ./osilog --interface enp0s3\n  ```\n\n- **Capture packets on interface `enp0s3` and filter logs to show warnings and errors only:**\n\n  ```sh\n  sudo ./osilog --loglevels warn,error --interface enp0s3\n  ```\n\n## Log Output\n\nThe tool uses `logrus` for structured logging with color coding and emojis for better readability. Here are some examples of the log output:\n\n- **Info**:\n\n  ```\n  [2024-07-12T20:06:17-07:00] INFO  📦 Packet captured timestamp=2024-07-12T20:06:17-07:00 length=123\n  ```\n\n- **Warning**:\n\n  ```\n  [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\n  ```\n\n- **Error**:\n\n  ```\n  [2024-07-12T20:06:17-07:00] ERROR 🔒 TLS alert message detected src_ip=192.168.0.35 dst_ip=172.64.155.141\n  ```\n\n## Internals\n\n### Project Structure\n\n- **`main.go`**: Entry point of the application.\n- **`cmd/`**: Contains CLI command definitions.\n- **`capture/`**: Handles packet capturing and processing.\n- **`logger/`**: Configures and manages logging.\n- **`tls/`**: Contains logic for inspecting and detecting TLS-related issues.\n\n### Code Highlights\n\n#### Command Handling (`cmd/root.go`)\n\nDefines the root command and initializes the required flags for network interface and log levels.\n\n#### Packet Capture (`capture/capture.go`)\n\nHandles the core packet capturing logic using `gopacket` and processes each packet to detect network issues.\n\n#### Logging Configuration (`logger/logger.go`)\n\nConfigures `logrus` for structured logging with different log levels and color-coded output.\n\n#### TLS Issue Detection (`tls/tls.go`)\n\nInspects TCP payloads for TLS handshake messages and alerts, logging them as appropriate.\n\n## Contribution\n\nWe welcome contributions from the community! Feel free to fork the repository and create pull requests. Here are some areas where you can contribute:\n\n- Adding new features\n- Improving existing functionalities\n- Bug fixes\n- Documentation improvements\n\n\n## Contact\n\nFor any questions or issues, please open an issue on GitHub or contact the maintainers.\ny.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcopyleftdev%2Fosilog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcopyleftdev%2Fosilog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcopyleftdev%2Fosilog/lists"}