Skip to content
This repository has been archived by the owner on Jun 15, 2020. It is now read-only.

Latest commit

 

History

History
22 lines (12 loc) · 1.64 KB

NodeOverview.md

File metadata and controls

22 lines (12 loc) · 1.64 KB

The Contrast Node.js agent analyzes the behavior of Node.js web applications using established techniques, such as source-to-source compilation, to add Contrast sensors to an application prior to execution. Just as tools such as Istanbul and CoffeeScript use this technique to weave new features into JavaScript, Contrast uses it to help you keep your applications secure.

About the Agent

There are two primary source code transformations that the Contrast Node agent employs to monitor the behavior of your application:

Function hooks take over the execution of a given function like, child_process.exec, to collect data about its arguments and its return value, and send this data to the parts of the agent responsible for analysis. As a result, the agent enables certain functions to be self reporting.

AST transformation is the process by which the agent creates an abstract syntax tree of a body of code, manipulates the tree and then creates new source code based on this syntax tree. The agent goes through this process to handle scenarios in which function hooks won't work. For example, rewrites allow Contrast to add operator overloading to JavaScript so that it can properly track the flow of untrusted data.

Use the Agent

To start analyzing an application, download the Node.js agent and create a configuration file. The process is outlined in the Node Agent Installation article.