Assemblyline
raw JSON → 4.7.3.1 verified Mon Apr 27 auth: no python
Assemblyline is an automated malware analysis framework by the Canadian Centre for Cyber Security. This package (assemblyline) contains the core libraries and client components. The current version is 4.7.3.1, released from the assemblyline-base repository. Release cadence is irregular with a mix of dev and stable tags.
pip install assemblyline Common errors
error ModuleNotFoundError: No module named 'assemblyline_client' ↓
cause The assemblyline_client subpackage was not installed.
fix
Install with: pip install assemblyline[all] (includes client) or pip install assemblyline-client separately.
error AttributeError: 'Client' object has no attribute 'submit' ↓
cause Using an outdated client constructor. The Client class is from assemblyline_client, not assemblyline.
fix
Ensure you import 'from assemblyline_client import Client' and use the correct API.
error ValueError: Invalid authentication credentials ↓
cause The apikey parameter expects a tuple of (username, apikey).
fix
Pass credentials as a tuple: Client(host, apikey=('myuser', 'myapikey'))
Warnings
breaking In v4.x, the client library was split into assemblyline and assemblyline_client packages. Importing from assemblyline directly will fail. ↓
fix Use 'from assemblyline_client import Client' instead of 'from assemblyline import Client'.
deprecated The old HTTP API using /api/v1/ endpoints is deprecated. New deployments use /api/v4/. ↓
fix Update your API calls to use /api/v4/ endpoints and the new Client methods.
gotcha Authentication via apikey requires a tuple (username, apikey). Passing a single string will result in a ValueError. ↓
fix Use apikey=(al_user, al_apikey) as a tuple.
Install
pip install assemblyline[all] Imports
- Client wrong
from assemblyline import Clientcorrectfrom assemblyline_client import Client - Datastore wrong
from assemblyline.datastore.collection import Datastorecorrectfrom assemblyline.datastore import Datastore
Quickstart
from assemblyline_client import Client
import os
# Connect to an Assemblyline instance
al_client = Client(
os.environ.get('AL_HOST', 'https://localhost:443'),
apikey=(os.environ.get('AL_USER', ''), os.environ.get('AL_APIKEY', ''))
)
# Submit a file for analysis
response = al_client.submit('path/to/sample.exe')
print('Submission ID:', response['submission']['sid'])