API Documentation
Enrichment
Handle enrichment requests for a specific observable (domain or IP address).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
The incoming request object containing query parameters. |
required |
Returns:
Name | Type | Description |
---|---|---|
Response |
A JSON response indicating whether the observable was found, |
|
and if so, the corresponding IOC. |
Source code in docs/Submodules/GreedyBear/api/views/enrichment.py
Feeds
Handle requests for IOC feeds with specific parameters and format the response accordingly.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
The incoming request object. |
required | |
feed_type
|
str
|
Type of feed (e.g., log4j, cowrie, etc.). |
required |
attack_type
|
str
|
Type of attack (e.g., all, specific attack types). |
required |
prioritize
|
str
|
Prioritization mechanism to use (e.g., recent, persistent). |
required |
format_
|
str
|
Desired format of the response (e.g., json, csv, txt). |
required |
exclude_mass_scanners
|
bool
|
query parameter flag to exclude IOCs that are known mass scanners. |
required |
Returns:
Name | Type | Description |
---|---|---|
Response |
The HTTP response with formatted IOC data. |
Source code in docs/Submodules/GreedyBear/api/views/feeds.py
Advanced Feeds
Handle requests for IOC feeds based on query parameters and format the response accordingly.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
The incoming request object. |
required | |
feed_type
|
str
|
Type of feed to retrieve. (supported: |
required |
attack_type
|
str
|
Type of attack to filter. (supported: |
required |
max_age
|
int
|
Maximum number of days since last occurrence. E.g. an IOC that was last seen 4 days ago is excluded by default. (default: 3) |
required |
min_days_seen
|
int
|
Minimum number of days on which an IOC must have been seen. (default: 1) |
required |
include_reputation
|
str
|
|
required |
exclude_reputation
|
str
|
|
required |
feed_size
|
int
|
Number of IOC items to return. (default: 5000) |
required |
ordering
|
str
|
Field to order results by, with optional |
required |
verbose
|
bool
|
|
required |
paginate
|
bool
|
|
required |
format
|
str
|
Response format type. Besides |
required |
Returns:
Name | Type | Description |
---|---|---|
Response |
The HTTP response with formatted IOC data. |
Source code in docs/Submodules/GreedyBear/api/views/feeds.py
Feeds Pagination
Handle requests for paginated IOC feeds based on query parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
The incoming request object. |
required |
Returns:
Name | Type | Description |
---|---|---|
Response |
The paginated HTTP response with IOC data. |
Source code in docs/Submodules/GreedyBear/api/views/feeds.py
Command Sequence
View function that handles command sequence queries based on IP addresses or SHA-256 hashes.
Retrieves and returns command sequences and related IOCs based on the query parameter. If IP address is given, returns all command sequences executed from this IP. If SHA-256 hash is given, returns details about the specific command sequence. Can include similar command sequences if requested.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
The HTTP request object containing query parameters |
required | |
query
|
str
|
The search term, can be either an IP address or a SHA-256 hash. |
required |
include_similar
|
bool
|
When parameter is present, returns related command sequences based on clustering. |
required |
Returns:
Type | Description |
---|---|
Response object with command sequence data or an error response |
Raises:
Type | Description |
---|---|
Http404
|
If the requested resource is not found |
Source code in docs/Submodules/GreedyBear/api/views/command_sequence.py
general_honeypot_list
Retrieve a list of all general honeypots, optionally filtering by active status.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
The incoming request object containing query parameters. |
required |
Returns:
Name | Type | Description |
---|---|---|
Response |
A JSON response containing the list of general honeypots. |
Source code in docs/Submodules/GreedyBear/api/views/general_honeypot.py
Statistics
Bases: ViewSet
A viewset for viewing and editing statistics related to feeds and enrichment data.
Provides actions to retrieve statistics about the sources and downloads of feeds, as well as statistics on enrichment data.
Source code in docs/Submodules/GreedyBear/api/views/statistics.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
|
__aggregation_response_static_ioc(annotations)
Helper method to generate IOC response based on annotations.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
annotations
|
dict
|
Dictionary containing the annotations for the query. |
required |
Returns:
Name | Type | Description |
---|---|---|
Response |
Response
|
A JSON response containing the aggregated IOC data. |
Source code in docs/Submodules/GreedyBear/api/views/statistics.py
__aggregation_response_static_statistics(annotations)
Helper method to generate statistics response based on annotations.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
annotations
|
dict
|
Dictionary containing the annotations for the query. |
required |
Returns:
Name | Type | Description |
---|---|---|
Response |
Response
|
A JSON response containing the aggregated statistics. |
Source code in docs/Submodules/GreedyBear/api/views/statistics.py
__parse_range(request)
staticmethod
Parse the range parameter from the request query string to determine the time range for the query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
The incoming request object. |
required |
Returns:
Name | Type | Description |
---|---|---|
tuple |
A tuple containing the delta time and basis for the query range. |
Source code in docs/Submodules/GreedyBear/api/views/statistics.py
enrichment(request, pk=None)
Retrieve enrichment statistics, including the number of sources and requests.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
The incoming request object. |
required | |
pk
|
str
|
The type of statistics to retrieve (e.g., "sources", "requests"). |
None
|
Returns:
Name | Type | Description |
---|---|---|
Response |
A JSON response containing the requested statistics. |
Source code in docs/Submodules/GreedyBear/api/views/statistics.py
feeds(request, pk=None)
Retrieve feed statistics, including the number of sources and downloads.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
The incoming request object. |
required | |
pk
|
str
|
The type of statistics to retrieve (e.g., "sources", "downloads"). |
None
|
Returns:
Name | Type | Description |
---|---|---|
Response |
A JSON response containing the requested statistics. |
Source code in docs/Submodules/GreedyBear/api/views/statistics.py
feeds_types(request)
Retrieve statistics for different types of feeds, including Log4j, Cowrie, and general honeypots.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
The incoming request object. |
required |
Returns:
Name | Type | Description |
---|---|---|
Response |
A JSON response containing the feed type statistics. |