You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A: Yes, the JSON output format (--format=json) works well for CI integration.
12
19
13
-
Q: How do I add custom rules?
14
-
A: Create a php-security-config.json file with your custom rules pattern.
15
-
16
-
Q: Why isn't it detecting vulnerability X?
20
+
Q: Why isn't it detecting vulnerability X? or how do I contribute new rules?
17
21
A: Check if the rule exists in our documentation. You can submit new rule requests via Issues section.
18
22
19
23
Q: How do I update the ruleset?
20
-
A: Update to the latest version via Composer:
24
+
A: Update to the latest version of package via Composer:
21
25
composer update yousha/php-security-linter
22
26
23
27
Q: Can I scan single files?
24
28
A: Yes, provide the file path instead of directory:
25
-
--path=src/file.php
29
+
--pathsrc/file.php
26
30
27
31
Q: How do I interpret the severity levels?
28
32
* Critical: Immediate security risk
29
33
* High: Significant vulnerability
30
34
* Medium: Security best practice violation
31
35
* Low: Informational notice
32
36
33
-
Q: Where can I see all available rules?
34
-
A: Run with --verbose flag or check the RULES.md documentation.
35
-
36
-
Q: How do I contribute new rules?
37
-
A: Fork the repository and submit a PR with your rule additions to the appropriate ruleset file.
38
-
39
-
Q: Why does it flag my vendor dependencies?
40
-
A: Either exclude the vendor directory (--exclude=vendor) or update vulnerable dependencies.
41
-
42
-
Q: Can I disable specific rules?
43
-
A: Yes, via configuration file by listing rule IDs to exclude.
44
-
45
-
Q: How can I create custom rule sets for my project's specific needs?
46
-
A: Extend the built-in rules by adding a php-security-custom-rules.json file in your project root with patterns like:
47
-
{
48
-
"CUSTOM-001": {
49
-
"pattern": "/\\bmy_unsafe_function\\s*\\(/i",
50
-
"message": "Custom unsafe function detected",
51
-
"severity": "high"
52
-
}
53
-
}
54
-
55
37
Q: Can I integrate this with PHPStan or Psalm for combined analysis?
56
38
A: Yes, chain it in your CI pipeline after static analysis tools. For direct integration, use the JSON output as input for custom rules in those tools.
57
39
58
40
Q: How do I handle false positives?
59
41
A: Three approaches:
60
42
* Exclude files via --exclude
61
-
* Disable specific rules in config:
62
-
{"disabledRules": ["OWASP-123", "CIS-456"]}
43
+
* Disable specific rules via --exclude-rules
63
44
64
45
Q: What's the performance impact for large codebases?
65
46
A: Benchmarks show:
66
47
~50ms per 1,000 lines of code
67
48
2-3x faster with OPcache enabled
68
-
Use --exclude=vendor,node_modules for best performance
69
49
70
50
Q: How can I export results to a security dashboard?
0 commit comments