Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This topic describes how to use the Serverless Framework. The Serverless Framework is a widely-used tool to develop, deploy, test, secure, and monitor your Serverless applications.

Using the Serverless Framework Integration

To use the integration, do as follows:

NOTE: For example purpose, this procedure provides instructions for running from This example uses Jenkins.1. Create

  1. Create a Unified Agent configuration file, with relevant flags to scan the function type you selected (npm, mvn, etc.) and relevant flags for a Serverless scan. Ensure that you do not include:

    • The serverless.includes flag

    • If your file is stored publicly, do not include your API token

...

  1. Install this plugin: npm install serverless-whitesource.

...

  1. In the .yml file of the scanned serverless function, add the plugin and the path to the configuration file as so:

...

  1. Code Block
     plugins:

...

  1. 
             serverless-whitesource

...

  1. 
            custom:

...

  1. 
               whitesource:

...

  1. 
                      pathToConfig: {path-to-configuration-file}  (NOTE: Mandatory parameter)

...

  1. 
                      pathToJar:      {path-to-jar}  (NOTE: Mandatory parameter)

...

  1. 
    
                 

...

  1.     # optional parameters, must start with 'wss-' prefix; any valid CLI parameter of the UA can be entered here. for example:

...

  1. 
                     wss-logLevel: { log level, for example, debug} (NOTE: Optional parameter)

...

  1. 
                     wss-apiKey: {enter API key} (NOTE: Optional parameter)
 

...

  1. Deploy the serverless function: serverless deploy.

...

  1.  The plugin will update the configuration file with the path to a .txt file containing the names of the functions found in the .yml file and will run the UA with this config file.