Skip to content
This repository was archived by the owner on Nov 10, 2019. It is now read-only.

Commit 1242a2f

Browse files
author
Anton Weiss
committed
Anchore plugin
1 parent 796305a commit 1242a2f

File tree

4 files changed

+41
-60
lines changed

4 files changed

+41
-60
lines changed

plugins/anchore/README.md

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ ANCHORE_CLI_URL|Yes|The address of the Anchore server
3434
ANCHORE_CLI_USER|Yes|Anchore account name
3535
ANCHORE_CLI_PASS|Yes|Anchore account password
3636
ANCHORE_FAIL_ON_POLICY|No|Fail build if policy evaluation fails
37-
QA_IMAGE|No|Image built and scanned
38-
dockerhubUsername|No|Dockerhub account name
39-
dockerhubPassword|No|Dockerhub account password
37+
ANCHORE_CLI_IMAGE|Yes|Image built and scanned
4038

4139
### Codefresh.yml
4240

@@ -47,31 +45,13 @@ steps:
4745
title: Building Docker Image
4846
type: build
4947
image_name: ${{QA_IMAGE}}
50-
working_directory: ./
51-
tag: latest
52-
dockerfile: Dockerfile
53-
metadata:
54-
set:
55-
- QA: Pending Anchore scan before push to Dockerhub..
5648
ScanMyImage:
5749
title: Scanning Docker Image
5850
image: anchore/engine-cli:latest
59-
commands:
60-
- echo "Scanning image with Anchore"
61-
- anchore-cli image add ${{QA_IMAGE}}
62-
- echo "Waiting for analysis to complete"
63-
- anchore-cli image wait ${{QA_IMAGE}}
64-
- echo "Analysis complete"
65-
- if [ "${{ANCHORE_FAIL_ON_POLICY}}" == "true" ] ; then anchore-cli evaluate check ${{QA_IMAGE}}; fi
66-
PushImage:
67-
title: Pushing Docker Image
68-
description: Pushing Docker Image to Dockerhub...
69-
type: push
70-
candidate: '${{MyDockerImage}}'
71-
image_name: jvalance/node_critical_fail
72-
tag: latest
73-
registry: docker.io
74-
credentials:
75-
username: '${{dockerhubUsername}}'
76-
password: '${{dockerhubPassword}}'
51+
env:
52+
- ANCHORE_CLI_IMAGE=${{QA_IMAGE}}
53+
- ANCHORE_CLI_USER=user
54+
- ANCHORE_CLI_PASS=password
55+
- ANCHORE_CLI_URL=http://anchore-engine::8228/v1
56+
- ANCHORE_CLI_FAIL_ON_POLICY=true
7757
```

plugins/anchore/codefresh.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

plugins/anchore/example.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: '1.0'
2+
steps:
3+
MyDockerImage:
4+
title: Building Docker Image
5+
type: build
6+
image_name: ${{QA_IMAGE}}
7+
ScanMyImage:
8+
title: Scanning Docker Image
9+
image: anchore/engine-cli:latest
10+
env:
11+
- ANCHORE_CLI_IMAGE=alpine
12+
- ANCHORE_CLI_URL=http://anchore-engine::8228/v1
13+
- ANCHORE_CLI_FAIL_ON_POLICY=true
14+

plugins/anchore/plugin.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
title: Anchore
2+
image: codefresh/anchore:0.1
3+
description: Analyze Docker images and generate a detailed manifest using Anchore
4+
category:
5+
- Security
6+
source: https://github.com/codefresh-io/anchore-plugin
7+
logo: 'https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/36000068577/logo/UneMLlrkjo4WhDrYBeB91ie0QeWCbs8S5g.png'
8+
maintainer:
9+
- name: Jeremy Valance
10+
envs:
11+
- name: ANCHORE_CLI_URL
12+
description: "The address of the Anchore server"
13+
- name: ANCHORE_CLI_USER
14+
description: "Anchore account name"
15+
- name: ANCHORE_CLI_PASS
16+
description: "Anchore account password"
17+
- name: ANCHORE_FAIL_ON_POLICY
18+
description: "Fail build if policy evaluation fails"
19+
- name: ANCHORE_CLI_IMAGE
20+
description: "Name of the image to scan with Anchore"

0 commit comments

Comments
 (0)