Giter VIP home page Giter VIP logo

cert-polska / karton-dashboard Goto Github PK

View Code? Open in Web Editor NEW
6.0 7.0 5.0 1.26 MB

A small Flask application that allows for Karton task and queue introspection.

Home Page: https://github.com/CERT-Polska/karton

License: BSD 3-Clause "New" or "Revised" License

Dockerfile 0.62% Python 39.87% HTML 46.31% JavaScript 12.18% CSS 1.01%
karton malware-analysis malware-research pipeline cybersecurity cert csirt

karton-dashboard's People

Contributors

alex-ilgayev avatar antelox avatar bonusplay avatar chivay avatar dotlambda avatar kazet avatar msm-cert avatar msm-code avatar nazywam avatar psrok1 avatar tjni avatar yankovs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

karton-dashboard's Issues

Fix or remove /api/queue/<queue_name> endpoint

ERROR:karton.dashboard.app:Exception on /api/queue/karton.archive-extractor [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python3.7/site-packages/karton/dashboard/app.py", line 239, in get_queue_api
    return jsonify(QueueView(queue).to_dict())
  File "/usr/local/lib/python3.7/site-packages/karton/dashboard/app.py", line 101, in to_dict
    "crashed": sorted(crashed, key=lambda t: t.last_update, reverse=True),
  File "/usr/local/lib/python3.7/site-packages/karton/dashboard/app.py", line 101, in <lambda>
    "crashed": sorted(crashed, key=lambda t: t.last_update, reverse=True),
AttributeError: 'str' object has no attribute 'last_update'

see also #26

Consumer: ram & swap overeating when prometheus tries to collect data from karton-system with 20k+ tasks in run

Hello,

I met a problem with karton-dashboard when I try to collect /vars using prometheus every 5 secs with more than 10k tasks.

Karton-dashboard exceeds 5s limit (context deadline exceeded prometheus error) and tries to collect data again - and karton-dashboard prepares two reports at the same time, using two cpu cores, but the second request exceeds 5s limit too, the third request will be born - and it looks like deadlock of requests.

CPU exhaust ia a bad news, but it is bearable. Every such request consumes a lot of ram, so soon the server will have no ram, this way I have no possibility even to kill karton-dashboard)


This issue wrote just for acknolegement about the situation with a lot of tasks - I think it is a architecure issue and probably it is fixable if we will use less resouce-consuming stats obtaining.

Telegram notifications on status change

Ability to set telegram bot token and choose the situations of notification:

  • Service changed count of workers
  • Service has no workers
  • Service workers 0 -> 1
  • Chosen service or any of them generated Crashed task

Add an option to remove an item from the crashed queue

Currently, the crash queue shows a RED number of crashes in the dashboard. Sometimes there are crashes that are fixed or known, and the user wants to resolve it, but they have to live with this scary red number for a couple of days until the crahsed task would be removed from the queue.

I suggest adding an X button that will remove individual tasks. I also suggest adding a button to clean the crashed queue (see #30, it's similar)

grafana dashboard

Hi all,
I run the karton dashboard with docker .
I would like to add metric to grafana and I'm not sure how to config the data source in Grafana.
I see the logs under /varz.

what is the URL and port that I should fill when I config the data source in grafana?
thanks

mworks is broken

Due to how mworks operates, /docz endpoint (available as button on navbar) is broken, as no README.md is available in docker container.
Same goes for nested routes (/docs/doc/*) as they expect markdown files in /docs directory.
There is also path traversal in /docs/doc endpoint (it requires file to end with .md though).

Fix or remove the /api/queues endpoint

Looks like this endpoint doesn't work anymore:

ERROR:karton.dashboard.app:Exception on /api/queues [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python3.7/site-packages/karton/dashboard/app.py", line 196, in get_queues_api
    for identity, queue in state.queues.items()
  File "/usr/local/lib/python3.7/site-packages/karton/dashboard/app.py", line 196, in <dictcomp>
    for identity, queue in state.queues.items()
  File "/usr/local/lib/python3.7/site-packages/karton/dashboard/app.py", line 100, in to_dict
    "tasks": sorted(tasks, key=lambda t: t.last_update, reverse=True),
  File "/usr/local/lib/python3.7/site-packages/karton/dashboard/app.py", line 100, in <lambda>
    "tasks": sorted(tasks, key=lambda t: t.last_update, reverse=True),
AttributeError: 'str' object has no attribute 'last_update'

It went undetected pretty long, so I assume it's not used by anyone. We can probably safely remove it instead of fixing it (but I have no hard stance on this).

I wish we could e2e test this, but this looks like a pain to setup test environment for.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.