API Config (could be modify by user) Returns: a JSON with API configuration
()
| 17 | |
| 18 | |
| 19 | def 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 | |
| 56 | def network_configuration(): |
no test coverage detected