> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flexagon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Legacy Anchore Scanning Outputs and Groovy Conditions

> 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 o

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.

> [!NOTE]
>
> Each of these variables is also available as a plugin output

<table><colgroup><col /><col /><col /><col /></colgroup><tbody><tr><th>**Groovy Variable**</th><th>**Plugin Output**</th><th>**Description**</th><th>**Example**</th></tr><tr><td>STATUS</td><td>`FDANCR_OUT_STATUS`</td><td>Overall status of the scan/analysis. This is ultimately determined by the policy bundle that is used. Possible values are **pass** or **fail**.</td><td>fail</td></tr><tr><td>FINAL\_ACTION</td><td>`FDANCR_OUT_FINAL_ACTION`</td><td>Similar to the status, this provides the recommended action for the image.</td><td>stop</td></tr><tr><td>STOP\_COUNT</td><td>`FDANCR_OUT_STOP_COUNT`</td><td>An integer count of the number of STOP rules detected for the image</td><td>2</td></tr><tr><td>WARN\_COUNT</td><td>`FDANCR_OUT_WARN_COUNT`</td><td>An integer count of the number of WARN rules detected for the image</td><td>10</td></tr><tr><td>ALL\_COUNTS</td><td>`FDANCR_OUT_ALL_COUNT_LIST`</td><td>A full list of all counts returned</td><td>\[STOP:2, WARN:10, GO:37]</td></tr><tr><td /><td /><td>All other FlexDeploy Variables are also available in the Groovy Script Condition</td><td /></tr></tbody></table>

### Example Groovy Script Conditions

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

  ```
  STATUS == "fail"
  ```

* No warn or stop checks found

  ```
  (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).

  ```
  //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
  ```
