Skip to content

Commit aab3546

Browse files
authored
Release v1.1 (#93)
1 parent b47720f commit aab3546

File tree

10 files changed

+79
-18
lines changed

10 files changed

+79
-18
lines changed

docs/source/adding-yara-rules.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Included Rules
88
BinaryAlert includes a number of `custom YARA rules <https://github.com/airbnb/binaryalert/tree/master/rules/public>`_ written by Airbnb's analysts which detect a variety of hacktools, malware, and ransomware. All included rules have been tested against a corpus of more than 2 million binaries to ensure the highest fidelity.
99

1010

11+
.. _clone-yara-rules:
12+
1113
Clone Rules From Other Projects
1214
-------------------------------
1315
BinaryAlert makes it easy to clone YARA rules from other open-source projects:
@@ -16,11 +18,7 @@ BinaryAlert makes it easy to clone YARA rules from other open-source projects:
1618
1719
$ ./manage.py clone_rules
1820
19-
This will copy a subset of YARA rules from each of the following repositories:
20-
21-
* `Neo23x0/signature-base <https://github.com/Neo23x0/signature-base>`_
22-
* `YARA-Rules/rules <https://github.com/YARA-Rules/rules>`_
23-
21+
This will copy a subset of YARA rules from several :ref:`open-source collections <yara-credits>`.
2422
You can add more rule sources in `rules/clone_rules.py <https://github.com/airbnb/binaryalert/blob/master/rules/clone_rules.py>`_
2523

2624

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@
6363
# built documents.
6464
#
6565
# The short X.Y version.
66-
version = '1.0'
66+
version = '1.1'
6767
# The full version, including alpha/beta/rc tags.
68-
release = '1.0.0'
68+
release = '1.1.0'
6969

7070
# The language for content autogenerated by Sphinx. Refer to documentation
7171
# for a list of supported languages.

docs/source/credits.rst

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
Credits
2+
=======
3+
4+
People
5+
------
6+
BinaryAlert is brought to you by `Airbnb <http://airbnb.io>`_:
7+
8+
- `Austin Byers <https://github.com/austinbyers>`_ (Architect, Primary Engineer)
9+
- `mime-frame <https://github.com/mime-frame>`_ (Concept, Design Review, YARA Rules)
10+
- `Daimon <https://github.com/fusionrace>`_ (YARA Rules)
11+
- And many others in the `full list of contributors <https://github.com/airbnb/binaryalert/graphs/contributors>`_
12+
13+
14+
.. _yara-credits:
15+
16+
YARA Rules
17+
----------
18+
When :ref:`cloning YARA rules from other projects <clone-yara-rules>`, subsets of the following
19+
collections are included by default:
20+
21+
- `Neo23x0/signature-base <https://github.com/Neo23x0/signature-base>`_
22+
- `YARA-Rules/rules <https://github.com/YARA-Rules/rules>`_
23+
24+
25+
Open-Source Tools
26+
-----------------
27+
We are proud to contribute to the open-source community, without which BinaryAlert would not be
28+
possible. BinaryAlert relies on several open-source tools and libraries:
29+
30+
- `backoff <https://github.com/litl/backoff>`_: Function decoration for backoff and retry
31+
- `boto3 <https://boto3.readthedocs.io>`_: AWS SDK for Python
32+
- `cbapi <https://cbapi.readthedocs.io>`_: Carbon Black API for Python
33+
- `pyhcl <https://github.com/virtuald/pyhcl>`_: Python parser for HCL (e.g. Terraform configuration)
34+
- `terraform <https://www.terraform.io/>`_: Infrastructure-as-Code
35+
- `yara <http://virustotal.github.io/yara/>`_: Pattern matching for malware analysis
36+
- `yara-python <https://github.com/VirusTotal/yara-python>`_: The Python interface for YARA
37+
- `yextend <https://github.com/BayshoreNetworks/yextend>`_: YARA analysis of archive data
38+
39+
40+
Bundled Software
41+
................
42+
The following tools are pre-compiled for use in Lambda and included in the BinaryAlert repo:
43+
44+
- `cbapi-python <https://github.com/carbonblack/cbapi-python>`_ | `LICENSE <https://github.com/carbonblack/cbapi-python/blob/master/LICENSE>`__
45+
- `yara-python <https://github.com/VirusTotal/yara-python>`_ | `LICENSE <https://github.com/VirusTotal/yara-python/blob/master/LICENSE>`__
46+
- `yextend <https://github.com/BayshoreNetworks/yextend>`_ | `LICENSE <https://github.com/BayshoreNetworks/yextend/blob/master/LICENSE>`__

docs/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,4 @@ Table of Contents
4646
yara-matches
4747
metrics-and-monitoring
4848
troubleshooting-faq
49+
credits

docs/source/troubleshooting-faq.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Why did my live test fail?
3333
--------------------------
3434
Check the :ref:`Lambda execution logs <cloudwatch_logs>` and the :ref:`BinaryAlert dashboard <cloudwatch_dashboard>` for abnormalities. A common problem is that the BinaryAlert analyzers don't understand the compiled YARA rules file. Make sure your `virtual environment <getting-started.html>`_ is set up correctly and that your YARA rules only use the :ref:`supported modules <supported_yara_modules>`. It is also possible that one or more AWS components might be down.
3535

36+
It may take 1-3 minutes after a deploy before the Lambda functions are ready to go. If a live test fails immediately after a deploy, wait a few minutes and try again.
37+
3638

3739
How do I setup YARA match / metric alarm alerts?
3840
------------------------------------------------

lambda_functions/analyzer/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,4 @@ and install ``yara-python`` and ``yextend`` as follows:
7272
zip -r yara3.7.0_yextend1.6.zip *
7373
7474
75-
Then ``scp`` the newzipfile to replace the one in the repo.
75+
Then ``scp`` the new zipfile to replace the one in the repo.

lambda_functions/analyzer/yara_analyzer.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77

88
import yara
99

10+
if __package__:
11+
from lambda_functions.analyzer.common import LOGGER
12+
else:
13+
from common import LOGGER # type: ignore
14+
1015

1116
# YARA matches from both yara-python and yextend are stored in this generic YaraMatch tuple.
1217
YaraMatch = collections.namedtuple(
@@ -109,9 +114,13 @@ def analyze(self, target_file: str, original_target_path: str = '') -> List[Yara
109114

110115
# Yextend matches
111116
os.environ['LD_LIBRARY_PATH'] = os.environ['LAMBDA_TASK_ROOT']
112-
yextend_output = subprocess.check_output(
113-
['./yextend', '-r', self._compiled_rules_file, '-t', target_file, '-j'])
114-
yextend_list = json.loads(yextend_output.decode('utf-8'))
115-
yextend_matches = _convert_yextend_to_yara_match(yextend_list[0])
117+
try:
118+
yextend_output = subprocess.check_output(
119+
['./yextend', '-r', self._compiled_rules_file, '-t', target_file, '-j'])
120+
yextend_list = json.loads(yextend_output.decode('utf-8'))
121+
except (json.JSONDecodeError, subprocess.CalledProcessError):
122+
LOGGER.exception('Fatal error when running yextend')
123+
return yara_python_matches
116124

125+
yextend_matches = _convert_yextend_to_yara_match(yextend_list[0])
117126
return yara_python_matches + yextend_matches

manage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from tests import live_test
2222

2323
# BinaryAlert version.
24-
VERSION = '1.1.0.beta'
24+
VERSION = '1.1.0'
2525

2626
# File locations.
2727
PROJECT_DIR = os.path.dirname(os.path.realpath(__file__)) # Directory containing this file.

terraform/lambda_iam.tf

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,14 @@ data "aws_iam_policy_document" "binaryalert_analyzer_policy" {
117117
}
118118

119119
statement {
120-
sid = "GetFromBinaryAlertBucket"
121-
effect = "Allow"
122-
actions = ["s3:GetObject"]
120+
sid = "GetFromBinaryAlertBucket"
121+
effect = "Allow"
122+
123+
actions = [
124+
"s3:GetObject",
125+
"s3:HeadObject",
126+
]
127+
123128
resources = ["${aws_s3_bucket.binaryalert_binaries.arn}/*"]
124129
}
125130

terraform/terraform.tfvars

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ sqs_retention_minutes = 60
5858
// Number of S3 object keys to pack into a single SQS message.
5959
// Each downstream analyzer will process at most 10 SQS messages, each with this many objects.
6060
// Higher values allow for higher throughput, but are constrained by analyzer execution time limit.
61-
lambda_batch_objects_per_message = 15
61+
lambda_batch_objects_per_message = 5
6262

6363
// Memory limit (MB) for the batching Lambda function. 128 is the minimum allowed by Lambda.
6464
lambda_batch_memory_mb = 128
@@ -68,7 +68,7 @@ lambda_batch_memory_mb = 128
6868
lambda_dispatch_frequency_minutes = 2
6969

7070
// Maximum number of analyzers that can be asynchronously invoked during one dispatcher run.
71-
// Higher values allow for more throughtput, but if too many analyzers are invoked too quickly,
71+
// Higher values allow for more throughput, but if too many analyzers are invoked too quickly,
7272
// Lambda invocations may be throttled.
7373
lambda_dispatch_limit = 500
7474

0 commit comments

Comments
 (0)