Skip to content

Commit c354b59

Browse files
authored
KubeClarity first commit (openclarity#99)
1 parent ed3a068 commit c354b59

File tree

896 files changed

+171642
-3393
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

896 files changed

+171642
-3393
lines changed

.DS_Store

8 KB
Binary file not shown.

.circleci/config.yml

-47
This file was deleted.

.github/ISSUE_TEMPLATE/bug_report.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
<!-- Please use this template while reporting a bug and provide as much info as possible.
11+
-->
12+
13+
14+
#### What happened:
15+
16+
#### What you expected to happen:
17+
18+
#### How to reproduce it (as minimally and precisely as possible):
19+
20+
#### Are there any error messages in KubeClarity logs?
21+
(e.g. `kubectl logs -n kubeclarity --selector=app=kubeclarity`)
22+
23+
#### Anything else we need to know?:
24+
25+
#### Environment:
26+
- Kubernetes version (use `kubectl version --short`):
27+
- KubeClarity version (use `kubectl -n kubeclarity exec deploy/kubeclarity -- ./backend version`)
28+
- Cloud provider or hardware configuration:
29+
- Others:
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/dependabot.yml

+5
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,8 @@ updates:
1010
schedule:
1111
interval: daily
1212
open-pull-requests-limit: 10
13+
- package-ecosystem: github-actions
14+
directory: "/"
15+
schedule:
16+
interval: daily
17+
open-pull-requests-limit: 10

.github/workflows/ci.yml

+152
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
5+
env:
6+
GO_VERSION: 1.17
7+
8+
jobs:
9+
verification:
10+
name: Verification
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
16+
- name: Set up Go
17+
uses: actions/setup-go@v2
18+
with:
19+
go-version: ${{ env.GO_VERSION }}
20+
21+
- name: Check licenses
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
run: make license-check
25+
26+
- name: Run verification
27+
run: make check
28+
29+
build:
30+
needs: verification
31+
name: Build
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Check out code
35+
uses: actions/checkout@v2
36+
37+
- name: Set up Docker Buildx
38+
uses: docker/setup-buildx-action@v1
39+
40+
- name: Cache Docker layers
41+
uses: actions/cache@v2
42+
with:
43+
path: /tmp/.buildx-cache
44+
key: ${{ runner.os }}-buildx-${{ github.ref }}
45+
restore-keys: |
46+
${{ runner.os }}-buildx-
47+
48+
- name: Get current timestamp
49+
id: timestamp
50+
run: echo "::set-output name=timestamp::$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
51+
52+
- name: Build KubeClarity
53+
uses: docker/build-push-action@v2
54+
with:
55+
context: .
56+
tags: ghcr.io/cisco-open/kubeclarity:${{ github.sha }}
57+
file: Dockerfile.backend
58+
push: false
59+
cache-from: type=local,src=/tmp/.buildx-cache
60+
cache-to: type=local,dest=/tmp/.buildx-cache
61+
build-args: |
62+
VERSION=${{ github.sha }}
63+
BUILD_TIMESTAMP=${{ steps.timestamp.outputs.timestamp }}
64+
COMMIT_HASH=${{ github.sha }}
65+
66+
- name: Build CIS Docker Benchmark Scanner
67+
uses: docker/build-push-action@v2
68+
with:
69+
context: .
70+
tags: ghcr.io/cisco-open/kubeclarity-cis-docker-benchmark-scanner:${{ github.sha }}
71+
file: Dockerfile.cis_docker_benchmark_scanner
72+
push: false
73+
cache-from: type=local,src=/tmp/.buildx-cache
74+
cache-to: type=local,dest=/tmp/.buildx-cache
75+
build-args: |
76+
VERSION=${{ github.sha }}
77+
BUILD_TIMESTAMP=${{ steps.timestamp.outputs.timestamp }}
78+
COMMIT_HASH=${{ github.sha }}
79+
80+
- name: Build Runtime K8s Vulnerability Scanner
81+
uses: docker/build-push-action@v2
82+
with:
83+
context: .
84+
tags: ghcr.io/cisco-open/kubeclarity-runtime-k8s-scanner:${{ github.sha }}
85+
file: Dockerfile.runtime_k8s_scanner
86+
push: false
87+
cache-from: type=local,src=/tmp/.buildx-cache
88+
cache-to: type=local,dest=/tmp/.buildx-cache
89+
build-args: |
90+
VERSION=${{ github.sha }}
91+
BUILD_TIMESTAMP=${{ steps.timestamp.outputs.timestamp }}
92+
COMMIT_HASH=${{ github.sha }}
93+
94+
- name: Build SBOM DB
95+
uses: docker/build-push-action@v2
96+
with:
97+
context: sbom_db
98+
tags: ghcr.io/cisco-open/kubeclarity-sbom-db:${{ github.sha }}
99+
file: sbom_db/Dockerfile.sbom_db
100+
push: false
101+
cache-from: type=local,src=/tmp/.buildx-cache
102+
cache-to: type=local,dest=/tmp/.buildx-cache
103+
build-args: |
104+
VERSION=${{ github.sha }}
105+
BUILD_TIMESTAMP=${{ steps.timestamp.outputs.timestamp }}
106+
COMMIT_HASH=${{ github.sha }}
107+
108+
- name: Build CLI
109+
uses: docker/build-push-action@v2
110+
with:
111+
context: .
112+
tags: ghcr.io/cisco-open/kubeclarity-cli:${{ github.sha }}
113+
file: Dockerfile.cli
114+
push: false
115+
cache-from: type=local,src=/tmp/.buildx-cache
116+
cache-to: type=local,dest=/tmp/.buildx-cache
117+
build-args: |
118+
VERSION=${{ github.sha }}
119+
BUILD_TIMESTAMP=${{ steps.timestamp.outputs.timestamp }}
120+
COMMIT_HASH=${{ github.sha }}
121+
122+
lint_chart:
123+
name: Lint Helm Chart
124+
runs-on: ubuntu-latest
125+
steps:
126+
- name: Checkout code
127+
uses: actions/checkout@v2
128+
with:
129+
fetch-depth: 0
130+
131+
- name: Replace version
132+
id: replace_version
133+
run: find . -type f -name "values.yaml" -o -name "Chart.yaml" |
134+
xargs sed -i -e s/latest/v1.0.0-${{ github.sha }}/g
135+
136+
- name: Set up Helm
137+
uses: azure/setup-helm@v1
138+
with:
139+
version: v3.4.0
140+
141+
- uses: actions/setup-python@v2
142+
with:
143+
python-version: 3.7
144+
145+
- name: Set up chart-testing
146+
uses: helm/[email protected]
147+
148+
- name: Add Bitnami Repository
149+
run: helm repo add bitnami https://charts.bitnami.com/bitnami
150+
151+
# - name: Run chart-testing (lint)
152+
# run: ct lint --check-version-increment=false --validate-maintainers=false

.github/workflows/docker.yml

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: Docker
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
jobs:
8+
docker:
9+
name: Docker
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v2
14+
15+
- name: Set up Docker Buildx
16+
uses: docker/setup-buildx-action@v1
17+
18+
- name: Cache Docker layers
19+
uses: actions/cache@v2
20+
with:
21+
path: /tmp/.buildx-cache
22+
key: ${{ runner.os }}-buildx-${{ github.ref }}
23+
restore-keys: |
24+
${{ runner.os }}-buildx-
25+
26+
- name: Get current timestamp
27+
id: timestamp
28+
run: echo "::set-output name=timestamp::$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
29+
30+
- name: Login to GitHub Container Registry
31+
uses: docker/login-action@v1
32+
with:
33+
registry: ghcr.io
34+
username: ${{ github.actor }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: Build KubeClarity
38+
uses: docker/build-push-action@v2
39+
with:
40+
context: .
41+
tags: ghcr.io/cisco-open/kubeclarity:latest
42+
file: Dockerfile.backend
43+
push: true
44+
cache-from: type=local,src=/tmp/.buildx-cache
45+
cache-to: type=local,dest=/tmp/.buildx-cache
46+
build-args: |
47+
VERSION=latest
48+
BUILD_TIMESTAMP=${{ steps.timestamp.outputs.timestamp }}
49+
COMMIT_HASH=${{ github.sha }}
50+
51+
- name: Build CIS Docker Benchmark Scanner
52+
uses: docker/build-push-action@v2
53+
with:
54+
context: .
55+
tags: ghcr.io/cisco-open/kubeclarity-cis-docker-benchmark-scanner:latest
56+
file: Dockerfile.cis_docker_benchmark_scanner
57+
push: true
58+
cache-from: type=local,src=/tmp/.buildx-cache
59+
cache-to: type=local,dest=/tmp/.buildx-cache
60+
build-args: |
61+
VERSION=latest
62+
BUILD_TIMESTAMP=${{ steps.timestamp.outputs.timestamp }}
63+
COMMIT_HASH=${{ github.sha }}
64+
65+
- name: Build Runtime K8s Vulnerability Scanner
66+
uses: docker/build-push-action@v2
67+
with:
68+
context: .
69+
tags: ghcr.io/cisco-open/kubeclarity-runtime-k8s-scanner:latest
70+
file: Dockerfile.runtime_k8s_scanner
71+
push: true
72+
cache-from: type=local,src=/tmp/.buildx-cache
73+
cache-to: type=local,dest=/tmp/.buildx-cache
74+
build-args: |
75+
VERSION=latest
76+
BUILD_TIMESTAMP=${{ steps.timestamp.outputs.timestamp }}
77+
COMMIT_HASH=${{ github.sha }}
78+
79+
- name: Build SBOM DB
80+
uses: docker/build-push-action@v2
81+
with:
82+
context: sbom_db
83+
tags: ghcr.io/cisco-open/kubeclarity-sbom-db:latest
84+
file: sbom_db/Dockerfile.sbom_db
85+
push: true
86+
cache-from: type=local,src=/tmp/.buildx-cache
87+
cache-to: type=local,dest=/tmp/.buildx-cache
88+
build-args: |
89+
VERSION=latest
90+
BUILD_TIMESTAMP=${{ steps.timestamp.outputs.timestamp }}
91+
COMMIT_HASH=${{ github.sha }}
92+
93+
- name: Build CLI
94+
uses: docker/build-push-action@v2
95+
with:
96+
context: .
97+
tags: ghcr.io/cisco-open/kubeclarity-cli:latest
98+
file: Dockerfile.cli
99+
push: true
100+
cache-from: type=local,src=/tmp/.buildx-cache
101+
cache-to: type=local,dest=/tmp/.buildx-cache
102+
build-args: |
103+
VERSION=latest
104+
BUILD_TIMESTAMP=${{ steps.timestamp.outputs.timestamp }}
105+
COMMIT_HASH=${{ github.sha }}

0 commit comments

Comments
 (0)