commit dd2abd2d81fb3dbf3731d497ddadcbcf5b786874 Author: LandaMm Date: Sat May 17 23:03:18 2025 +0200 feat: project init with decription diff --git a/README.md b/README.md new file mode 100644 index 0000000..6af48c6 --- /dev/null +++ b/README.md @@ -0,0 +1,107 @@ +# HSP Guard + +**HSP Guard** is an internal security service for your home lab, designed to manage user access to various home services and tools. It dynamically controls permissions and prevents unauthorized or unexpected users from accessing sensitive services. + +--- + +## πŸ“Œ Overview + +HSP Guard authorizes user requests and provides an efficient way to: + +- Manage permissions for individual services/tools +- Define roles for easier access control +- Validate and authorize users via JWT tokens +- Securely integrate with new services during installation + +--- + +## πŸ“š Concepts + +### πŸ” Permission + +Permissions define access to specific features or tools. +By default, HSP Guard includes predefined administrative permissions that allow an admin to log in and configure the system. + +Once logged in, the admin can: + +- Manually create new permissions for specific applications +- Allow new applications to register their own permissions +- Assign permissions to users, granting them access to corresponding tools + +--- + +### 🧩 Role + +A **Role** is a named collection of permissions (e.g., `GUEST`, `FRIEND`, `FAMILY_MEMBER`) created by the admin. +Roles simplify user management by allowing bulk assignment of permissions. Instead of assigning multiple permissions individually, a role bundles them under one label. + +--- + +### πŸ‘₯ Group *(Coming Soon)* + +This feature is planned for future releases. Groups will help organize users or services into logical clusters for simplified access control. + +--- + +## πŸ“‘ API + +### βœ… User Authorization + +To verify whether a request is made by a valid and authorized user, applications can require a **JWT token** as part of the request. +This token is sent to HSP Guard, which: + +- Validates the token +- Returns user details (e.g., ID, name, email) for logging, auditing, or request tracing + +--- + +### πŸ”‘ Permission Checking + +Applications can also verify whether a user holds specific permissions before granting access to certain services or features. + +To do this, an app sends: + +- The user's JWT token +- A list of required permissions + +HSP Guard checks the user’s assigned permissions and responds with the authorization status. + +> **Best Practice:** Applications should directly integrate with HSP Guard to enforce permission-based access control. + +--- + +## βš™οΈ Integrating New Services & Tools + +When a new service or tool is installed: + +1. It provides a configuration file to HSP Guard +2. Guard extracts and registers any defined permissions +3. These permissions are **isolated** β€” even if a name overlaps with existing permissions, a prefix is added to avoid conflicts + +--- + +## πŸ‘€ User Registration & Onboarding + +New users (e.g., family, friends, guests) must complete a registration process to access your home lab. + +They can: + +- Visit a user-friendly registration webpage +- Fill out a form with basic information (name, email, password, etc.) + +Once registered, the admin can assign roles or individual permissions as needed. + +--- + +## 🚧 Roadmap + +- [ ] Group Management +- [ ] Web UI Enhancements +- [ ] Audit Logging +- [ ] Permission Expiry & Time-Based Access + +--- + +## πŸ“¬ Feedback & Contribution + +Feel free to open an issue or pull request if you’d like to contribute or report bugs. HSP Guard is a personal home lab project, but feedback is always welcome!