-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from canonical/enable-security-monitoring
[DPE-6078] Enable security monitoring
- Loading branch information
Showing
3 changed files
with
119 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Trivy Security Scanner | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build.yaml | ||
scan: | ||
name: Trivy scan | ||
needs: build | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Install rockcraft.skopeo | ||
run: | | ||
sudo snap install rockcraft --classic | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: valkey-rock | ||
path: . | ||
- name: Import locally | ||
run: | | ||
rock_image_version=$(yq '(.version)' rockcraft.yaml) | ||
sudo rockcraft.skopeo --insecure-policy copy \ | ||
oci-archive:valkey_${rock_image_version}_amd64.rock \ | ||
docker-daemon:trivy/valkey:test | ||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/trivy-action@master | ||
with: | ||
image-ref: 'trivy/valkey:test' | ||
format: 'sarif' | ||
output: 'trivy-results.sarif' | ||
severity: 'MEDIUM,HIGH,CRITICAL' | ||
|
||
- name: Upload Trivy scan results to GitHub Security tab | ||
uses: github/codeql-action/upload-sarif@v2 | ||
if: always() | ||
with: | ||
sarif_file: 'trivy-results.sarif' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: charmed-valkey # you probably want to 'snapcraft register <name>' | ||
base: core22 # the base snap is the execution environment for this snap | ||
version: '7.2.5' # just for humans, typically '1.2+git' or '1.3.2' | ||
summary: 'Valkey: open source, in memory datastore as a snap' # 79 char long summary | ||
description: | | ||
Valkey is an open source, in memory datastore released under | ||
the BSD-3 Clause License. It is a continuation of the work | ||
that was being done on Redis 7.2.4. | ||
grade: devel # must be 'stable' to release into candidate/stable channels | ||
confinement: strict # use 'strict' once you have the right plugs and slots | ||
|
||
apps: | ||
server: | ||
command: usr/bin/valkey-server | ||
daemon: simple | ||
restart-condition: always | ||
environment: | ||
LANG: C.UTF-8 | ||
plugs: | ||
- network | ||
- network-bind | ||
- network-observe | ||
- home | ||
cli: | ||
command: usr/bin/valkey-cli | ||
plugs: | ||
- network | ||
- network-bind | ||
- network-observe | ||
- home | ||
benchmark: | ||
command: usr/bin/valkey-benchmark | ||
plugs: | ||
- network | ||
- network-bind | ||
- network-observe | ||
- home | ||
check-aof: | ||
command: usr/bin/valkey-check-aof | ||
plugs: | ||
- network | ||
- network-bind | ||
- network-observe | ||
- home | ||
check-rdb: | ||
command: usr/bin/valkey-check-rdb | ||
plugs: | ||
- network | ||
- network-bind | ||
- network-observe | ||
- home | ||
sentinel: | ||
command: usr/bin/valkey-sentinel | ||
environment: | ||
LANG: C.UTF-8 | ||
plugs: | ||
- network | ||
- network-bind | ||
- network-observe | ||
- home | ||
|
||
parts: | ||
valkey: | ||
plugin: make | ||
source: https://github.com/valkey-io/valkey/archive/refs/tags/7.2.5.tar.gz | ||
override-build: | | ||
mkdir -p ${SNAPCRAFT_PART_INSTALL}/usr | ||
make BUILD_TLS=yes | ||
PREFIX=${SNAPCRAFT_PART_INSTALL}/usr make BUILD_TLS=yes install | ||
build-packages: | ||
- libssl-dev |