Skip to content

Commit d674430

Browse files
author
azazelm3dj3d
authored
Merge pull request #147 from InQuest/rc
Release: v1.1.0
2 parents 9c541e5 + 3e12d4f commit d674430

45 files changed

Lines changed: 498 additions & 529 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@ coverage.xml
2222
.coverage
2323

2424
# Sphinx documentation
25-
docs/_build/
25+
docs/_build/
26+
27+
# Local
28+
.DS_Store
29+
.vscode/

Dockerfile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@ RUN apt-get install sqlite3
77
RUN apt-get install tesseract-ocr -y
88
RUN apt-get install python3-lxml -y
99

10+
COPY requirements.txt .
11+
1012
RUN pip3 install --upgrade pip
11-
RUN pip3 install threatingestor \
12-
twitter \
13-
feedparser \
14-
iocextract \
15-
pytesseract \
16-
numpy \
17-
opencv-python
13+
RUN pip3 install -r requirements.txt
14+
RUN pip3 install opencv-python pytesseract numpy
15+
RUN pip3 install threatingestor
1816

1917
COPY config.yml .

Dockerfile.dev

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Comes with Python 3.6.9 installed by default
2+
FROM ubuntu:18.04
3+
4+
RUN apt-get update
5+
RUN apt-get install python3-pip -y
6+
RUN apt-get install sqlite3
7+
RUN apt-get install tesseract-ocr -y
8+
RUN apt-get install python3-lxml -y
9+
RUN apt-get install git -y
10+
11+
COPY requirements.txt .
12+
COPY requirements-testing.txt .
13+
COPY dist/threatingestor-*.whl .
14+
COPY tests/* tests/
15+
COPY tests/fixtures/whitelist.json tests/fixtures/
16+
17+
RUN pip3 install --upgrade pip
18+
RUN pip3 install -r requirements.txt
19+
RUN pip3 install -r requirements-testing.txt
20+
RUN pip3 install opencv-python pytesseract numpy
21+
RUN pip3 install feedparser threatingestor-*.whl
22+
23+
COPY config.yml .

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
include LICENSE
2-
include README.rst
2+
include README.md
33
include requirements.txt
44
include requirements-testing.txt

README.md

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
# ThreatIngestor
2+
3+
![Build Status](https://github.com/InQuest/ThreatIngestor/workflows/threatingestor-workflow/badge.svg?branch=master)
4+
![Developed by InQuest](https://inquest.net/images/inquest-badge.svg)
5+
6+
![Documentation Status](https://readthedocs.org/projects/threatingestor/badge/?version=latest)
7+
![PyPI Version](http://img.shields.io/pypi/v/ThreatIngestor.svg)
8+
9+
An extendable tool to extract and aggregate [IOCs](https://en.wikipedia.org/wiki/Indicator_of_compromise) from threat feeds.
10+
11+
Integrates out-of-the-box with [ThreatKB](https://github.com/InQuest/ThreatKB) and [MISP](https://www.misp-project.org/), and can fit seamlessly into any existing workflow with [SQS](https://aws.amazon.com/sqs/), [Beanstalk](https://beanstalkd.github.io/), and [custom plugins](https://inquest.readthedocs.io/projects/threatingestor/en/latest/developing.html).
12+
13+
Currently used by InQuest Labs IOC-DB: https://labs.inquest.net/iocdb
14+
15+
## Overview
16+
17+
ThreatIngestor can be configured to watch Twitter, RSS feeds, sitemap (XML) feeds, or other sources, extract meaningful information such as malicious IPs/domains and YARA signatures, and send that information to another system for analysis.
18+
19+
![ThreatIngestor flowchart with several sources feeding into multiple operators](https://inquest.readthedocs.io/projects/threatingestor/en/latest/_images/mermaid-multiple-operators.png)
20+
21+
Try it out now with this [quick walkthrough](https://inquest.readthedocs.io/projects/threatingestor/en/latest/welcome.html#try-it-out), read more [ThreatIngestor walkthroughs](https://inquest.net/taxonomy/term/42) on the InQuest blog, and check out [labs.inquest.net/iocdb](https://labs.inquest.net/iocdb), an IOC aggregation and querying tool powered by ThreatIngestor.
22+
23+
## Installation
24+
25+
ThreatIngestor requires Python 3.6+, with development headers.
26+
27+
Install ThreatIngestor from PyPI:
28+
29+
```bash
30+
pip install threatingestor
31+
```
32+
33+
Install optional dependencies for using some plugins, as needed:
34+
35+
```bash
36+
pip install threatingestor[all]
37+
```
38+
39+
View the [full installation instructions](https://inquest.readthedocs.io/projects/threatingestor/en/latest/installation.html) for more information.
40+
41+
## Usage
42+
43+
Create a new ``config.yml`` file, and configure each source and operator module you want to use. (See ``config.example.yml`` for layout.) Then run the script:
44+
45+
```bash
46+
threatingestor config.yml
47+
```
48+
49+
By default, it will run forever, polling each configured source every 15 minutes.
50+
51+
If you'd like to run the image extraction source, or include the image extraction functionality for other sources, you will need to be running Python 3.7 >= due to the dependencies:
52+
53+
```bash
54+
pip install opencv-python pytesseract numpy
55+
```
56+
57+
View the [full ThreatIngestor documentation](https://inquest.readthedocs.io/projects/threatingestor/) for more information.
58+
59+
## Plugins
60+
61+
ThreatIngestor uses a plugin architecture with "source" (input) and "operator" (output) plugins. The currently supported integrations are:
62+
63+
### Sources
64+
65+
- [Git repositories](https://inquest.readthedocs.io/projects/threatingestor/en/latest/sources/git.html)
66+
- [GitHub repository search](https://inquest.readthedocs.io/projects/threatingestor/en/latest/sources/github.html)
67+
- [Gists by username](https://inquest.readthedocs.io/projects/threatingestor/en/latest/sources/github_gist.html)
68+
- [RSS feeds](https://inquest.readthedocs.io/projects/threatingestor/en/latest/sources/rss.html)
69+
- [Sitemap feeds](https://inquest.readthedocs.io/projects/threatingestor/en/latest/sources/sitemap.html)
70+
- [Image extraction](https://inquest.readthedocs.io/projects/threatingestor/en/latest/sources/image.html)
71+
- [Amazon SQS queues](https://inquest.readthedocs.io/projects/threatingestor/en/latest/sources/sqs.html)
72+
- [Twitter](https://inquest.readthedocs.io/projects/threatingestor/en/latest/sources/twitter.html)
73+
- [Generic web pages](https://inquest.readthedocs.io/projects/threatingestor/en/latest/sources/web.html)
74+
75+
### Operators
76+
77+
- [CSV files](https://inquest.readthedocs.io/projects/threatingestor/en/latest/operators/csv.html)
78+
- [MISP](https://inquest.readthedocs.io/projects/threatingestor/en/latest/operators/misp.html)
79+
- [MySQL table](https://inquest.readthedocs.io/projects/threatingestor/en/latest/operators/mysql.html)
80+
- [SQLite database](https://inquest.readthedocs.io/projects/threatingestor/en/latest/operators/sqlite.html)
81+
- [Amazon SQS queues](https://inquest.readthedocs.io/projects/threatingestor/en/latest/operators/sqs.html)
82+
- [ThreatKB](https://inquest.readthedocs.io/projects/threatingestor/en/latest/operators/threatkb.html)
83+
- [Twitter](https://inquest.readthedocs.io/projects/threatingestor/en/latest/operators/twitter.html)
84+
85+
View the [full ThreatIngestor documentation](https://inquest.readthedocs.io/projects/threatingestor/) for more information on included plugins, and how to create your own.
86+
87+
## Threat Intel Sources
88+
89+
Looking for some threat intel sources to get started? InQuest has a Twitter List with several accounts that post C2 domains and IPs: https://twitter.com/InQuest/lists/ioc-feed. Note that you will need to apply for a Twitter developer account to use the ThreatIngestor Twitter Source. Take a look at ``config.example.yml`` to see how to set this list up as a source.
90+
91+
For quicker setup, RSS feeds can be a great source of intelligence. Check out this example [RSS config file](https://github.com/InQuest/ThreatIngestor/blob/master/rss.example.yml) for a few pre-configured security blogs.
92+
93+
## Support
94+
95+
If you need help getting set up, or run into any issues, feel free to open an [issue](https://github.com/InQuest/ThreatIngestor/issues). You can also reach out to [@InQuest](https://twitter.com/InQuest) on Twitter or read more about us on the web at https://www.inquest.net.
96+
97+
We'd love to hear any feedback you have on ThreatIngestor, its documentation, or how you're putting it to work for you!
98+
99+
## Contributing
100+
101+
Issues and pull requests are welcomed. Please keep Python code PEP8 compliant. By submitting a pull request you agree to release your submissions under the terms of the [LICENSE](https://github.com/InQuest/ThreatIngestor/blob/master/LICENSE).
102+
103+
## Docker
104+
105+
106+
### Production
107+
108+
A `Dockerfile` is available for running ThreatIngestor within a Docker container.
109+
110+
First, you'll need to build the container:
111+
112+
```bash
113+
docker build . -t threatingestor
114+
```
115+
116+
After that, you can mount the container by using this command:
117+
118+
```bash
119+
docker run -it --mount type=bind,source=/,target=/dock threatingestor /bin/bash
120+
```
121+
122+
After you've mounted the container and you're inside the `/bin/bash` shell, you can run ThreatIngestor like normal:
123+
124+
```bash
125+
threatingestor config.yml
126+
```
127+
128+
### Development
129+
130+
There is also a Dockerfile.dev for building a development version of ThreatIngestor. All you need is an available .whl file, which can be generated with the following command:
131+
132+
```bash
133+
python3 -m build
134+
```
135+
136+
After you've built the project, you can build the container:
137+
138+
```bash
139+
docker build . -t threatingestor -f Dockerfile.dev
140+
```
141+
142+
NOTE: If you run into any issues while building the development environment or running ThreatIngestor within the container, you may need to comment out the following lines in `Dockerfile.dev` to work properly:
143+
144+
```
145+
FROM ubuntu:18.04
146+
...
147+
# RUN apt-get install tesseract-ocr -y
148+
...
149+
# RUN pip3 install opencv-python pytesseract numpy
150+
...
151+
```

README.rst

Lines changed: 0 additions & 155 deletions
This file was deleted.

0 commit comments

Comments
 (0)