Binary Scanning via Command Line (Java)


You must open the command line as an Administrator.


C:\Program Files (x86)\CodeLogic\java>run_agent.bat

FOR linux RUN

/opt/codelogic/java# ./

analyze an application with a relational database

analyze -a yourApp -d jdbc:postgresql://localhost:5432/sampledb -t ARCHIVE -f /locationToYourApp/app.jar

Only analyze an application

analyze -a yourApp -t ARCHIVE -f /locationToYourApp/app.jar

help options for the CodeLogic Java Agent


    analyze - 
            Analyze java artifacts on demand. This command requires parameters
            be passed in interactive or commandline mode. Values from the agent
            configuration are ignored.

    analyze [-a] string  [-f] string  [[-t] string]  [[-o] string]  [[--depth] integer]  [[-s] string]  [[-r] string]  [[-d] string]  [[--disableMethodInvokesScanning] boolean]  [[-w] string]  

    -a or --application  string
        The Application node to create that will be the parent of all objects found in the scan.
        The value is a comma separated list of 'Application' semantic names.
        Semantic names may be anything you wish if creating a new application.
        If linking grouping to an existing application, the semantic name is its 'identity' minus the 'grouping:' prefix.
        Identities for items may be found in the 'Item Details' page of the CodeLogic UI.

    -f or --file  string
        Comma separated list of absolute filepaths to analyze or scan.

    -t or --type  string
        'SCAN' - automatically search for archives
        'ARCHIVE' - specify a Java archive to analyze (.jar,.war,.ear)
        'FILE' - specify a file to analyze. Usually a .class file.
        [Optional, default = SCAN]

    -o or --output  string
        'API' - send results to the api for processing.
        'FILE' - write results to json files in the auxiliary directory.
        'PRINT - print results to console (not recommended).
        [Optional, default = API]

    --depth  integer
        During scanning, this value will be used as the depth of subdirectories to traverse before stopping.
        [Optional, default = 500]

    -s or --scanFilter  string
        A comma separated list of partial filenames that will cause an artifact to be marked for 
        analysis during a SCAN if the artifact's filename contains the filter.
        Wildcards are not supported.
        [Optional, default = <none>]

    -r or --recursive  string
        A comma separated list of substrings to key off of to trigger recursive analysis (jar within jar). 
        Ex: 'codelogic,spring' would match 'codelogic-core-services.jar' and 'spring-data-jpa.jar'.
        The star character '*' may be used to match all jars recursively. Warning: expensive operation.
        [Optional, default = <none>]

    -d or --databases  string
        A comma separated list of database identities to use in the creation of relationships. 
        These database identities will only be used if the scan finds tables and columns but cannot find
        the related database connection. One example where this may happen is with external configuration files.
        [Optional, default = <none>]

    --disableMethodInvokesScanning  boolean
        Disables scanning for method invokes method relationships.
        [Optional, default = false]

    -w or --methodInvokesScanningPackageIncludeList  string
        A comma separated list of Java package prefixes which should be included in method-invokes-method                 relationships. By default no packages are included in method-to-method scanning.
        [Optional, default = <none>]
    --classUsageRelationshipsEnabled    [Flag Parameter: 'true' if option is specified.]
        Attempt to create relationships for class usage on fields and methods.    
        [Optional, default = false]