{"id":25531928,"url":"https://github.com/m-ah07/linux-security-dashboard","last_synced_at":"2026-04-15T14:35:32.024Z","repository":{"id":270827489,"uuid":"911575979","full_name":"m-ah07/linux-security-dashboard","owner":"m-ah07","description":"A Flask-based interactive dashboard for monitoring Linux system security. It provides real-time insights into system information, open ports, running processes, and failed login attempts. The dashboard is designed to enhance system monitoring with Basic Auth protection, Slack notifications, and Docker support for seamless deployment.","archived":false,"fork":false,"pushed_at":"2025-01-24T15:03:29.000Z","size":48,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-12T16:52:46.647Z","etag":null,"topics":["audit","cve","dashboard","docker","flask","linux","monitoring","open-ports","open-source","security","slack-alerts","system-info"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/m-ah07.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2025-01-03T10:44:09.000Z","updated_at":"2025-01-24T15:03:33.000Z","dependencies_parsed_at":"2025-01-03T11:41:58.928Z","dependency_job_id":"e05353ce-ad01-4043-abdb-617b484ac275","html_url":"https://github.com/m-ah07/linux-security-dashboard","commit_stats":null,"previous_names":["marwan-ahmed-23/linux-security-dashboard","m-ah07/linux-security-dashboard"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-ah07%2Flinux-security-dashboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-ah07%2Flinux-security-dashboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-ah07%2Flinux-security-dashboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-ah07%2Flinux-security-dashboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m-ah07","download_url":"https://codeload.github.com/m-ah07/linux-security-dashboard/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239763601,"owners_count":19692794,"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","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":["audit","cve","dashboard","docker","flask","linux","monitoring","open-ports","open-source","security","slack-alerts","system-info"],"created_at":"2025-02-20T01:42:19.287Z","updated_at":"2026-04-15T14:35:32.005Z","avatar_url":"https://github.com/m-ah07.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Linux Security Dashboard\n\nA full-stack application for real-time monitoring and analysis of Linux system security. It provides a **Node.js/Express** backend for gathering critical system data and optionally running vulnerability scans, and a **React** frontend for visualizing information such as open ports, system logs, and more.\n\n---\n\n## Table of Contents\n\n1. [Key Features](#key-features)  \n2. [Requirements](#requirements)  \n3. [Platform Support](#platform-support)  \n4. [Tech Stack](#tech-stack)  \n5. [Project Structure](#project-structure)  \n6. [Installation](#installation)  \n7. [Usage](#usage)  \n8. [Default Login Credentials](#default-login-credentials)  \n9. [API Endpoints](#api-endpoints)  \n10. [Docker Deployment](#docker-deployment-optional)  \n11. [Troubleshooting](#troubleshooting)  \n12. [Contributing](#contributing)  \n13. [License](#license)\n\n\n## Key Features\n\n- **System Metrics**  \n  Collect CPU, memory, and uptime details, along with system-wide info (hostname, OS, etc.).\n\n- **Open Ports**  \n  Scan and display currently open ports on the host for quick identification of potential threats.\n\n- **Vulnerability Scanning**  \n  Perform simple vulnerability scans (using Nmap, for example) to detect common security gaps.\n\n- **Logs and Failed Logins**  \n  Fetch and display recent authentication failures or other relevant system logs, highlighting suspicious activity.\n\n- **Scalable Architecture**  \n  Separate **backend** for data collection/processing and **frontend** for a responsive, user-friendly dashboard.\n\n- **Authentication**  \n  JWT-based login protects all dashboard data. Default credentials can be configured via environment variables.\n\n- **Optional Docker Support**  \n  Use `docker-compose` to containerize the application (frontend, backend, and MongoDB if applicable) for easy deployment.\n\n\n## Requirements\n\nBefore you begin, ensure you have:\n\n- **Node.js** (v18 or newer) — [Download](https://nodejs.org/)\n- **npm** (comes with Node.js)\n- **Linux** — For full functionality (Open Ports, Logs, Vulnerability Scanner)\n- **Nmap** — Required for Vulnerability Scanner (install: `apt install nmap` on Ubuntu/Debian)\n\n\n## Platform Support\n\n| Feature              | Linux | Windows |\n|----------------------|-------|---------|\n| System Dashboard     | ✅    | ✅      |\n| Open Ports           | ✅    | ❌      |\n| Failed Login Logs    | ✅    | ❌      |\n| Vulnerability Scanner| ✅*   | ⚠️      |\n\n\\* Requires Nmap installed  \n⚠️ Windows: Only works if Nmap is installed; Open Ports and Logs use Linux commands (`ss`, `grep`, `/var/log/auth.log`).\n\n**On Windows:** Use [WSL2](https://docs.microsoft.com/en-us/windows/wsl/) or [Docker](#docker-deployment-optional) for full support.\n\n\n## Tech Stack\n\n- **Backend**  \n  - [Node.js](https://nodejs.org/) + [Express.js](https://expressjs.com/)  \n  - (Optional) [MongoDB](https://www.mongodb.com/) if you want to persist historical data (via [Mongoose](https://mongoosejs.com/))\n\n- **Frontend**  \n  - [React](https://reactjs.org/) + [Bootstrap](https://getbootstrap.com/)  \n  - [React Router](https://reactrouter.com/) for routing  \n  - [Axios](https://axios-http.com/) for API requests\n\n- **Deployment**  \n  - [Docker](https://www.docker.com/) \u0026 [docker-compose](https://docs.docker.com/compose/) (Optional)  \n  - Can be self-hosted on any server or cloud service (AWS, Azure, GCP, etc.)\n\n\n## Project Structure\n\n```plaintext\nlinux-security-dashboard/\n├── backend/\n│   ├── src/\n│   │   ├── app.js                          # Main Express server setup \u0026 configuration\n│   │   ├── middleware/\n│   │   │   └── auth.js                     # JWT authentication middleware\n│   │   ├── routes/\n│   │   │   ├── auth.js                     # Login route (public)\n│   │   │   ├── system.js                   # Routes for system information \u0026 open ports\n│   │   │   ├── vulnerabilities.js          # Routes for vulnerability scanning\n│   │   │   └── logs.js                     # Routes for failed login logs\n│   │   ├── controllers/\n│   │   │   ├── authController.js           # Login logic \u0026 JWT issuance\n│   │   │   ├── systemController.js         # Business logic for system data (info/ports)\n│   │   │   ├── vulnerabilityController.js  # Business logic for scanning vulnerabilities\n│   │   │   └── logsController.js           # Business logic for handling logs\n│   │   ├── models/\n│   │   │   └── SystemLog.js                # Mongoose model (example) for storing system logs\n│   │   └── utils/\n│   │       ├── systemInfo.js               # Helper functions to fetch system info/ports\n│   │       └── vulnerabilityScanner.js     # Utility to run Nmap or other scan tools\n│   ├── .env.example                        # Environment variables template\n│   ├── package.json                        # Backend dependencies \u0026 scripts\n│   └── Dockerfile                          # Dockerfile for containerizing the backend\n├── frontend/\n│   ├── public/\n│   │   └── index.html                      # Main HTML entry for the React application\n│   ├── src/\n│   │   ├── components/\n│   │   │   ├── SystemDashboard.jsx         # Displays system info (CPU, memory, etc.)\n│   │   │   ├── PortList.jsx                # Lists open ports fetched from the backend\n│   │   │   ├── VulnerabilityScanner.jsx    # UI to trigger vulnerability scans \u0026 show results\n│   │   │   ├── LogsView.jsx                # Shows recent failed login attempts or logs\n│   │   │   ├── Login.jsx                   # Login form component\n│   │   │   └── ProtectedRoute.jsx          # Route guard for authenticated users\n│   │   ├── services/\n│   │   │   └── api.js                      # Axios instance \u0026 interceptors for API requests\n│   │   ├── App.js                          # Main React component with routes/navigation\n│   │   └── index.js                        # React DOM entry point, imports global styles\n│   ├── .env.example                        # Frontend environment variables template\n│   ├── package.json                        # Frontend dependencies \u0026 scripts\n│   └── Dockerfile                          # Dockerfile for containerizing the frontend\n├── docker-compose.yml                      # Multi-container setup for backend, frontend, DB\n├── .gitignore                              # Git ignore rules\n├── README.md                               # Project documentation (setup, usage, etc.)\n└── LICENSE                                 # License file (MIT)\n```\n\n\n## Installation\n\n### 1. Clone the Repository\n```bash\ngit clone https://github.com/m-ah07/linux-security-dashboard.git\n```\n\n### 2. Install Backend Dependencies\n```bash\ncd linux-security-dashboard/backend\nnpm install\n```\n- (Optional) If you plan on using a database like MongoDB, install **mongoose** as well:\n  ```bash\n  npm install mongoose\n  ```\n\n### 3. Install Frontend Dependencies\n```bash\ncd ../frontend\nnpm install\n```\n- If `react-scripts` is not found when running `npm start`, install it:\n  ```bash\n  npm install react-scripts\n  ```\n\n### 4. Install Nmap (Linux only, for Vulnerability Scanner)\n```bash\n# Ubuntu/Debian\nsudo apt install nmap\n\n# RHEL/CentOS\nsudo yum install nmap\n```\n\n### 5. Configure Environment\nCopy `.env.example` to `.env` in both backend and frontend:\n\n**Backend** (`backend/.env`):\n```plaintext\nPORT=5000\nJWT_SECRET=your-secret-key-change-in-production\nJWT_EXPIRES_IN=24h\nADMIN_USERNAME=admin\nADMIN_PASSWORD=admin\n```\n\n**Frontend** (`frontend/.env`):\n```plaintext\nREACT_APP_API_URL=http://localhost:5000/api\n```\n\nIf using a database, add to backend `.env`:\n```plaintext\nDB_URI=mongodb://localhost:27017/linux_security\n```\n\n**RHEL/CentOS** — Use `/var/log/secure` for auth logs:\n```plaintext\nAUTH_LOG_PATH=/var/log/secure\n```\n\n\n## Usage\n\n1. **Run the Backend**  \n   ```bash\n   cd linux-security-dashboard/backend\n   npm run dev\n   ```\n   - Starts an Express server on `http://localhost:5000` by default.\n\n2. **Run the Frontend**  \n   ```bash\n   cd ../frontend\n   npm start\n   ```\n   - Runs the React application on `http://localhost:3000`.\n\n3. **Access the Dashboard**  \n   - Open your browser at **`http://localhost:3000`** (frontend).  \n   - Do **not** use `http://localhost:5000` in the browser — that is the API server and will show \"Cannot GET /\".\n\n\n## Default Login Credentials\n\n| Field     | Default Value |\n|-----------|---------------|\n| **Username** | `admin` |\n| **Password** | `admin` |\n\nChange these in production via `ADMIN_USERNAME` and `ADMIN_PASSWORD` in `backend/.env`.\n\n\n## API Endpoints\n\nAll endpoints except `/api/auth/login` require a JWT token in the `Authorization` header: `Bearer \u003ctoken\u003e`.\n\n| Method | Endpoint                      | Auth | Description                    |\n|--------|-------------------------------|------|--------------------------------|\n| POST   | `/api/auth/login`             | No   | Login; returns JWT             |\n| GET    | `/api/system/info`            | Yes  | System metrics (CPU, memory…)  |\n| GET    | `/api/system/ports`           | Yes  | Open ports on the host         |\n| POST   | `/api/vulnerabilities/scan`   | Yes  | Run vulnerability scan (Nmap)  |\n| GET    | `/api/vulnerabilities/results`| Yes  | Get last scan results          |\n| GET    | `/api/logs/failed-logins`     | Yes  | Failed login attempts          |\n| DELETE | `/api/logs/cleanup`           | Yes  | Log cleanup info (read-only)   |\n\n\n## Docker Deployment (Optional)\n\n1. **Build and Run**  \n   ```bash\n   cd linux-security-dashboard\n   docker-compose up --build\n   ```\n2. **Containers**  \n   - **backend**: Exposes `http://localhost:5000`  \n   - **frontend**: Accessible at `http://localhost:3000`  \n   - **mongo** (if configured) on `27017`  \n\n3. **Login** — Use `admin` / `admin` (or credentials from env vars).\n\n\n## Troubleshooting\n\n| Problem | Solution |\n|---------|----------|\n| **\"Cannot GET /\"** | You are on the backend URL. Open `http://localhost:3000` (frontend) instead of `http://localhost:5000`. |\n| **\"react-scripts is not recognized\"** | Run `npm install react-scripts` in the frontend folder. |\n| **Open Ports / Logs empty on Windows** | These features require Linux. Use WSL2 or Docker. |\n| **Vulnerability scan fails** | Install Nmap: `apt install nmap` (Linux). |\n| **401 Unauthorized** | Log in again. The JWT may have expired (default: 24h). |\n| **CORS errors** | Ensure backend runs on port 5000 and frontend uses `REACT_APP_API_URL=http://localhost:5000/api`. |\n\n\n## Contributing\n\n1. **Fork** the repository.  \n2. **Create a branch** for your feature:  \n   ```bash\n   git checkout -b feature/some-new-feature\n   ```\n3. **Commit \u0026 push** your changes:  \n   ```bash\n   git commit -m \"Add some new feature\"\n   git push origin feature/some-new-feature\n   ```\n4. **Open a Pull Request** on GitHub, describing your changes and any relevant details.\n\nWe appreciate your contributions—bug reports, suggestions, and pull requests are always welcome!\n\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).  \nFeel free to modify and distribute as you see fit.\n\n\n**Enjoy securing your system with the Linux Security Dashboard!** For questions or feedback, [open an issue](https://github.com/m-ah07/linux-security-dashboard/issues) or start a discussion in the repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm-ah07%2Flinux-security-dashboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm-ah07%2Flinux-security-dashboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm-ah07%2Flinux-security-dashboard/lists"}