MCPcopy Index your code
hub / github.com/OWASP/Python-Honeypot / api_configuration

Function api_configuration

config.py:19–53  ·  view source on GitHub ↗

API Config (could be modify by user) Returns: a JSON with API configuration

()

Source from the content-addressed store, hash-verified

17
18
19def api_configuration():
20 """
21 API Config (could be modify by user)
22
23 Returns:
24 a JSON with API configuration
25 """
26 # DOCKER_ENV variable is set in the docker-compose file.
27 if os.environ.get('ELASTICSEARCH_DOCKER_ENV') == "true":
28 db_url = "elasticsearch:9200"
29 else:
30 db_url = "127.0.0.1:9200"
31
32 return { # OWASP Honeypot API Default Configuration
33 "api_host": "0.0.0.0",
34 "api_port": 5000,
35 "api_debug_mode": False,
36 "api_access_without_key": True,
37 "api_access_key": generate_token(), # or any string, or None
38 "api_client_white_list": {
39 "enabled": False,
40 "ips": [
41 "127.0.0.1",
42 "10.0.0.1",
43 "192.168.1.1"
44 ]
45 },
46 "api_access_log": {
47 "enabled": False,
48 "filename": "ohp_api_access.log"
49 },
50 # http://127.0.0.1:9200/ # todo: add SSL support later
51 "api_database": db_url,
52 "api_database_http_auth": ('elastic', 'changeme')
53 }
54
55
56def network_configuration():

Callers 3

connector.pyFile · 0.90
check_for_requirementsFunction · 0.90
start_api_serverFunction · 0.90

Calls 1

generate_tokenFunction · 0.90

Tested by

no test coverage detected