Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pravintargaryen/audit
This project is a simple FastAPI-based Authorization and Logging system that interacts with an Open Policy Agent (OPA) to make access decisions. It also provides real-time log streaming via WebSockets.
https://github.com/pravintargaryen/audit
Last synced: 5 days ago
JSON representation
This project is a simple FastAPI-based Authorization and Logging system that interacts with an Open Policy Agent (OPA) to make access decisions. It also provides real-time log streaming via WebSockets.
- Host: GitHub
- URL: https://github.com/pravintargaryen/audit
- Owner: pravintargaryen
- Created: 2024-09-17T03:31:32.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-09-17T04:02:14.000Z (about 2 months ago)
- Last Synced: 2024-09-17T07:12:09.836Z (about 2 months ago)
- Language: Python
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FastAPI Authorization & Logging System
This project is a simple FastAPI-based Authorization and Logging system that interacts with an Open Policy Agent (OPA) to make access decisions. It also provides real-time log streaming via WebSockets.
## Features
- **Authorization Layer**: Uses OPA for policy-based access control.
- **Logging**: Logs all access attempts with encrypted logs stored in SQLite.
- **Real-time Logs**: Provides a WebSocket endpoint to stream logs in real-time.## Requirements
- Python 3.8+
- FastAPI
- Uvicorn
- SQLite
- Open Policy Agent (OPA)## Getting Started
### Clone the Repository
```bash
git clone https://github.com/pravintargaryen/audit.git
cd your-repository-name
```### Install Dependencies
```bash
pip install -r requirements.txt
```### Start Open Policy Agent (OPA)
1. Download OPA
2. Start the OPA server```bash
./opa run --server --addr http://localhost:8181```
3. Load your authorization policy into OPA.
```bash
opa policy add authorization policy.rego```
4. Start the FastAPI Server
```bash
uvicorn main:app --reload```