|
1 |
| -# cb-binary-analysis |
2 |
| -Binary Analysis SDK for the Carbon Black Cloud |
| 1 | +[](https://app.codeship.com/projects/384255) |
| 2 | +[](https://coveralls.io/github/carbonblack/cb-binary-analysis?branch=develop) |
| 3 | +# Carbon Black Cloud Binary Toolkit |
| 4 | + |
| 5 | +#### \*\*Disclaimer: This is an ALPHA release\*\* |
| 6 | + |
| 7 | +**Latest Version:** 1.0a1 |
| 8 | +<br> |
| 9 | +**Release Date:** 05/11/2020 |
| 10 | + |
| 11 | +The Carbon Black Cloud Binary Toolkit provides a system of processing incoming SHA256 hashes by integrating with the Unified Binary Store (UBS) on the Carbon Black Cloud (CBC). |
| 12 | + |
| 13 | + |
| 14 | +## Recent updates |
| 15 | + |
| 16 | +View the latest release notes [here](https://github.com/carbonblack/cbc-binary-toolkit/releases). |
| 17 | + |
| 18 | + |
| 19 | +## License |
| 20 | + |
| 21 | +Use of the Carbon Black API is governed by the license found in [LICENSE](LICENSE). |
| 22 | + |
| 23 | +## Support |
| 24 | + |
| 25 | +1. View all API and integration offerings on the [Developer Network](https://developer.carbonblack.com) along with reference documentation, video tutorials, and how-to guides. |
| 26 | +2. Use the [Developer Community Forum](https://community.carbonblack.com/) to discuss issues and get answers from other API developers in the Carbon Black Community. |
| 27 | +3. Create a github issue for bugs and change requests. Formal [Carbon Black Support](http://carbonblack.com/resources/support/) coming with v1.0. |
| 28 | + |
| 29 | +## Requirements |
| 30 | + |
| 31 | +The Carbon Black Cloud Binary Toolkit is design to work on Python 3.6 and above. |
| 32 | + |
| 33 | +All requirements are installed as part of `pip install` or if you're planning on pushing changes to the Carbon Black Cloud Binary Toolkit, the following can be used after cloning the repo `pip install requirements.txt` |
| 34 | + |
| 35 | +### Python Packages |
| 36 | +* argparse |
| 37 | +* cbapi |
| 38 | +* python-dateutil |
| 39 | +* pyyaml |
| 40 | +* requests |
| 41 | +* schema |
| 42 | +* yara-python |
| 43 | + |
| 44 | +### Carbon Black Cloud |
| 45 | +* Enterprise EDR |
| 46 | + |
| 47 | +## Getting Started |
| 48 | + |
| 49 | +There are two ways to use the Carbon Black Cloud Binary Toolkit. You can either run the Binary Analysis Tool using out-of-the-box functionality, or you can use the Toolkit to develop your own tool for processing binaries. |
| 50 | + |
| 51 | + |
| 52 | +First you will need to install the Binary Toolkit with the following command: |
| 53 | +``` |
| 54 | +pip install cbc-binary-toolkit |
| 55 | +``` |
| 56 | + |
| 57 | +### Running Binary Analysis tool |
| 58 | + |
| 59 | +The cbc-binary-analysis tool provides out-of-the-box builtin resources for processing binaries and managing the analysis results. For more information see the [User Guide](https://github.com/carbonblack/cbc-binary-toolkit/wiki/User-Guide) wiki page. |
| 60 | + |
| 61 | +``` |
| 62 | +usage: cbc-binary-analysis [-h] [-c CONFIG] |
| 63 | + [-ll {DEBUG,INFO,WARNING,ERROR,CRITICAL}] |
| 64 | + {analyze,restart,clear} ... |
| 65 | +
|
| 66 | +positional arguments: |
| 67 | + {analyze,restart,clear} |
| 68 | + Binary analysis commands |
| 69 | + analyze Analyze a list of hashes by command line or file |
| 70 | + restart Restart a failed job and pick up where the job crashed |
| 71 | + or exited |
| 72 | + clear Clear cache of analyzed hashes. All or by timestamp |
| 73 | +
|
| 74 | +optional arguments: |
| 75 | + -h, --help show this help message and exit |
| 76 | + -c CONFIG, --config CONFIG |
| 77 | + Location of the configuration file (default .../carbonblackcloud/binary-toolkit/binary-analysis-config.yaml.example) |
| 78 | + -ll {DEBUG,INFO,WARNING,ERROR,CRITICAL}, --log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL} |
| 79 | + The base log level (default INFO) |
| 80 | +``` |
| 81 | + |
| 82 | +**Note: Run --help on any of the commands for up to date arguments** |
| 83 | + |
| 84 | + |
| 85 | +### Using the Toolkit to develop your own tools |
| 86 | + |
| 87 | +The following python code snippet will allow you to begin developing with the Carbon Black Cloud Binary toolkit. For more information see the [Developer Guide](https://github.com/carbonblack/cbc-binary-toolkit/wiki/Developer-Guide) wiki page. |
| 88 | +``` |
| 89 | +from cbc_binary_toolkit import * |
| 90 | +``` |
| 91 | + |
| 92 | + |
| 93 | +## Developing Improvements for the Carbon Black Cloud Binary Toolkit |
| 94 | + |
| 95 | +If you want to provide additional examples, fix a bug, or add a feature to the Toolkit the following steps will get you started. |
| 96 | + |
| 97 | +### Installing for Toolkit development |
| 98 | + |
| 99 | +You will need to fork the repo in order to create pull requests when submitting code for review. For details on forking a repo, see [here](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) |
| 100 | + |
| 101 | +``` |
| 102 | +git clone https://github.com/{fork-name}/cbc-binary-toolkit |
| 103 | +cd cbc-binary-toolkit |
| 104 | +pip install requirements.txt |
| 105 | +``` |
| 106 | + |
| 107 | + |
| 108 | +### Running the Toolkit tests |
| 109 | + |
| 110 | +To check if your code changes didn't break any use cases the following command will run all the tests: |
| 111 | +``` |
| 112 | +pytest |
| 113 | + Optional args: |
| 114 | + -s Logs streamed to stdout |
| 115 | + -k {test or file} Selectively runs test matching string or file |
| 116 | +``` |
| 117 | + |
| 118 | +### Development Flow |
| 119 | + |
| 120 | +To begin a code change start by creating a branch off of the develop branch. |
| 121 | +``` |
| 122 | +git checkout develop |
| 123 | +git checkout -b {branch-name} |
| 124 | +``` |
| 125 | + |
| 126 | +When the feature or bug fix is finished you will need to create a pull request to the CarbonBlack repo, the following will push your changes to Github. |
| 127 | +``` |
| 128 | +git push {remote} {branch-name} |
| 129 | +``` |
| 130 | + |
| 131 | +If your branch is behind the develop branch then you will need to rebase. |
| 132 | +``` |
| 133 | +git checkout {branch-name} |
| 134 | +git rebase develop |
| 135 | +``` |
| 136 | + |
| 137 | +Note if your develop branch is out of sync with the CarbonBlack repo then you will need to sync your fork. For information on syncing your fork, see [here](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork) |
0 commit comments