Skip to content

Commit

Permalink
Merge commit '000e336c2e3c803c2b852d54848b3cb9f44efa61' into modify-c…
Browse files Browse the repository at this point in the history
…reator-profile
  • Loading branch information
Hans-Chrstian committed Aug 12, 2024
2 parents 7c27dd0 + 000e336 commit 508f61e
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 12 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
contents: read
steps:
- uses: actions/checkout@v4
- uses: oss-review-toolkit/ort-ci-github-action@7f23c1f8d169dad430e41df223d3b8409c7a156e
- uses: oss-review-toolkit/ort-ci-github-action@v1
with:
allow-dynamic-versions: "true"
fail-on: "issues"
Expand All @@ -39,7 +39,7 @@ jobs:
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
echo "last_tag=${TAGS[LAST_INDEX]}" >> $GITHUB_OUTPUT
- name: Build Docker image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: ./solr
push: false
Expand All @@ -76,7 +76,7 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
uses: aquasecurity/trivy-action@0.24.0
with:
image-ref: "${{ steps.tag.outputs.last_tag }}"
format: "table"
Expand All @@ -86,7 +86,7 @@ jobs:
severity: "CRITICAL"

- name: Push Docker image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: ./solr
push: true
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oss-review-toolkit/ort-ci-github-action@7f23c1f8d169dad430e41df223d3b8409c7a156e
- uses: oss-review-toolkit/ort-ci-github-action@v1
with:
allow-dynamic-versions: "true"
fail-on: "issues"
Expand All @@ -37,15 +37,15 @@ jobs:
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
tags: |
Expand All @@ -65,7 +65,7 @@ jobs:
echo "last_tag=${TAGS[LAST_INDEX]}" >> $GITHUB_OUTPUT
- name: Build Docker image for scanning
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: ./solr
push: false
Expand All @@ -74,7 +74,7 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
uses: aquasecurity/trivy-action@0.24.0
with:
image-ref: "${{ steps.tag.outputs.last_tag }}"
format: "table"
Expand All @@ -84,7 +84,7 @@ jobs:
severity: "CRITICAL"

- name: Build and push Docker image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: ./solr
push: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: REUSE Compliance Check
uses: fsfe/reuse-action@v2
uses: fsfe/reuse-action@v4
72 changes: 72 additions & 0 deletions .github/workflows/vulnerabilityscan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# SPDX-FileCopyrightText: 2024 PNED G.I.E.
# SPDX-License-Identifier: Apache-2.0

name: Scan Latest Two Semantically Versioned Images with Trivy and ORT

on:
schedule:
- cron: "0 14 * * 1" # Works on Every Monday at 14:00 UTC
workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ghcr.io/genomicdatainfrastructure/gdi-userportal-solr
LATEST_PATCHES: ""

jobs:
fetch-and-scan:
runs-on: ubuntu-latest
steps:
- name: Setup Docker
run: sudo service docker start

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: List Docker Image Tags and Fetch Latest Two
run: |
IMAGE="ghcr.io/genomicdatainfrastructure/gdi-userportal-solr"
echo "Fetching Docker image tags..."
RESPONSE=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/orgs/genomicdatainfrastructure/packages/container/gdi-userportal-solr/versions")
# Log the response for debugging
echo "Response from curl: $RESPONSE"
# Extract tags and creation dates, then sort by creation date
TAGS_WITH_DATES=$(echo "$RESPONSE" | jq -r '.[] | .metadata.container.tags[] as $tag | select($tag | test("^sha-[a-z0-9]+$")) | "\($tag) \(.created_at)"' | sort -k2 -r)
# Get the latest tag from each of the latest two minor versions
LATEST_TAGS=$(echo "$TAGS_WITH_DATES" | awk '{split($1, a, "."); key=a[1] "." a[2]; if (!seen[key]++) print $1}' | head -n 2 | tr '\n' ' ')
# Print the results
echo "Tags fetched: $LATEST_TAGS"
echo "LATEST_PATCHES=$LATEST_TAGS" >> $GITHUB_ENV
- name: Pull and Scan Docker Images with Trivy
run: |
IFS=' ' read -ra TAGS <<< "${{ env.LATEST_PATCHES }}"
for TAG in "${TAGS[@]}"
do
IMAGE_TAG="ghcr.io/genomicdatainfrastructure/gdi-userportal-solr:$TAG"
echo "Pulling $IMAGE_TAG"
docker pull $IMAGE_TAG || exit 1
echo "Scanning $IMAGE_TAG with Trivy"
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock aquasec/trivy:latest image --severity CRITICAL,HIGH --exit-code 1 "$IMAGE_TAG" || exit 1
done
- name: OSS Review Toolkit (ORT) Analysis
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}

- uses: oss-review-toolkit/ort-ci-github-action@v1
with:
allow-dynamic-versions: "true"
fail-on: "issues"
run: "cache-dependencies,cache-scan-results,labels,analyzer,evaluator,advisor,reporter,upload-results"
29 changes: 29 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"packageRules": [
{
"depTypeList": ["devDependencies", "require-dev"],
"updateTypes": ["patch", "minor", "major"],
"groupName": "devDependencies"
},
{
"description": "Trigger fix release for patch updates",
"matchPackageNames": [
"renovate/renovate",
"ghcr.io/renovatebot/renovate"
],
"automerge": true,
"matchUpdateTypes": ["patch"],
"semanticCommitType": "fix",
"automergeType": "pr"
}
],
"extends": [
"config:base",
":preserveSemverRanges",
":dependencyDashboard",
":rebaseStalePrs",
":enableVulnerabilityAlertsWithLabel('security')",
"group:recommended"
]
}
3 changes: 3 additions & 0 deletions renovate.json.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2024 PNED G.I.E.

SPDX-License-Identifier: Apache-2.0

0 comments on commit 508f61e

Please sign in to comment.