Add background task to export suspicious IPs to text file
- Implement export-malicious-ips task that queries distinct IPs flagged
as is_suspicious from database and writes to exports/malicious_ips.txt
- Add exports volume mount to docker-compose.yaml for host persistence
- Update entrypoint.sh to fix ownership of exports directory for krawl user
- Update Dockerfile to create /app/exports directory during build
Other tasks can be added by creating them in the tasks dir using the same setup as this task.
All tasks *MUST* include a TASK_CONFIG dict and a main method in the file to work correctly.
This commit is contained in:
@@ -13,6 +13,7 @@ from tracker import AccessTracker
|
||||
from handler import Handler
|
||||
from logger import initialize_logging, get_app_logger, get_access_logger, get_credential_logger
|
||||
from database import initialize_database
|
||||
from tasks_master import get_tasksmaster
|
||||
|
||||
|
||||
def print_usage():
|
||||
@@ -89,6 +90,10 @@ def main():
|
||||
except IOError:
|
||||
app_logger.warning("Can't read input file. Using randomly generated links.")
|
||||
|
||||
# tasks master init
|
||||
tasks_master = get_tasksmaster()
|
||||
tasks_master.run_scheduled_tasks()
|
||||
|
||||
try:
|
||||
app_logger.info(f'Starting deception server on port {config.port}...')
|
||||
app_logger.info(f'Timezone configured: {tz.key}')
|
||||
|
||||
Reference in New Issue
Block a user