Skip to main content

icon-developers.png Use CLI for serverless function scanning

Instead of using the Contrast web interface, you can use the CLI for scanning your serverless functions.

Before you begin

Steps

  1. Store your Contrast credentials locally with this command in a terminal window:

    contrast auth
    --api-key <ContrastAPIKey>
    --authorization <ContrastAuthorizationHeader>
    --host <YourHosDomain>
    --organization id <ContrastOrganizationID>

    Get the Contrast API key, the authorization header, and organization ID by logging into the Contrast web interface under user menu > User settings.

  2. Find vulnerabilities by using this command in a terminal window:

    contrast lambda --function-name <function> [options]
    • Use --json to return the response in a JSON format.

    • Use --verbose to return extended information to the terminal window.

    • CLI commands describe all the valid options for the lambda command.

Next steps