
AI powered security analysis extension for Mobile Security Framework MobSF
This project adds an AI-powered chat assistant to the Mobile Security Framework (MobSF). It allows security analysts to ask questions about the analysis report generated by MobSF directly within the interface, leveraging OpenAI's model.
The solution is composed of three Docker services working together:
mobsf): The standard Mobile Security Framework application running on port 8000.chat): A Python Flask application that runs on port 5000.
gateway): An Nginx reverse proxy (listening on port 8080) that coordinates everything:
/chat/ and /api/chat requests to the Sidecar container.Clone the repository:
git clone <repository-url>
cd Mobsf_Side_Car
Configure Environment:
Open docker-compose-mobsfai.yml and check the environment variables.
You generally need to provide your OpenAI API Key. You can set it directly in the file (not recommended for committed code) or export it in your shell:
export MOBSF_OPENAI_API_KEY="sk-..."
Note: The MOBSF_API_KEY is currently hardcoded to 1234567890 in the docker-compose file for both the MobSF instance and the Sidecar to communicate. If you change it in one place, ensure you update it in both services. You can the API in MobSF GUI as well.
Build and Start: Run the following command to build the chat container and start the stack:
docker-compose -f docker-compose-mobsfai.yml up --build
OR
docker-compose -f docker-compose-mobsfai.yml up -d --build
OR
docker-compose -f docker-compose-mobsfai.yml down -v
Access the Application: Open your browser and navigate to:
http://localhost:8080 and not port 8000./StaticAnalyzer/ or matches the pattern expected by the injected script.docker logs mobsf_chat.OPENAI_API_KEY is valid and has access to the model.MOBSF_API_KEY matches in both the mobsf and chat service definitions in docker-compose-mobsfai.yml.(Note: Do not use port 8000, as that bypasses the Nginx gateway and the chat button will not appear.)