Skip to content

Commit 12dc991

Browse files
authored
Ignore Python comments within two rules (#985)
Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
1 parent d40f9aa commit 12dc991

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

rules/exec/install_additional/pip_install.yara

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,12 @@ rule pip_installer_url: critical {
5757
strings:
5858
$ref = /pip.{1,5}install.{1,4}https{0,1}:\/\/.{0,64}/
5959
60+
$not_langchain_comment1 = "Please install the exllamav2 library with (cuda 12.1 is required)"
61+
$not_langchain_comment2 = "example : "
62+
$not_langchain_comment3 = "\"!python -m pip install https://github.com/turboderp/exllamav2/releases/download/v0.0.12/exllamav2-0.0.12+cu121-cp311-cp311-linux_x86_64.whl\""
63+
6064
condition:
61-
filesize < 8192 and $ref
65+
filesize < 8192 and $ref and none of ($not*)
6266
}
6367

6468
rule pip_installer_socket: critical {
@@ -69,8 +73,10 @@ rule pip_installer_socket: critical {
6973
strings:
7074
$ref = /pip.{1,5}install.{1,4}socket/
7175
76+
$not_langchain_comment1 = "\"Please install it with `pip install websocket-client`.\""
77+
7278
condition:
73-
$ref
79+
$ref and none of ($not*)
7480
}
7581

7682
rule pip_installer_requests: high {

0 commit comments

Comments
 (0)