A FastAPI-based service that analyzes Lua scripts for potential security risks and obfuscation.
- Detection of dangerous functions and potential security risks
- Identification of obfuscated code
- Analysis of script entropy
- Testing environment with FatalityAPI mocks
- Comprehensive test coverage
# Clone the repository
git clone https://github.com/Stupidoodle/lua-auto-approve.git
cd lua-auto-approve
# Install dependencies
pip install -r requirements.txt
# Run tests with coverage report
pytest --cov=./
# Run tests with verbose output
pytest -v
The service provides a single endpoint for analyzing Lua scripts:
POST /analyze-script
Example using curl:
curl -X POST -F "file=@script.lua" http://localhost:8000/analyze-script
The response will indicate whether the script is approved or flagged:
{
"status": "approved"
}
or
{
"status": "flagged",
"reason": "Contains dangerous function"
}
├── main.py # FastAPI application and core logic
├── tests/
│ ├── test_main.py # Core functionality tests
│ ├── test_fatality_api_class.py # API mock tests
│ └── test_main_integration.py # Integration tests
└── .github/
└── workflows/
└── tests.yml # GitHub Actions workflow
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request