-
Notifications
You must be signed in to change notification settings - Fork 297
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
Clearly define all parameters used in a bot #757
Comments
I'm not entirely sure what this would mean for the |
defaults and runtime hold the same parameters. runtime overrides defaults. |
@sykaeh as we discuss, if you have chance, present us an example (proposal) to possible fix the issue that you raise. Indeed, is not an easy task but as I mentioned to you, the main principle is to provide to new users and new developers a quick way to start without need to learn about python. |
I have pushed an initial, partial possible implementation to sykaeh/intelmq (replace-bot branch). Here I briefly describe the main changes: 1. Param (in
|
@dmth yeahhh! :D really awesome! I think there is a need for review before advertise in ML. @dmth If you have some time, check the code and let us know your technical feedback. Will be important to also have the feedback from @sebix and @aaronkaplan. ....After that, @sykaeh ML is yours! 🥇 |
Without having looked into the code yet: |
Before going into detail two general questions:
|
|
First: Thanks for your work! We had this in mind for some time now but yet noone hat time for it. Your proposal is very clean and sophisticated and was a lot of work!
We are doing it for the message class(es) too.
Those aren't real types (at least currently). Python types are fine I think (str, int, float, list, enum etc). I can work on this next week a show my proposal (based on yours). |
Concerning the types of parameters: I think we can reuse the typing module too, this would provide proper definitions for Mappings and Sequences. |
This would allow adding help/manpages to all bots. E.g. |
An important use case as I see it is: When looking at some of the MISP bots, I've again noticed that the location of documentation about a bot is a problem. So, to add to the importance of the issue, I'll document this as an example:
The problem here that there are two places for the information and it is a bit of random which is remembered by developers if they make a small change in the code. In this case the docstring was not updated, while Bots.md was. (After noticing this, I've proposed a fix as part of #1486 ) |
Recently I have been creating, modifying and using a lot of bots to fit our setup. And one of the things that has been bothering me is how inconsistently the bot's parameters are defined/documented. Most of the parameters for a BOT are listed in the BOTS file, however I have noticed that the list of parameters is not always complete (especially for parameters that are processed elsewhere like
code
oraccuracy
in collector bots). Also see #668, for a related discussion about the BOTS file.Additionally, there is no way to explain what the parameter is, whether it is required or optional and what type the parameter is (needed for certtools/intelmq-manager#81). So ideally, you should be able to specify the following items for each parameter:
Other requirements:
name
,code
,accuracy
,provider
), collector parameters (rate_limit
), HTTP request parameters (http_username
,http_password
,http_proxy
), logging defaults, etc.)As far as I can tell, the BOTS file is only used by the intelmq-manager (and possibly as a reference guide of what to put in
runtime.conf
if you do not use the intelmq-manager).My current suggestion is to put all of this information in a python file (either directly in the bot, in
__init__.py
or in a separate file in the bots module). This allows easy implementation of inheritance and I personally find it just as easy to write Python code as JSON files). The intelmq-manager would then read the information through the intemqctl (or a something similar) thus allowing to get a list of all of the currently installed bots and their configuration settings without having to list all of them in a single file.The text was updated successfully, but these errors were encountered: