{"_id":"@dean.lendrum/spectral-owasp-ruleset","name":"@dean.lendrum/spectral-owasp-ruleset","dist-tags":{"latest":"0.0.0"},"versions":{"0.0.0":{"name":"@dean.lendrum/spectral-owasp-ruleset","version":"0.0.0","description":"Probably don't want to beg hackers to come and take your stuff.","main":"dist/ruleset.js","module":"dist/ruleset.mjs","type":"commonjs","exports":{".":{"types":"./dist/ruleset.d.ts","import":"./dist/ruleset.mjs","require":"./dist/ruleset.js"}},"directories":{"test":"test"},"scripts":{"build":"tsup","type-check":"tsc --noEmit --noErrorTruncation --pretty false --incremental false","test":"jest"},"repository":{"type":"git","url":"git+https://github.com/stoplightio/spectral-owasp-ruleset.git"},"keywords":["openapi","openapi3","openapi31","api-design"],"author":{"name":"Phil Sturgeon","email":"phil@stoplight.io"},"license":"MIT","bugs":{"url":"https://github.com/stoplightio/spectral-owasp-ruleset/issues"},"homepage":"https://github.com/stoplightio/spectral-owasp-ruleset#readme","dependencies":{"@stoplight/spectral-formats":"^1.4.0","@stoplight/spectral-functions":"^1.7.2"},"devDependencies":{"@sindresorhus/tsconfig":"^3.0.1","@stoplight/spectral-owasp-ruleset":"^1.4.0","@stoplight/types":"^13.8.0","@types/jest":"^28.1.8","jest":"^28.1.3","ts-jest":"^28.0","tsup":"^6.5.0"},"tsup":{"entry":["src/ruleset.ts"],"clean":true,"dts":true,"format":["cjs","esm"],"sourcemap":true,"noExternal":["@stoplight/types"],"external":["@stoplight/spectral-core"],"footer":{"js":"module.exports = module.exports.default;"}},"gitHead":"18c4d6d48a8a3ae88705b4995c0e4bdf43c2dc04","_id":"@dean.lendrum/spectral-owasp-ruleset@0.0.0","_nodeVersion":"19.4.0","_npmVersion":"9.2.0","dist":{"integrity":"sha512-c8+dAJNEb1aZVHZCuWFE9QbYZwxUnMzpqgsFw+Y1BlW338mX5I5wvBeEj9JMGovHUyPOrprESrzi/woQ3XhD7Q==","shasum":"94205ec97998b3e22d9e4caf5c68a8c10a139575","tarball":"https://registry.npmjs.org/@dean.lendrum/spectral-owasp-ruleset/-/spectral-owasp-ruleset-0.0.0.tgz","fileCount":31,"unpackedSize":89220,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEkscLclQRc5/6IMa7Ukb9AIQ2gx+HR5ri/QQMsiAGitAiEA+vi4XZYGZAm+dDAUqglo1tPuNc6heNGmhN4sm0EfKzc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjySXoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqYYA/+OHOpeIinv+Qv2bKQojPKpRpS9zqlR942XAEAN6PttRLWbWkZ\r\n7U8kdHpxWdNg8RqgSy3f9bFEWjnXJqyH3oIfAZ5XWXq/5UVmNsRzOIc7d8ZE\r\n9MKGrKkUjI8HYYKi0vZPl4moSkYbOJD/PFw1o2DpYsT3Rn7TWiOYXCoWcFLj\r\nMeo1YSuP7gLJI+k2ckKQojHTIWEI9f/mXgrLe3z3JiVtWemfvX4hAIIbK6wR\r\nuD1E4kCekUSnuXPoeH18O9khe/s6f6R6pV5snzNabq6PuI1R/LhCTCKX/kkr\r\nMMsM5CK3MyDgrguu6hQFYeEQJE1lleAyLCGQy5dm2bM0Q9H1CbNuBELSVeEB\r\ntMxn1od/ITjz5J/87PJBO2/DTNNb1DYaklj3PnZyHgFVGfvUa5WjJQFyOcoE\r\nCKrDWqdij6VwZZEjefKppnLt6YTsJQNijGu4v/FtaYOusQUrmVYezBHUiU0q\r\n3Wb8M/pVljNgwII0QvC/KQmnhcjwSo+oU6RjaZcSK1wvJ/vt4FbTVbW3Ybqs\r\nLKooMgd3czdEP/LoEjOnFjJmkeQ9QhjIR4HFrHKpRHBD/ts1ADIPNbyPvEoa\r\nQf6DGd4hpsZXE8yTsXuuwO1IgM5JOASIGD3q+qimxSj/IP1qmCcLcCZpLZRO\r\ntA89MTRjDLKBMxqdVYAbO7QGA3nDnuj1ia4=\r\n=aodk\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"dean.lendrum","email":"dean.lendrum@cequence.ai"},"maintainers":[{"name":"dean.lendrum","email":"dean.lendrum@cequence.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/spectral-owasp-ruleset_0.0.0_1674126824592_0.202520299475083"},"_hasShrinkwrap":false}},"time":{"created":"2023-01-19T11:13:44.543Z","0.0.0":"2023-01-19T11:13:44.822Z","modified":"2023-01-19T11:13:44.946Z"},"maintainers":[{"name":"dean.lendrum","email":"dean.lendrum@cequence.ai"}],"description":"Probably don't want to beg hackers to come and take your stuff.","homepage":"https://github.com/stoplightio/spectral-owasp-ruleset#readme","keywords":["openapi","openapi3","openapi31","api-design"],"repository":{"type":"git","url":"git+https://github.com/stoplightio/spectral-owasp-ruleset.git"},"author":{"name":"Phil Sturgeon","email":"phil@stoplight.io"},"bugs":{"url":"https://github.com/stoplightio/spectral-owasp-ruleset/issues"},"license":"MIT","readme":"# Spectral OWASP API Security\n\n[![NPM Downloads](https://img.shields.io/npm/dw/@stoplight/spectral-owasp-ruleset?color=blue)](https://www.npmjs.com/package/@stoplight/spectral-owasp-ruleset) [![Stoplight Forest](https://img.shields.io/ecologi/trees/stoplightinc)][stoplight_forest]\n\nScan an [OpenAPI](https://spec.openapis.org/oas/v3.1.0) document to detect security issues. As OpenAPI is only describing the surface level of the API it cannot see what is happening in your code, but it can spot obvious issues and outdated standards being used.\n\n## Installation\n\n```bash\nnpm install --save -D @stoplight/spectral-owasp-ruleset\nnpm install --save -D @stoplight/spectral-cli\n```\n\n## Usage\n\nCreate a local ruleset that extends the ruleset. In its most basic form this just tells Spectral what ruleset you want to use, but it will allow you to customise things, add your own rules, turn bits off if its causing trouble.\n\n```\ncd ~/src/<your-api>\n\necho 'extends: [\"@stoplight/spectral-owasp-ruleset\"]' > .spectral.yaml\n```\n\n_If you're using VS Code or Stoplight Studio then the NPM modules will not be available. Instead you can use the CDN hosted version:_\n\n```\necho 'extends: [\"https://unpkg.com/@stoplight/spectral-owasp-ruleset@1.1.1/dist/ruleset.js\"]' > .spectral.yaml\n```\n\n_**Note:** You need to use the full URL with CDN hosted rulesets because Spectral [cannot follow redirects through extends](https://github.com/stoplightio/spectral/issues/2266)._\n\nNext, use Spectral CLI to lint against your OpenAPI description. Don't have any OpenAPI? [Record some HTTP traffic to make OpenAPI](https://apisyouwonthate.com/blog/creating-openapi-from-http-traffic) and then you can switch to API Design-First going forwards.\n\n```\nspectral lint api/openapi.yaml\n```\n\nYou should see some output like this:\n\n```\n/Users/phil/src/protect-earth-api/api/openapi.yaml\n  44:17      warning  owasp:api3:2019-define-error-responses-400:400 response should be defined.. Missing responses[400]  paths./upload.post.responses\n  44:17      warning  owasp:api3:2019-define-error-responses-429:429 response should be defined.. Missing responses[429]  paths./upload.post.responses\n  44:17      warning  owasp:api3:2019-define-error-responses-500:500 response should be defined.. Missing responses[500]  paths./upload.post.responses\n  45:15        error  owasp:api4:2019-rate-limit                  All 2XX and 4XX responses should define rate limiting headers.  paths./upload.post.responses[201]\n  47:15        error  owasp:api4:2019-rate-limit                  All 2XX and 4XX responses should define rate limiting headers.  paths./upload.post.responses[401]\n  53:15        error  owasp:api4:2019-rate-limit                  All 2XX and 4XX responses should define rate limiting headers.  paths./upload.post.responses[403]\n  59:15        error  owasp:api4:2019-rate-limit                  All 2XX and 4XX responses should define rate limiting headers.  paths./upload.post.responses[409]\n  65:15        error  owasp:api4:2019-rate-limit                  All 2XX and 4XX responses should define rate limiting headers.  paths./upload.post.responses[422]\n 193:16  information  owasp:api2:2019-protection-global-safe      This operation is not protected by any security scheme.  paths./sites.get.security\n 210:16  information  owasp:api2:2019-protection-global-safe      This operation is not protected by any security scheme.  paths./species.get.security\n```\n\nNow you have some things to work on for your API. Thankfully these are only at the `warning` and `information` severity, and that is not going to [fail continuous integration](https://meta.stoplight.io/docs/spectral/ZG9jOjExNTMyOTAx-continuous-integration) (unless [you want them to](https://meta.stoplight.io/docs/spectral/ZG9jOjI1MTg1-spectral-cli#error-results)).\n\nThere are [a bunch of other rulesets](https://github.com/stoplightio/spectral-rulesets) you can use, or use for inspiration for your own rulesets and API Style Guides.\n\n## 🎉 Thanks\n\n- [Andrzej](https://github.com/jerzyn) - Great rules contributed to the Adidas style guide.\n- [Roberto Polli](https://github.com/ioggstream) - Created lots of excellent Spectral rules for [API OAS Checker](https://github.com/italia/api-oas-checker/) which aligned with the OWASP API rules.\n\n## 📜 License\n\nThis repository is licensed under the MIT license.\n\n## 🌲 Sponsor\n\nIf you would like to thank us for creating Spectral, we ask that you [**buy the world a tree**][stoplight_forest].\n\n[stoplight_forest]: https://ecologi.com/stoplightinc\n","readmeFilename":"README.md"}