FireEye Client Library for Python
Project description
FireEye Client Library for Python
This is the Python client library for all things FireEye API. Currently it only supports FireEye's Detection On Demand but will have support for other FireEye API's soon.
For more API information, visit the FireEye Developer Hub
Installation
To install the Python client library:
pip install fireeyepy
To upgrade your installed library:
pip install fireeyepy --upgrade
Alternatively, you can clone the repository via the command line:
git clone https://github.com/fireeye/fireeye-python.git
Usage
Begin by importing the 'fireeye' module:
import fireeyepy
Detection On Demand
Construct a Detection object with your api key:
detection = fireeyepy.Detection(key=api_key)
To obtain a free trial API key, subscribe on the AWS Marketplace
Upload A File
response = detection.submit_file(file_name="myfile.txt", contents=open("path/to/myfile.txt", "rb"))
By default, submit_file() will only send the first 32 MB (32,000,000 bytes) of a file, which is the API limit, but this can be configured by setting the "file_size_limit" option to any positive integer, where the unit is bytes. While you can send more than 32 MB, the API will only use the first 32 MB itself, so this option will save network bandwidth.
# Send the first 10 MB of the file
result = detection.submit_file(file_name="myfile.txt", contents=open("path/to/myfile.txt", "rb"), file_size_limit=10000000)
Retrieve File Report
response = detection.get_report(report_id)
You may also provide the optional extended=True
flag to get the full, in-depth report:
response = detection.get_report(report_id, extended=True)
Retrieve Presigned URL for Dashboard Report
result = detection.get_presigned_url(report_id)
Perform Hash Lookup
response = detection.get_hash(hash)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for fireeyepy-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e39cdf198bd9d374957ff8b758780dc0b8c96df231a231498a34212f13921f7 |
|
MD5 | cc680a73b24cc46f1344753809696722 |
|
BLAKE2b-256 | f4f9a755acf35d34e4c43e6da8c0656ef9f269faa0e13b796c3150fa101b1da4 |