Package: amira
AMIRA: Automated Malware Incident Response & AnalysisAMIRA is a service for automatically running the analysis on theOSXCollectoroutput files.
The automated analysis is performed viaOSXCollector Output Filters,
in particularThe One Filter to Rule Them All: theAnalyze Filter.
AMIRA takes care of retrieving the output files from an S3 bucket,
running the Analyze Filter and then uploading the results
of the analysis back to S3 (although one could envision as well
attaching them to the related JIRA ticket).PrerequisitestoxThe following steps assume you havetoxinstalled on your machine.If this is not the case, please run:$sudopipinstalltoxOSXCollector Output Filters configuration fileAMIRA uses OSXCollector Output Filters to do the actual analysis,
so you will need to have a validosxcollector.yamlconfiguration file in the working directory.
The example configuration file can be found in theOSXCollector Output Filters.The configuration file mentions the location of the file hash and the domain
blacklists.
Make sure that the blacklist locations mentioned in the configuration file are
also available when running AMIRA.AWS credentialsAMIRA uses boto3 to interface with AWS.
You can supply credentials using either of the possibleconfiguration options.The credentials should allow reading and deleting SQS messages
from the SQS queue specified in the AMIRA config as well as
the read access to the objects in the S3 bucket where the OSXCollector
output files are stored.
To be able to upload the analysis results back to the S3 bucket
specified in the AMIRA configuration file, the credentials should
also allow write access to this bucket.AMIRA ArchitectureThe service uses theS3 bucket event notificationsto trigger the analysis.
You will need to configure an S3 bucket for the OSXCollector output files,
so that when a file is added there the notification will be sent to an SQS queue
(AmiraS3EventNotificationsin the picture below).
AMIRA periodically checks the queue for any new messages
and upon receiving one it will fetch the OSXCollector output file from the S3
bucket.
It will then run the Analyze Filter on the retrieved file.The Analyze Filter runs all the filters contained in the OSXCollector Output
Filters package sequentially. Some of them communicate with the external
resources, like domain and hashes blacklists (or whitelists) and threat intel
APIs, e.g.VirusTotal,OpenDNS InvestigateorShadowServer.
The original OSXCollector output is extended with all of this information and
the very last filter run by the Analyze Filter summarizes all of the findings
into a human-readable form. After the filter finishes running, the results of
the analysis will be uploaded to the Analysis Results S3 bucket.The overview of the whole process and the system components involved in it are
depicted below:Using AMIRAThe main entry point to AMIRA is in theamira/amira.pymodule.
You will first need to create an instance of AMIRA class by providing the AWS
region name, where the SQS queue with the event notifications for the
OSXCollector output bucket is, and the SQS queue name:fromamira.amiraimportAMIRAamira=AMIRA('us-west-1','AmiraS3EventNotifications')Then you can register the analysis results uploader, e.g. the S3 results
uploader:fromamira.s3importS3ResultsUploaders3_results_uploader=S3ResultsUploader('amira-results-bucket')amira.register_results_uploader(s3_results_uploader)Finally, run AMIRA:amira.run()Go get some coffee, sit back, relax and wait till the analysis results pop up
in the S3 bucket!