Giter Site home page Giter Site logo

securitybot's Issues

SQLEngine: Too many connections

I've followed the setup instructions in a fresh virtualenv and tried to run main.py
It connects to the Slack API successfully, creates securitybot, loads configuration, and starts the RTM session.
Then it issues a couple hundred warnings "Recovering from lost MySQL connection" and crashes. Here is a truncated traceback:

Traceback (most recent call last):
  File "main.py", line 45, in <module>
    main()
  File "main.py", line 41, in main
    sb = SecurityBot(chat, tasker, duo_builder, REPORTING_CHANNEL, 'config/bot.yaml')
  File "/securitybot/securitybot/bot.py", line 95, in __init__
    self.blacklist = SQLBlacklist()
  File "/securitybot/securitybot/blacklist/sql_blacklist.py", line 17, in __init__
    names = SQLEngine.execute('SELECT * FROM blacklist')
  File "/securitybot/securitybot/sql.py", line 79, in execute
    return SQLEngine.execute(query, params)

Those last two lines repeat a couple hundred times and then

  File "/securitybot/securitybot/sql.py", line 78, in execute
    SQLEngine._db)
  File "/securitybot/securitybot/sql.py", line 51, in _create_engine
    db=db)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/__init__.py", line 81, in Connect
    return Connection(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 193, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (1040, 'Too many connections')

While the user defined on line 93 of sql.py (why is this setting buried?) has full rights to the database, no tables are created.

Disable auth component

Just started using the tool as a POC but getting crashes of main.py due to no duo keys (do not have this service)

How and Can I turn off this component for now?

pypi securitybot

Super great project, thanks so much for releasing it open source. I was going to spin up one of my own but it's clear this project is WAY better than mine would have ever been. So related to that, I'm happy to give you the pypi 'securitybot' project (https://pypi.python.org/pypi/securitybot). Just email me at [email protected] and we'll setup the 'switch'. :)

Failing to run main because of SQLEngine

I would like to get some assistance with a small issue I am facing (not strong in python). I have tried using pip install SQLEngine and even went on to install SQLAlchemy but I can't seem to go past this stage when I run python main.py

Can you please help

โ””> python2.7 main.py Traceback (most recent call last): File "main.py", line 4, in <module> from securitybot.bot import SecurityBot File "/Users/pathXXXX/securitybot/securitybot/bot.py", line 9, in <module> from securitybot.user import User File "/Users/pathXXXX/securitybot/securitybot/user.py", line 11, in <module> import securitybot.ignored_alerts as ignored_alerts File "/Users/pathXXXX/securitybot/securitybot/ignored_alerts.py", line 6, in <module> from securitybot.sql import SQLEngine File "/Users/pathXXXX/securitybot/securitybot/sql.py", line 7, in <module> from typing import Any, Sequence ImportError: No module named typing

Crashed main.py by 'ignore' sent for non-existent user alerts

Hi, Have been able to crash the bot via "ignore last 1h1m" when no alert assigned for myself (user).

Traceback (most recent call last):
  File "main.py", line 45, in <module>
    main()
  File "main.py", line 42, in main
    sb.run()
  File "/home/ec2-user/securitybot/securitybot/bot.py", line 180, in run
    self.handle_messages()
  File "/home/ec2-user/securitybot/securitybot/bot.py", line 199, in handle_messages
    self.handle_command(user, text)
  File "/home/ec2-user/securitybot/securitybot/bot.py", line 211, in handle_command
    if cmd['fn'](self, user, args):
  File "/home/ec2-user/securitybot/securitybot/commands.py", line 69, in ignore
    if which == 'last' and user.old_tasks:
AttributeError: 'User' object has no attribute 'old_tasks'

Postgres Support

Would be nice for those more Postgres-friendly shops (like where I work). Definitely a nice-to-have.

getting pytz error

hello! i am a newbie. i was trying to implement security bot as my class assignment. I am getting the following error when i run main.py by following your guidelines

Traceback (most recent call last):
File "main.py", line 4, in
from securitybot.bot import SecurityBot
File "C:\securitybot-master\securitybot\bot.py", line 9, in
from securitybot.user import User
File "C:\securitybot-master\securitybot\user.py", line 9, in
import pytz
ModuleNotFoundError: No module named 'pytz'

can u please help me?

Exposed metrics?

First of all thanks for publishing this, it looks useful and I'd like to give it a try soon.

Is there currently any way of external monitoring, e.g. using Prometheus? It'd be useful for making sure that securitybot runs fine from an ops perspective, but also potentially for further processing of alerts, and metrics derived from alerts.

Slack User lookup from email?

Have alerts with actions assigned as email addresses currently, any way to do a lookup on the tool side to map email to slack users?

Could do a lookup in splunk but rather not have to maintain a CSV :)

Cheers,
AB

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.