Temsa is a platform for automated security analysis of mobile applications.
The project is built around a control-plane backend and isolated analysis workers. Temsa.Core exposes the REST API, manages projects, uploaded artifacts, scans, scan tasks, worker events, and scan artifacts. Workers consume scan tasks from RabbitMQ, run analysis tools, upload generated artifacts to S3-compatible storage, and report progress/results back to Core.
flowchart LR
Client["API Client"] --> Core["Temsa.Core"]
Core --> Postgres["PostgreSQL"]
Core --> MinIO["MinIO / S3"]
Core --> RabbitMQ["RabbitMQ"]
RabbitMQ --> StaticWorker["Static Analysis Worker"]
RabbitMQ --> AndroidWorker["Android Dynamic Worker"]
RabbitMQ --> IosWorker["iOS Dynamic Worker"]
StaticWorker --> MinIO
AndroidWorker --> MinIO
IosWorker --> MinIO
StaticWorker --> RabbitMQ
AndroidWorker --> RabbitMQ
IosWorker --> RabbitMQ
RabbitMQ --> Core
Temsa.Core is the backend control plane.
It is responsible for:
- project management;
- project artifact upload;
- scan creation and execution;
- scan pipeline loading;
- scan task dispatching;
- worker event processing;
- scan task status updates;
- scan artifact registration;
- API access to scan tasks, events, and artifacts.
Shared worker runtime used by analysis workers.
It provides:
- RabbitMQ scan task consumer;
- worker event publisher;
- worker task event sink;
- running task registry;
- task stop handling;
- common worker execution contracts.
Static analysis worker.
Current capabilities:
- Android SAST with JADX + Semgrep;
- iOS SAST with TruffleHog + radare2;
- S3 upload of generated reports.
Android dynamic analysis worker.
Current capabilities:
- APK installation through ADB;
- app data cleanup;
- Frida-based interactive dynamic session;
- logcat capture;
- force-stop;
- private app data dump;
- app uninstall;
- graceful interaction completion through RabbitMQ control messages.
iOS dynamic analysis worker.
Current state:
- Frida-based session support;
- task skeletons for installation, system logs, force-stop, container dump, and uninstall;
- designed to follow the same task model as Android dynamic analysis.
Shared runtime for dynamic analysis workers.
It contains common Frida and script-loading infrastructure used by Android and iOS workers.
Shared contracts for messaging and artifact descriptors.
Shared infrastructure utilities:
- RabbitMQ connection configuration;
- S3-compatible artifact storage;
- common options;
- temporary directory helper;
- time provider.
Local infrastructure is defined in docker-compose.yml:
- PostgreSQL
- RabbitMQ with management UI
- MinIO
- pgAdmin
Start infrastructure:
docker compose up -dDefault local service ports:
| Service | URL |
|---|---|
| PostgreSQL | localhost:5432 |
| RabbitMQ | localhost:5672 |
| RabbitMQ Management | http://localhost:15672 |
| MinIO API | http://localhost:9000 |
| MinIO Console | http://localhost:9001 |
| pgAdmin | http://localhost:5050 |
Scan execution is described with JSON pipeline files in:
Temsa.Core/Pipelines
Current pipelines:
android.static.json
android.dynamic.json
ios.static.json
ios.dynamic.json
A pipeline consists of stages and tasks.
Example structure:
{
"platform": "android",
"analysisType": "dynamic",
"stages": [
{
"id": "interactive-analysis",
"order": 2,
"execution": "parallel",
"runPolicy": "on-success",
"tasks": [
{
"taskType": "android-dynamic-session",
"workerType": "android-dynamic-analysis",
"tool": "frida",
"order": 1,
"parameters": {}
}
]
}
]
}Stages are executed by order.
Supported execution modes:
sequential- tasks are dispatched one by one;parallel- tasks in the same stage are dispatched together and run concurrently.
Supported run policies:
on-success- run only if previous stages succeeded;always- run regardless of previous stage result, useful for cleanup.
Temsa distinguishes two artifact types.
Project artifacts are uploaded by the user and used as scan inputs.
Examples:
- Android APK;
- iOS IPA;
- source archive.
Project artifacts are stored in S3-compatible storage and tracked in PostgreSQL.
Scan artifacts are generated by workers during analysis.
Examples:
- Semgrep SARIF report;
- TruffleHog NDJSON report;
- radare2 text report;
- Frida events;
- logcat output;
- private app data archive.
Workers upload scan artifacts to S3 and send artifact descriptors to Core through worker events. Core then registers them in PostgreSQL.
Workers report task execution state through RabbitMQ.
Typical event flow:
scan-task.started
scan-task.progress
scan-task.log
scan-task.completed
scan-task.failed
Events are consumed by Temsa.Core, persisted as scan events, and used to update scan/task state.
Completed events may contain scan artifact descriptors. Core registers those descriptors as scan artifacts.
Dynamic analysis supports control messages through RabbitMQ.
The main use case is completing an interactive analysis stage:
interaction.completed
A scan-level interaction completion command can stop all currently running interactive tasks for a scan. Each task receives a stop request and is expected to finish gracefully, upload artifacts, and publish a completed event.
Frida scripts are stored in:
frida-scripts
Worker projects do not store generated Frida bundles as source files. During build/publish, MSBuild runs the corresponding npm build command and copies the generated bundle into the worker output directory.
Install Node dependencies once:
cd frida-scripts
npm installBuild scripts manually:
npm run build:android-basic
npm run build:ios-basicDuring worker build, bundles are copied into:
Scripts/android/agent.android.basic.bundle.js
Scripts/ios/agent.ios.basic.bundle.js
Android SAST currently uses:
- JADX for APK decompilation;
- Semgrep for rule-based static analysis;
- SARIF as report format.
Output artifact:
semgrep-report.sarif
iOS SAST currently uses:
- TruffleHog for secret scanning;
- radare2 for binary inspection.
Output artifacts:
trufflehog-results.ndjson
radare2-report.txt
radare2 scripts are grouped by profiles and can be enabled/disabled per scan task.
Current Android dynamic pipeline includes:
- install APK;
- clear app data;
- run Frida interactive session;
- capture logcat output;
- complete interaction through Core API;
- force-stop app;
- dump private app data;
- cleanup app data;
- uninstall app.
Android dynamic analysis expects:
- connected Android device or emulator;
- ADB access;
- Frida server running on the target device;
- root access for private data dump.
iOS dynamic analysis is being developed with a Frida-first approach.
Expected environment:
- connected jailbroken iOS device;
- Frida available on the device;
- optional SSH-based tasks for app container extraction later.
Restore dependencies:
dotnet restoreBuild solution:
dotnet buildStart infrastructure:
docker compose up -dRun Core:
dotnet run --project Temsa.CoreRun static analysis worker:
dotnet run --project Temsa.Worker.StaticAnalysisRun Android dynamic worker:
dotnet run --project Temsa.Worker.DynamicAnalysis.AndroidRun iOS dynamic worker:
dotnet run --project Temsa.Worker.DynamicAnalysis.IosPowerShell example:
$form = @{
type = "IosIpa"
kind = "Binary"
file = Get-Item -Path .\DVIA-v2.ipa
}
Invoke-RestMethod `
-Uri "http://localhost:8000/projects/3/artifacts" `
-Method Post `
-Form $formCreate a scan for the uploaded artifact through the API.
The scan references the uploaded inputArtifactId.
Start the scan through the API.
Core loads the matching scan pipeline, creates scan tasks, and dispatches the first stage to RabbitMQ.
For dynamic scans, complete interaction through Core when manual app exploration is finished.
Core publishes a worker control message. Running interactive tasks finish gracefully and upload their artifacts.
Use Core API to inspect:
- scan status;
- scan task status;
- scan task events;
- scan artifacts;
- artifact content.
Implemented or in progress:
- REST API for projects and scans;
- project artifact upload to S3-compatible storage;
- scan pipeline execution;
- RabbitMQ-based task dispatching;
- worker event ingestion;
- scan artifact registration;
- Android static analysis;
- iOS static analysis;
- Android dynamic analysis;
- iOS dynamic analysis foundation.
Planned improvements:
- normalized findings model;
- aggregation of raw tool output into findings;
- richer iOS dynamic worker implementation;
- more Android and iOS Frida checks;
- additional radare2 scripts;
- secret scanning for dumped app private data;
- improved scan summaries;
- outbox pattern for reliable message publishing;
- authentication and authorization;
- UI for scan progress and artifacts.