Assemblyline Service Client
raw JSON → 4.7.3.1 verified Mon Apr 27 auth: no python
The official Python client for building services that integrate with Assemblyline 4, a scalable file triage and malware analysis platform. Current version 4.7.3.1, maintained by the Canadian Centre for Cyber Security. Releases are tagged with major.minor.patch and stable suffixes.
pip install assemblyline-service-client Common errors
error ModuleNotFoundError: No module named 'assemblyline_service_client' ↓
cause Package not installed or installed in wrong environment.
fix
Run 'pip install assemblyline-service-client' in the correct Python environment.
error TypeError: do_task() missing 1 required positional argument: 'request' ↓
cause Passing arguments incorrectly to do_task() after version 4.1.0.
fix
Wrap the request data in a ServiceRequest object.
error assemblyline_service_client.exceptions.AuthenticationError: Invalid API key ↓
cause API key tuple format incorrect or credentials wrong.
fix
Ensure apikey is a tuple (username, key) and credentials are valid.
Warnings
breaking Version 4.0 changed the import paths; legacy code using 'from assemblyline import ...' will break. ↓
fix Change imports to 'from assemblyline_service_client import ...'
breaking The 'do_task' method signature changed in v4.1.0; previously accepted positional args, now requires a ServiceRequest object. ↓
fix Pass a ServiceRequest object to do_task().
gotcha API key authentication requires a tuple (username, key) not a string. ↓
fix Use apikey=('myuser', 'mykey') in constructor.
Imports
- ServiceClient wrong
from assemblyline.service_client import ServiceClientcorrectfrom assemblyline_service_client import ServiceClient - ServiceRequest wrong
from assemblyline.common import ServiceRequestcorrectfrom assemblyline_service_client import ServiceRequest - ServiceResponse wrong
from assemblyline.common import ServiceResponsecorrectfrom assemblyline_service_client import ServiceResponse
Quickstart
from assemblyline_service_client import ServiceClient, ServiceRequest, ServiceResponse
# Initialize client - in production use proper auth
client = ServiceClient("http://localhost:5001", apikey=("user", "key"))
# Process a submission
request = ServiceRequest({"sha256": "...", "metadata": {}})
response = client.do_task(request)
print(response.results)