Skip to content
This repository was archived by the owner on Mar 20, 2020. It is now read-only.

Conversation

@ao10
Copy link
Contributor

@ao10 ao10 commented Feb 28, 2020

This PR adds:

  • A new route for the CMDi DangerousPaths sub-rule

Pretty much followed suit with what @pmcclory-contrast did here (#13) for the ChainedCommand rule

You can test this by:

  1. npm link here and in your test-bench-content local directory.
  2. npm link @contast/test-bench-utils @contrast-test-bench-content in a sample app directory.
  3. Navigate to route and observe the rule get reported/blocked in BLOCK/MONITOR modes in TS UI.

Example:
Screen Shot 2020-02-28 at 2 14 34 PM

if (noop) return 'NOOP';

return new Promise((resolve) => {
cp.exec("/bin/sh -c 'cat /tmp/foo.txt /etc/passwd'", (err, data) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't take any data from request which is ok but what do we do in darpa-testing-config to test these?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point. Would it be better to just take in data from the request so that we could have darpa-testing-config sending different commands that'll trigger this rule?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's fine just curious

@bizob2828
Copy link
Contributor

These rule names seem verbose and make the nav look like shit but this works as spec'd

@ao10 ao10 merged commit addde8b into master Mar 2, 2020
@tough-griff tough-griff deleted the NODE-636-dangerous-paths-sink branch March 10, 2020 19:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants