Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Error: KeyError('template-url') occurs during a vulnerability scan. #1476

Open
1 task done
YSalai opened this issue Jan 15, 2025 · 1 comment
Open
1 task done
Labels
bug Something isn't working

Comments

@YSalai
Copy link

YSalai commented Jan 15, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Hello, I'm encountering a issue during a scan. I want to set up reNgine for my company. Most of the time, the scans was passed successfully but when I run a vulnerability scan, it fails.

Expected Behavior

After a clean install of reNgine, i tried to make a vulnerabilty scan by targeting a custom site of "google-gruyere.appspot.com" and during the scan, it failed on an error :Error: KeyError('template-url')

Screenshot 2025-01-15 at 14 38 34

The same issue occurs when I tried with an other targets.

Can you help me about this ?

Steps To Reproduce

  1. In my case, I have a docker Swarm, and i run reNgine on an AWS instance "Ubuntu 24.04.1 LTS". It is a worker in the swarm.

  2. My compose for Rengine looks like this:

configs:
  rengine_nginx_config:
    file: ./configurations/rengine.conf

services:
  redis:
    image: "redis:alpine"
    hostname: redis
    networks:
      rengine:
        aliases:
          - redis
    deploy:
      replicas: 1
      placement:
        constraints: 
          - node.role==worker
          - node.labels.arch==arm
          - node.labels.size==xlarge
          - node.labels.purpose==rengine


  celery:
    image: ghcr.io/deliver-up/rengine:2.2.0
    entrypoint: /usr/src/app/celery-entrypoint.sh
    volumes:
      - github_repos:/usr/src/github
      - wordlist:/usr/src/wordlist
      - scan_results:/usr/src/scan_results
      - gf_patterns:/root/.gf
      - nuclei_templates:/root/nuclei-templates
      - tool_config:/root/.config
      - static_volume:/usr/src/app/staticfiles/
    environment:
      DEBUG: 0
      CELERY_BROKER: {{rengine_celery_broker}}
      CELERY_BACKEND: {{rengine_celery_backend}}
      POSTGRES_DB: {{rengine_database_name}}
      POSTGRES_USER: {{rengine_database_username}}
      POSTGRES_PASSWORD: {{rengine_database_password}}
      POSTGRES_PORT: {{rengine_database_port}}
      POSTGRES_HOST: {{rengine_database_endpoint}}
      MAX_CONCURRENCY: 25
      MIN_CONCURRENCY: 10
    depends_on:
      - redis
    networks:
      - rengine
    deploy:
      replicas: 1
      placement:
        constraints: 
          - node.role==worker
          - node.labels.arch==arm
          - node.labels.size==xlarge
          - node.labels.purpose==rengine

  celery-beat:
    image: ghcr.io/deliver-up/rengine:2.2.0
    entrypoint: /usr/src/app/beat-entrypoint.sh
    command: celery -A reNgine beat -l INFO --scheduler django_celery_beat.schedulers:DatabaseScheduler
    environment:
      CELERY_BROKER: {{rengine_celery_broker}}
      CELERY_BACKEND: {{rengine_celery_backend}}
      POSTGRES_DB: {{rengine_database_name}}
      POSTGRES_USER: {{rengine_database_username}}
      POSTGRES_PASSWORD: {{rengine_database_password}}
      POSTGRES_PORT: {{rengine_database_port}}
      POSTGRES_HOST: {{rengine_database_endpoint}}
    depends_on:
      - celery
    volumes:
      - github_repos:/usr/src/github
      - wordlist:/usr/src/wordlist
      - scan_results:/usr/src/scan_results
      - gf_patterns:/root/.gf
      - nuclei_templates:/root/nuclei-templates
      - tool_config:/root/.config
    networks:
      - rengine
    deploy:
      replicas: 1
      placement:
        constraints: 
          - node.role==worker
          - node.labels.arch==arm
          - node.labels.size==xlarge
          - node.labels.purpose==rengine

  web:
    image: ghcr.io/deliver-up/rengine:2.2.0
    entrypoint: /usr/src/app/entrypoint.sh
    environment:
      DEBUG: 0
      CELERY_BROKER: {{rengine_celery_broker}}
      CELERY_BACKEND: {{rengine_celery_backend}}
      POSTGRES_DB: {{rengine_database_name}}
      POSTGRES_USER: {{rengine_database_username}}
      POSTGRES_PASSWORD: {{rengine_database_password}}
      POSTGRES_PORT: {{rengine_database_port}}
      POSTGRES_HOST: {{rengine_database_endpoint}}
      DJANGO_SUPERUSER_USERNAME: {{rengine_username}}
      DJANGO_SUPERUSER_PASSWORD: {{rengine_password}}
    volumes:
      - github_repos:/usr/src/github
      - wordlist:/usr/src/wordlist
      - scan_results:/usr/src/scan_results
      - gf_patterns:/root/.gf
      - nuclei_templates:/root/nuclei-templates
      - tool_config:/root/.config
      - static_volume:/usr/src/app/staticfiles/
    depends_on:
      - celery
      - celery-beat
    networks:
      rengine:
        aliases:
          - rengine
    deploy:
      replicas: 1
      placement:
        constraints: 
          - node.role==worker
          - node.labels.arch==arm
          - node.labels.size==xlarge
          - node.labels.purpose==rengine

  proxy:
    image: nginx:alpine
    ports:
      - 8082:8082
    depends_on:
      - web
      - db
      - redis
    volumes:
      - static_volume:/usr/src/app/staticfiles/
      - scan_results:/usr/src/scan_results
    configs:
      - source: rengine_nginx_config
        target: /etc/nginx/conf.d/rengine.conf
    networks:
      - traefik
      - rengine
    deploy:
      replicas: 1
      placement:
        constraints: 
          - node.role==worker
          - node.labels.arch==arm
          - node.labels.size==xlarge
          - node.labels.purpose==rengine
      labels:
        - traefik.enable=true
        - traefik.docker.network=traefik
 
        - traefik.http.routers.rengine.rule=Host(`{{rengine_domain}}`) 
        - traefik.http.routers.rengine.tls=true 
        - traefik.http.routers.rengine.entrypoints=websecure 
        - traefik.http.services.rengine.loadbalancer.server.port=8082

  ollama:
    image: ollama/ollama
    volumes:
      - ollama_data:/root/.ollama
    networks:
      - rengine
    deploy:
      replicas: 1
      placement:
        constraints: 
          - node.role==worker
          - node.labels.arch==arm
          - node.labels.size==xlarge
          - node.labels.purpose==rengine


networks:
  traefik:
    external: true
  rengine:
    external: true

volumes:
  tool_config:
  gf_patterns:
  nuclei_templates:
  github_repos:
  wordlist:
  scan_results:
  static_volume:
  ollama_data:

And for the "web", "celery", and "celery-beat" containers, the image used "ghcr.io/deliver-up/rengine:2.2.0" is the same as the Dockerfile given by your repo, in ./web

  1. In the log section in the web GUI, I saw that the current command before the issue is:
    nuclei -j -irr -l /usr/src/scan_results/google-gruyere.appspot.com_100/urls_unfurled.txt -c 50 -retries 1 -rl 150 -timeout 5 -silent -t /root/nuclei-templates -severity medium

So I went in the celery container and I tried to run the last commande and i found more details about error:
nuclei_individual_severity_module | ERROR | 'template-url' Traceback (most recent call last): File "/usr/src/app/reNgine/celery_custom_task.py", line 130, in call self.result = self.run(*args, **kwargs) File "/usr/src/app/reNgine/tasks.py", line 2140, in nuclei_individual_severity_module vuln_data = parse_nuclei_result(line) File "/usr/src/app/reNgine/tasks.py", line 3670, in parse_nuclei_result 'template_url': line['template-url'], KeyError: 'template-url'

Environment

- reNgine: 2.2.0
- OS: Ubuntu 24.04.1 LTS
- Python: 3.12.3
- Docker Compose: v2.29.7
- Browser: Google Chrome

Anything else?

No response

@YSalai YSalai added the bug Something isn't working label Jan 15, 2025
Copy link
Contributor

Hey @YSalai! 👋 Thanks for flagging this bug! 🐛🔍

You're our superhero bug hunter! 🦸‍♂️🦸‍♀️ Before we suit up to squash this bug, could you please:

📚 Double-check our documentation: https://rengine.wiki
🕵️ Make sure it's not a known issue
📝 Provide all the juicy details about this sneaky bug

Once again - thanks for your vigilance! 🛠️🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant