mushorg / conpot

ICS/SCADA honeypot
GNU General Public License v2.0
1.21k stars 410 forks source link

Clean up outdated code, dependencies, documentation, etc. #532

Closed srenfo closed 3 years ago

srenfo commented 3 years ago

Cleans up a bunch of unused code, outdated dependencies, orphaned documentation and obsolete configuration.

The PR is structured such that individual changes can be undone with revert commits.

However, this is not comprehensive. You can find more stuff to remove if you want to. For example, there are more orphaned documentation files and there are old scripts in bin/ where I'm not sure if they're still functional or needed.

I tried to keep the individual commit messages concise and meaningful for easier navigation.

coveralls commented 3 years ago

Pull Request Test Coverage Report for Build 1281


Files with Coverage Reduction New Missed Lines %
conpot/protocols/http/command_responder.py 1 61.03%
conpot/protocols/kamstrup/meter_protocol/kamstrup_server.py 1 80.56%
conpot/protocols/IEC104/frames.py 2 75.0%
conpot/protocols/IEC104/IEC104_server.py 2 86.02%
conpot/protocols/ftp/ftp_base_handler.py 14 79.69%
conpot/protocols/ftp/ftp_handler.py 22 81.37%
<!-- Total: 42 -->
Totals Coverage Status
Change from base Build 1280: -0.03%
Covered Lines: 5518
Relevant Lines: 7498

💛 - Coveralls
glaslos commented 3 years ago

Are you doing a scream test on the mysql logger?

srenfo commented 3 years ago

Are you doing a scream test on the mysql logger?

Hah, walked right into that one. :facepalm:

In all seriousness though, the MySQL logger has been broken and disabled for two and a half years, ever since the switch from Python 3 apparently. The tests are never run and carry this message:

https://github.com/mushorg/conpot/blob/68702a484aea70d91ee4da5e6d6a45056e4fccca/conpot/tests/test_logger_mysql.py#L23-L24

Only the "wiring" was never removed so the dependencies still needed to be installed.

Since it was commented out code it got swept up in this cleanup.

If you prefer to keep it in I'll push a revert commit for https://github.com/mushorg/conpot/pull/532/commits/07b13a8b60389298fe8ab3e349b6d592d3f7ad14.

EDIT: I fail at math.

glaslos commented 3 years ago

Don't get me wrong, I'm all in favor of removing the MySQL logger :)

glaslos commented 3 years ago

Nice work @srenfo , your contributions to Conpot are much appreciated.