-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #357 from Contrast-Security-OSS/NODE-3651-express5
NODE-3651: Add Express 5
- Loading branch information
Showing
205 changed files
with
25,831 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# @contrast/express4-test-bench | ||
An intentionally vulnerable `express` application. | ||
|
||
## Running Locally | ||
Make sure you have [Node.js](http://nodejs.org/) installed or install a version | ||
of Node from [nvm](https://github.com/creationix/nvm). | ||
|
||
```sh | ||
git clone https://github.com/Contrast-Security-OSS/NodeTestBenches.git # or clone your own fork | ||
cd NodeTestBenches/express | ||
npm install | ||
npm start | ||
``` | ||
|
||
Your app should now be running on [localhost:3000](http://localhost:3000/). | ||
|
||
## Running with Contrast | ||
|
||
### Installation | ||
See [our documentation](https://docs.contrastsecurity.com/installation-nodeinstall.html) | ||
for installation instructions. | ||
|
||
### Running the agent | ||
After installation, the agent can be run with `npm run contrast`. For more | ||
information on configuration and which technologies the agent supports, see our | ||
[documentation](https://docs.contrastsecurity.com/installation-node.html#node-config). | ||
|
||
## Adding a shared vulnerability | ||
Once you have added shared functionality to | ||
[`@contrast/test-bench-utils`](https://github.com/Contrast-Security-OSS/NodeTestBenches/tree/main/test-bench-utils), | ||
you are ready to add an endpoint in the test bench application. | ||
|
||
Create a _vulnerabilities/ruleName/index.js_ file and call the `controllerFactory` method: | ||
```js | ||
const controllerFactory = require('../../utils/controllerFactory'); | ||
module.exports = controllerFactory('ruleName'); | ||
``` | ||
|
||
Check the documentation for `controllerFactory` under _utils/controllerFactory.js_ | ||
usage information. | ||
|
||
Add a _vulnerabilities/ruleName/views/index.ejs_ file that includes the shared | ||
template from `@contrast/test-bench-utils`: | ||
```html | ||
<% include ../../../node_modules/@contrast/test-bench-utils/public/views/ruleName.ejs %> | ||
``` | ||
|
||
Now run the app and make sure everything works as expected! |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.