Versions Compared

Key

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

...

For those inexperienced with Anchore, the scanLocalImage operation is just where to start. This operation doesn't require any prerequisites other than having docker installed. For those looking scan and publish results to an existing Anchore Engine installation, analyzeLocalImage and analyzeImage are what you are looking for.

Info

Anchore Inline Scanner

This plugin uses Anchore CI Tools to perform local scanning. Anchore requires images to be pushed to a registry prior to analyzing. The Anchore CI Tools get around this by starting a temporary local Anchore container with a 'localbuild' registry. This allows you to scan and analyze images directly after building on your local docker engine.

...

Each operation in this plugin supplies the option to configure a Groovy script to determine if the scan results are inacceptable and should fail the operation. Below is a list of variables available to the Groovy script.

Outputs
Info

Each of these variables is also available as a plugin output

...

  • The most common use case lets the policy bundle unequivocally determine failure.

    Code Block
    languagegroovy
    STATUS == "fail"
  • No warn or stop checks found

    Code Block
    languagegroovy
    (STOP_COUNT + WARN_COUNT) != 0
  • A script that is more lenient on non-master stream builds (could be only master stream is pushed to the registry and other streams are for local testing).

    Code Block
    languagegroovy
    //master is not allowed any stop checks whereas every other stream can have 5 or less
    FDBLD_STREAM_NAME == "master" ? STOP_COUNT > 0 : STOP_COUNT > 5

...

Workflow Configuration

Anchore is FlexDeploy's preferred choice when it comes to container scanning. As such, you can configure your project to scan the specified image without any configuration other than setting the below properties:

...