Skip to content

Commit e364445

Browse files
authored
Hide noisy error logs; final rule tweaks (#977)
* Hide noisy error logs; final rule tweaks Signed-off-by: egibs <20933572+egibs@users.noreply.github.com> * Run make yara-x-fmt Signed-off-by: egibs <20933572+egibs@users.noreply.github.com> * Final tweak Signed-off-by: egibs <20933572+egibs@users.noreply.github.com> --------- Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
1 parent 17f889c commit e364445

File tree

3 files changed

+23
-8
lines changed

3 files changed

+23
-8
lines changed

pkg/action/path.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func findFilesRecursively(ctx context.Context, rootPath string) ([]string, error
4040
err = filepath.WalkDir(root,
4141
func(path string, info os.DirEntry, err error) error {
4242
if err != nil {
43-
logger.Errorf("error: %s: %s", path, err)
43+
logger.Debugf("error: %s: %s", path, err)
4444
return nil
4545
}
4646
if info.IsDir() || strings.Contains(path, "/.git/") {
@@ -52,12 +52,12 @@ func findFilesRecursively(ctx context.Context, rootPath string) ([]string, error
5252
logger.Debugf("attempting to resolve symlink: %s", path)
5353
eval, err := filepath.EvalSymlinks(path)
5454
if err != nil {
55-
logger.Errorf("eval: %s: %s", path, err)
55+
logger.Debugf("eval: %s: %s", path, err)
5656
return nil
5757
}
5858
fi, err := os.Stat(eval)
5959
if err != nil {
60-
logger.Errorf("stat: %s: %s", path, err)
60+
logger.Debugf("stat: %s: %s", path, err)
6161
return nil
6262
}
6363
if fi.IsDir() {
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
rule vimeo_psalm_md_php_override: override {
2+
meta:
3+
description = "Psalm MD files with PHP code excerpts"
4+
SIGNATURE_BASE_WEBSHELL_PHP_Dynamic = "harmless"
5+
6+
strings:
7+
$ = "Emitted when calling a function on a non-callable variable"
8+
$ = "Emitted when calling a function on a value whose type Psalm cannot infer."
9+
$ = "Emitted when trying to use `null` as a `callable`"
10+
$ = "Emitted when trying to call a function on a value that may not be callable"
11+
$ = "Emitted when trying to call a function on a value that may be null"
12+
13+
condition:
14+
any of them
15+
}

rules/false_positives/sqlmap.yara

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ rule sqlmap_override: override {
55
SIGNATURE_BASE_Hacktool_Strings_P0Wnedshell = "high"
66

77
strings:
8-
$sqlmap1 = "Copyright (c) 2006-2025 sqlmap developers (https://sqlmap.org/)"
9-
$sqlmap2 = "Visit 'https://github.com/sqlmapproject/sqlmap/#installation' for further details"
10-
$sqlmap3 = /SqlmapBaseException|SqlmapDataException|SqlmapFilePathException|SqlmapShellQuitException|SqlmapSilentQuitException|SqlmapUserQuitException/
11-
$sqlmap4 = "if \"sqlmap.sqlmap\" in sys.modules"
8+
$c_sqlmap1 = "Copyright (c) 2006-2025 sqlmap developers (https://sqlmap.org/)"
9+
$c_sqlmap2 = "Visit 'https://github.com/sqlmapproject/sqlmap/#installation' for further details"
10+
$f_sqlmap3 = /SqlmapBaseException|SqlmapDataException|SqlmapFilePathException|SqlmapShellQuitException|SqlmapSilentQuitException|SqlmapUserQuitException/
11+
$f_sqlmap4 = "if \"sqlmap.sqlmap\" in sys.modules"
1212
1313
condition:
14-
all of them
14+
any of ($c*) and any of ($f*)
1515
}

0 commit comments

Comments
 (0)