Skip to content

Scanning with the CodeLogic SQL Agent (Docker)

The CodeLogic SQL Agent for Docker provides an easy way to integrate CodeLogic scanning into your build process.

  1. Generate the Docker Image
  2. Run the Docker Image
  3. View Scan Results

Generate the Docker Image

  • Click Admin and then select the Installers tab.

    CodeLogic Admin Installers Page

  • Locate the SQL Agent Docker Image tile and click Generate.

  • Enter your CodeLogic Server IP address or hostname.
  • Enter the directory path to be scanned in the field provided.
  • Click Next.
  • Copy your code snippet from the Success! window.

    Docker Options Examples

    • --pull always - ensures that you will always get the newest image
    • --env CODELOGIC_HOST="https://codelogic.com" - passes an environment variable representing the IP address or hostname of the CodeLogic Server
    • --env AGENT_UUID="1f5d0bbc-0924-4c6f-828c-532627c33178" - passes an environment variable for the agent UUID
    • --env AGENT_PASSWORD="AahlDFNbb0PyU378" - passes an environment variable for the agent password
    • --env SCAN_PATH="/scan" - passes an environment variable for the agent to use when scanning
    • codelogic.com/codelogic_sql:latest - tells docker to download the sql agent codelogic_sql:latest from the CodeLogic Server
    • See Docker Documentation for more docker options.
  • Run the Docker Image

Tip

You can copy and paste the code snippet directly into your Jenkins file.

  • Analyze a relational database
    analyze -a yourApp -c jdbc:postgresql://localhost:5432/sampledb -u postgres_user -pwd postgres_pass
    

For more information, see Binary Scanning via Command Line (SQL).

  • View Scan Results

    • Select the Search tab.
    • Expand the application to view items and their dependencies.