Gathering detailed insights and metrics for eslint-plugin-security-rules
Gathering detailed insights and metrics for eslint-plugin-security-rules
Gathering detailed insights and metrics for eslint-plugin-security-rules
Gathering detailed insights and metrics for eslint-plugin-security-rules
npm install eslint-plugin-security-rules
61.2
Supply Chain
93.5
Quality
74
Maintenance
50
Vulnerability
96.4
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
7 Stars
471 Commits
3 Watching
1 Branches
2 Contributors
Updated on 28 Jul 2023
Minified
Minified + Gzipped
TypeScript (99.96%)
Shell (0.04%)
Cumulative downloads
Total Downloads
Last day
-54%
529
Compared to previous day
Last week
-39.1%
3,691
Compared to previous week
Last month
4.1%
27,174
Compared to previous month
Last year
16,228.9%
226,318
Compared to previous year
8
1
24
ESLint security rules to help harden your project as early as possible.
NB: This project was written as an artefact for a master's thesis at the IT University of Copenhagen and it should still be considered a work in progress.
>=14
>=8
1yarn add --dev eslint-plugin-security-rules
To include the recommended eslint-plugin-security-rules
to your ruleset add the following to your .eslintrc
configuration:
1{ 2 "extends": [ 3 "plugin:security-rules/recommended" 4 ], 5 // Please include the environments that you use when using this plugin. Doing 6 // so will enhance the tracing algorithm greatly. 7 "env": { 8 "node": true, 9 "browser": true, 10 "es6": true 11 }, 12 "overrides": [ 13 { 14 "files": ["*.ts", "*.tsx"], 15 "extends": ["plugin:@typescript-eslint/recommended"], 16 // If you would like to improve the accuracy of the tracing algorithm 17 // when using typescript, then please include the "project" configuration 18 // for the @typescript-eslint/parser. 19 // See more at 20 // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/parser#parseroptionsproject 21 "parserOptions": { 22 "project": ["./tsconfig.json"] 23 } 24 }, 25 ] 26}
eslint-plugin-security-rules
comes with several rulesets, scoped to the environment that they target, allowing you to only enable rules relevant to your project.
'plugin:security-rules/recommended'
: recommended security rules, including all available rules that you can drop in without any additional configuration.'plugin:security-rules/node'
: rules related to vulnerabilities occuring in code that is intended to be executed in a NodeJS environment.'plugin:security-rules/browser'
: rules related to vulnerabilities occuring in code that is intended to be executed in a browser.'plugin:security-rules/universal'
: rules related to vulnerabilities that may occur regardless of which environment the code is being run.'plugin:security-rules/package'
: rules related to ensure safe usage of dependencies by scanning package.json
-files.'plugin:security-rules/react'
: security related rules targeting code using the react
package.'plugin:security-rules/pg'
: security related rules targeting code using the pg
(postgres) package.'plugin:security-rules/mysql'
: security related rules targeting code using the mysql
package.Key:
Name | Description | ✅ | 🔧 | 💭 | 🌩 |
---|---|---|---|---|---|
security-rules/browser/no-xss | Detects DOM-based XSS vulnerabilities in browser sinks | ✅ | 🔧 | 💭 |
Name | Description | ✅ | 🔧 | 💭 | 🌩 |
---|---|---|---|---|---|
security-rules/node/no-unsafe-path | Avoids usage of unsafe paths when interacting with the file-system using "fs" | ✅ | 🔧 | 💭 | |
security-rules/node/no-insecure-ciphers | Detects unsafe ciphers algorithms that should not be used | ✅ | 🔧 | 💭 |
Name | Description | ✅ | 🔧 | 💭 | 🌩 |
---|---|---|---|---|---|
security-rules/universal/no-hardcoded-credentials | Detects hardcoded secrets in a file | ||||
security-rules/universal/no-vulnerable-dependencies | Determines if import statements exist in a vulnerable version | ✅ |
Name | Description | ✅ | 🔧 | 💭 | 🌩 |
---|---|---|---|---|---|
security-rules/package/no-vulnerable-dependencies | Determines if any of the projects installed dependencies exist in a vulnerable version | ✅ | 🔧 |
The following ruleset are related to specific popular packages, scanning for vulnerable usages in these.
Name | Description | ✅ | 🔧 | 💭 | 🌩 |
---|---|---|---|---|---|
security-rules/react/no-xss | Detects DOM-based XSS vulnerabilities introduced in JSX | ✅ | 🔧 | 💭 |
Name | Description | ✅ | 🔧 | 💭 | 🌩 |
---|---|---|---|---|---|
security-rules/pg/no-sql-injections | Detects queries vulnerable to SQL Injections | ✅ | 🔧 | 💭 | |
security-rules/pg/no-hardcoded-credentials | Detects hardcoded secrets in a file | ✅ | 💭 |
Name | Description | ✅ | 🔧 | 💭 | 🌩 |
---|---|---|---|---|---|
security-rules/mysql/no-sql-injections | Detects queries vulnerable to SQL Injections | ✅ | 🔧 | 💭 | |
security-rules/mysql/no-hardcoded-credentials | Detects hardcoded secrets in a file | ✅ | 💭 |
No vulnerabilities found.
No security vulnerabilities found.