@@ -10,7 +10,6 @@ A PHP tool to lint PHP files for security issues based on CIS and OWASP best pra
1010* [ Features] ( #features )
1111* [ Requirements] ( #requirements )
1212* [ Installation] ( #installation )
13- * [ Configuration] ( #configuration )
1413* [ Usage] ( #usage )
1514* [ FAQ] ( #faq )
1615* [ Support] ( #support )
@@ -43,7 +42,7 @@ PHP Security Linter is a static analysis tool designed to identify security vuln
4342 * Custom rule sets
4443* ** Fast static analysis** without executing code
4544* ** Multiple output formats** (Console, JSON)
46- * ** Configurable ruleset** with severity levels
45+ * ** Configurable ruleset**
4746* ** DevSecOps ready** CI/CD pipeline integration
4847* ** Exclusion support** for ignoring specific paths
4948* ** Supported PHP:** 7.4, 8.3
@@ -95,36 +94,30 @@ Or Composer global installation:
9594composer global require yousha/php-security-linter
9695```
9796
98- ## Configuration
99-
100- Customize rules by creating a ` php-security-config.json ` :
101-
102- ``` json
103- {
104- "excludeRules" : [" CIS-001" , " OWASP-003" ],
105- "severityLevel" : " medium" ,
106- "customRules" : {
107- "CUSTOM-001" : {
108- "pattern" : " dangerous_function\\ s*\\ (" ,
109- "message" : " Custom dangerous function detected" ,
110- "severity" : " high"
111- }
112- }
113- }
114- ```
115-
11697## Usage
11798
99+ Lint current directory:
100+
101+ ``` shell
102+ php vendor/bin/php-security-linter --path .
103+ ```
104+
118105Lint a directory:
119106
120107``` shell
121108php vendor/bin/php-security-linter --path ./src
122109```
123110
124- Lint with exclusions :
111+ Lint with path exclusion :
125112
126113``` shell
127- php vendor/bin/php-security-linter --path ./app --exclude vendor,tests
114+ php vendor/bin/php-security-linter --path ./app --exclude storage,tests
115+ ```
116+
117+ Excluding a specific directory, path exclusion, and rule exclusion:
118+
119+ ``` bash
120+ php bin/php-sl.php --path ./src --exclude storage --exclude-rules CIS-003,OWASP-001
128121```
129122
130123JSON output:
@@ -139,6 +132,7 @@ php vendor/bin/php-security-linter --path ./public --format json
139132| ------------ | -------------------------------- |
140133| ` -p, --path ` | Path to scan (required) |
141134| ` --exclude ` | Comma-separated paths to exclude |
135+ | ` --exclude-rules ` | Comma-separated rule IDs to ignore |
142136| ` --help ` | Show help message |
143137
144138### Example console output
0 commit comments