Skip to content

Commit abc964e

Browse files
author
Birger Schacht
committed
DOCS: fix some sphinx warnings
This commit fixes various errors and warnings from sphinx, mostly due to wrong indents.
1 parent 3bbf120 commit abc964e

File tree

24 files changed

+213
-239
lines changed

24 files changed

+213
-239
lines changed

docs/dev/guide.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ Class name of the bot (ex: PhishTank Parser) must correspond to the type of the
295295

296296

297297
IntelMQ Data Format Rules
298-
========================
298+
=========================
299299

300300
Any component of IntelMQ MUST respect the IntelMQ Data Format.
301301

docs/user/intelmq-manager.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ When using distribution packages, the webserver configuration (which is also sho
2929
The webinterface is then available at ``http://localhost/intelmq-manager``.
3030

3131
Installation using pip
32-
^^^^^^^^^^^^^^^^^^^^^^
32+
======================
3333

3434
For installation via pip, the situation is more complex.
3535
``pip3 install intelmq-manager`` installs the HTML files in ``${PREFIX}/usr/share/intelmq-manager/html``.
@@ -80,7 +80,7 @@ Configuration
8080
In the file ``/usr/share/intelmq-manager/html/js/vars.js`` set ``ROOT`` to the URL of your ``intelmq-api`` installation- by default that's on the same host as ``intelmq-manager``.
8181

8282
CSP Headers
83-
==========
83+
===========
8484

8585
It is recommended to set these two headers for all requests:
8686

intelmq/bin/intelmqctl.py

Lines changed: 34 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -368,21 +368,14 @@ def _interpret_commandline(pid: int, cmdline: Iterable[str],
368368
"""
369369
Separate function to allow easy testing
370370
371-
Parameters
372-
----------
373-
pid : int
374-
Process ID, used for return values (error messages) only.
375-
cmdline : Iterable[str]
376-
The command line of the process.
377-
module : str
378-
The module of the bot.
379-
bot_id : str
380-
The ID of the bot.
381-
382-
Returns
383-
-------
384-
Union[bool, str]
385-
DESCRIPTION.
371+
Parameters:
372+
pid (int): Process ID, used for return values (error messages) only.
373+
cmdline (Iterable[str]): The command line of the process.
374+
module (str): The module of the bot.
375+
bot_id (str): The ID of the bot.
376+
377+
Returns:
378+
Union[bool, str]: DESCRIPTION.
386379
"""
387380
if len(cmdline) > 2 and cmdline[1].endswith('/%s' % module):
388381
if cmdline[2] == bot_id:
@@ -1599,29 +1592,32 @@ def upgrade_conf(self, previous=None, dry_run=None, function=None,
15991592
state_file: location of the state file
16001593
no_backup: Do not create backups of state and configuration files
16011594
1602-
state file:
1603-
1604-
version_history = [..., [2, 0, 0], [2, 0, 1]]
1605-
upgrades = {
1606-
"v112_feodo_tracker_domains": true,
1607-
"v112_feodo_tracker_ips": false,
1608-
"v200beta1_ripe_expert": false
1609-
}
1610-
results = [
1611-
{"function": "v112_feodo_tracker_domains",
1612-
"success": true,
1613-
"retval": null,
1614-
"time": "..."},
1615-
{"function": "v112_feodo_tracker_domains",
1616-
"success": false,
1617-
"retval": "fix it manually",
1618-
"message": "fix it manually",
1619-
"time": "..."},
1620-
{"function": "v200beta1_ripe_expert",
1621-
"success": false,
1622-
"traceback": "...",
1623-
"time": "..."}
1624-
]
1595+
state_file:
1596+
1597+
.. code-block:: json
1598+
1599+
version_history = [..., [2, 0, 0], [2, 0, 1]]
1600+
upgrades = {
1601+
"v112_feodo_tracker_domains": true,
1602+
"v112_feodo_tracker_ips": false,
1603+
"v200beta1_ripe_expert": false
1604+
}
1605+
results = [
1606+
{"function": "v112_feodo_tracker_domains",
1607+
"success": true,
1608+
"retval": null,
1609+
"time": "..."},
1610+
{"function": "v112_feodo_tracker_domains",
1611+
"success": false,
1612+
"retval": "fix it manually",
1613+
"message": "fix it manually",
1614+
"time": "..."},
1615+
{"function": "v200beta1_ripe_expert",
1616+
"success": false,
1617+
"traceback": "...",
1618+
"time": "..."}
1619+
]
1620+
16251621
"""
16261622
if os.path.isfile(state_file):
16271623
if not os.access(state_file, os.W_OK) and not dry_run:

intelmq/bots/collectors/http/collector_http.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,24 @@
77
HTTP collector bot
88
99
Parameters:
10-
http_url: string
11-
http_header: dictionary
12-
default: {}
13-
http_verify_cert: boolean
14-
default: True
15-
extract_files: value used to extract files from downloaded compressed file
16-
default: None
17-
all: True; some: string with file names separated by ,
18-
http_url_formatting: bool|json to turn on time formatting (and to specify delta to current time)
19-
http_username, http_password: string
20-
http_proxy, https_proxy: string
21-
http_timeout_sec: tuple of two floats or float
22-
http_timeout_max_tries: an integer depicting how often a connection attempt is retried
23-
verify_pgp_signatures: whether to download and check file signatures
24-
default: False
25-
signature_url: string
26-
signature_url_formatting: the same as http_url_formatting
27-
gpg_keyring: none (defaults to user's GPG keyring) or string (path to keyring file)
10+
http_url (string)
11+
http_header (dictionary): default: {}
12+
http_verify_cert (boolean): default: True
13+
extract_files: value used to extract files from downloaded compressed file
14+
default: None
15+
all: True; some: string with file names separated by ,
16+
http_url_formatting (bool|json): to turn on time formatting (and to specify delta to current time)
17+
http_username (string)
18+
http_password (string)
19+
http_proxy (string)
20+
https_proxy (string)
21+
http_timeout_sec: tuple of two floats or float
22+
http_timeout_max_tries (int): an integer depicting how often a connection attempt is retried
23+
verify_pgp_signatures (bool): whether to download and check file signatures
24+
default: False
25+
signature_url (string)
26+
signature_url_formatting: the same as http_url_formatting
27+
gpg_keyring: none (defaults to user's GPG keyring) or string (path to keyring file)
2828
"""
2929
from datetime import datetime, timedelta
3030

intelmq/bots/collectors/http/collector_http_stream.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
HTTP collector bot
88
99
Parameters:
10-
http_url: string
11-
http_header: dictionary
12-
default: {}
13-
http_verify_cert: boolean
14-
default: True
15-
http_username, http_password: string
16-
http_proxy, https_proxy: string
17-
strip_lines: boolean
18-
http_timeout_sec: tuple of two floats or float
10+
http_url: string
11+
http_header: dictionary
12+
default: {}
13+
http_verify_cert: boolean
14+
default: True
15+
http_username, http_password: string
16+
http_proxy, https_proxy: string
17+
strip_lines: boolean
18+
http_timeout_sec: tuple of two floats or float
1919
"""
2020

2121
from http.client import IncompleteRead

intelmq/bots/collectors/misp/collector.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,16 @@
66
"""A collector for grabbing appropriately tagged events from MISP.
77
88
Parameters:
9-
- misp_url: URL of the MISP server
10-
- misp_key: API key for accessing MISP
11-
- misp_tag_to_process: MISP tag identifying events to be processed
12-
- misp_tag_processed: MISP tag identifying events that have been processed
9+
misp_url: URL of the MISP server
10+
misp_key: API key for accessing MISP
11+
misp_tag_to_process: MISP tag identifying events to be processed
12+
misp_tag_processed: MISP tag identifying events that have been processed
1313
1414
15-
PyMISP versions released after January 2020 will no longer support the
16-
"old" PyMISP class.
15+
PyMISP versions released after January 2020 will no longer support the "old" PyMISP class.
1716
For compatibility:
18-
* older versions of pymisp still work with this bot
19-
* the deprecated parameter `misp_verify` will create a DeprecationWarning
17+
* older versions of pymisp still work with this bot
18+
* the deprecated parameter `misp_verify` will create a DeprecationWarning
2019
"""
2120
import json
2221
import warnings

intelmq/bots/collectors/shadowserver/collector_reports_api.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,12 @@ class ShadowServerAPICollectorBot(CollectorBot, HttpMixin, CacheMixin):
2424
"""
2525
Connects to the Shadowserver API, requests a list of all the reports for a specific country and processes the ones that are new
2626
27-
Parameters
28-
----------
29-
api_key: str
30-
Your Shadowserver API key
31-
secret: str
32-
Your Shadowserver API secret
33-
country: str
34-
The country you want to download reports for (i.e. 'austria')
35-
types: list
36-
A list of strings or a string of comma-separated values with the names of reporttypes you want to process. If you leave this empty, all the available reports will be downloaded and processed (i.e. 'scan', 'drones', 'intel', 'sandbox_connection', 'sinkhole_combined').
27+
Parameters:
28+
api_key (str): Your Shadowserver API key
29+
secret (str): Your Shadowserver API secret
30+
country (str): The country you want to download reports for (i.e. 'austria')
31+
types (list):
32+
A list of strings or a string of comma-separated values with the names of reporttypes you want to process. If you leave this empty, all the available reports will be downloaded and processed (i.e. 'scan', 'drones', 'intel', 'sandbox_connection', 'sinkhole_combined').
3733
"""
3834

3935
country = None

intelmq/bots/experts/http/expert_status.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@ class HttpStatusExpertBot(ExpertBot):
1414
"""
1515
Fetch the HTTP Status for a given URL
1616
17-
Parameters
18-
----------
19-
field: str
20-
The name of the field containing the URL to be checked (defaults to 'source.url').
21-
success_status_codes: List
22-
A list of success status codes. If this parameter is omitted or the list is empty,
23-
successful status codes are the ones between 200 and 400.
24-
overwrite:
25-
Specifies if an existing 'status' value should be overwritten.
17+
Parameters:
18+
field (str):
19+
The name of the field containing the URL to be checked (defaults to 'source.url').
20+
success_status_codes (List):
21+
A list of success status codes. If this parameter is omitted or the list is empty,
22+
successful status codes are the ones between 200 and 400.
23+
overwrite (bool):
24+
Specifies if an existing 'status' value should be overwritten.
2625
"""
2726
field: str = "source.url" # The field containing the URL
2827
success_status_codes: List[int] = [] # A list of status codes for success

intelmq/bots/experts/jinja/expert.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ class JinjaExpertBot(Bot):
1919
"""
2020
Modify the message using the Jinja templating engine
2121
Example:
22-
fields:
23-
output: The provider is {{ msg['feed.provider'] }}!
24-
feed.url: "{{ msg['feed.url'] | upper }}"
25-
extra.somejinjaoutput: file:///etc/intelmq/somejinjatemplate.j2
22+
.. code-block:: yaml
23+
24+
fields:
25+
output: The provider is {{ msg['feed.provider'] }}!
26+
feed.url: "{{ msg['feed.url'] | upper }}"
27+
extra.somejinjaoutput: file:///etc/intelmq/somejinjatemplate.j2
2628
"""
2729

2830
fields: Dict[str, Union[str, Template]] = {}

intelmq/bots/experts/splunk_saved_search/expert.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@
4444
search returns more than one result. All
4545
specified actions are performed. Any
4646
reasonable combination of:
47-
limit: limit the search so that duplicates
48-
are impossible
47+
limit: limit the search so that duplicates are impossible
4948
warn: log a warning message
5049
use_first: use the first search result
5150
ignore: do not modify the event

0 commit comments

Comments
 (0)