feat(csharp): add C# ChaCha20Poly1305 detection rules - #506
Conversation
Signed-off-by: Kaldesyvon <martinnovysedlak99@gmail.com>
Signed-off-by: Kaldesyvon <martinnovysedlak99@gmail.com>
e38a1a9 to
0d2d19b
Compare
|
Hi Martin, That looks good structure wise but we need to refine the detection rule a bit according to the comments above. Best regards, |
Signed-off-by: Kaldesyvon <martinnovysedlak99@gmail.com>
Signed-off-by: Kaldesyvon <martinnovysedlak99@gmail.com>
|
Hi Martin, that looks way better now, very good job! Also the unit test is comprehensive and covers properly. Best regards, |
Signed-off-by: Kaldesyvon <martinnovysedlak99@gmail.com>
|
Hi @Kaldesyvon , hi @fynnth, I just learned that C# has the same concept of named parameters like python. Named parameters in a function call can occur in arbitrary order. Some of them are optional which makes the number of variants a valid function call can have even higher. Writing detection rules for pycryptodome was thus very difficult because you need a lot of rules to cover the most common call variants. To this end, I suggested to add another call to the detection rule interface .withNamedMethodParameter(String name, String, boolean optional);
For your reference, there is currently one detection rule in python/…/detection/pycrypto/hash/PycryptoCryptoHash.java for |
|
Hi @san-zrl, Thats true, I have not thought of that. But for csharp the issue is even worse because the parameter name was not in the parser interface that I have implemented, so i have to rework that too before anything like that works. (info is just not there for parameter names) My plan would be to finish detection rules like it is now and then afterwards start reworking the engine and implementing named parameters, then update the rules and also extend parameter detection in general (for example trying to detect certain key sizes that were instantiated in a variable before the method call) |
|
@fynnth - Sure. For the moment the new feature is python specific. We have to see where else it would make sense. |
Signed-off-by: Kaldesyvon <martinnovysedlak99@gmail.com>
Signed-off-by: Kaldesyvon <martinnovysedlak99@gmail.com>
|
Hi @Kaldesyvon, @fynnth - What's the state of this? Are you still working on it? |
|
Hi @san-zrl, I was on PTO and today I started resolving comments. I will notify you for another review |
Signed-off-by: Kaldesyvon <martinnovysedlak99@gmail.com>
Signed-off-by: Kaldesyvon <martinnovysedlak99@gmail.com>
san-zrl
left a comment
There was a problem hiding this comment.
Hi @Kaldesyvon - Thank you very much for the detection rule and the comprehensive tests. This looks good to me. @fynnth, what do you think?
|
Hi @Kaldesyvon @san-zrl , Thumbs up from my side, i just merged my detection rules and there is small conflict here which i will resolve and then we can merge it :) |
Signed-off-by: fynnth <42970655+fynnth@users.noreply.github.com>
Hello team,
After restoring C# I am adding new detection rules for ChaCha20Poly1305 algorithm.
This is my first PR in this project so I would appreciate any comments or help.
Thank you for reviewing.
Best,
Martin