-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dependabot/go_modules/gopkg.in/yaml.v3-3.0.0' of github…
….com:st-tech/gatling-operator into dependabot/go_modules/gopkg.in/yaml.v3-3.0.0
- Loading branch information
Showing
15 changed files
with
414 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile | ||
{ | ||
"name": "Gatling Operator Dev Container", | ||
"build": { | ||
// Sets the run context to one level up instead of the .devcontainer folder. | ||
"context": "..", | ||
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename. | ||
"dockerfile": "../Dockerfile.dev" | ||
}, | ||
"mounts": [ | ||
// Mount the host's Docker socket. | ||
// Official document: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/docker.md | ||
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" | ||
], | ||
"runArgs": [ | ||
"--name=gatling-operator-dev-container", | ||
"--hostname=gatling-operator-dev-container", | ||
// Set network mode to host to communicate with other containers. | ||
"--network=host" | ||
], | ||
"containerEnv": { | ||
"IN_DEV_CONTAINER": "true" | ||
}, | ||
// Restore the local kubectl config to a dev container. | ||
"postStartCommand": "if [ -d ${containerWorkspaceFolder}/.kube ]; then cp -r ${containerWorkspaceFolder}/.kube $HOME/.kube; fi", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"streetsidesoftware.code-spell-checker", | ||
"mhutchie.git-graph" | ||
] | ||
} | ||
} | ||
} |
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,27 @@ | ||
{{ $d := dict "CRITICAL" "🔴" "HIGH" "🟠" "MEDIUM" "🟡" "UNKNOWN" "🟤" }} | ||
|
||
{{- range . -}} | ||
## {{ .Target }} | ||
|
||
### {{ .Type }} [{{ .Class }}] | ||
|
||
{{ if .Vulnerabilities -}} | ||
| Title | Severity | CVE | Package Name | Installed Version | Fixed Version | PrimaryURL | | ||
| :--: | :--: | :--: | :--: | :--: | :--: | :-- | | ||
{{- range .Vulnerabilities }} | ||
| {{ .Title -}} | ||
| {{ get $d .Severity }}{{ .Severity -}} | ||
| {{ .VulnerabilityID -}} | ||
| {{ .PkgName -}} | ||
| {{ .InstalledVersion -}} | ||
| {{ .FixedVersion -}} | ||
| {{ .PrimaryURL -}} | ||
| | ||
{{- end }} | ||
|
||
{{ else -}} | ||
_No vulnerabilities found_ | ||
|
||
{{ end }} | ||
|
||
{{- end }} |
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: daily vulnerability scan | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
env: | ||
IMAGE_NAME: zozo-gatling-operator | ||
TRIVY_RESULTS_MARKDOWN: trivy-results.md | ||
|
||
permissions: | ||
contents: read | ||
issues: write | ||
|
||
jobs: | ||
build-scan-and-save-results: | ||
name: Build, scan, and save results | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: ./go.mod | ||
cache: true | ||
|
||
- name: Go modules sync | ||
run: go mod tidy | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build an image from Dockerfile | ||
run: | | ||
make docker-build IMG="${{ env.IMAGE_NAME }}:${{ github.sha }}" | ||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/trivy-action@master | ||
with: | ||
scan-type: image | ||
image-ref: "${{ env.IMAGE_NAME }}:${{ github.sha }}" | ||
exit-code: 1 | ||
ignore-unfixed: true | ||
vuln-type: os,library | ||
severity: HIGH,CRITICAL | ||
timeout: 10m0s | ||
scanners: vuln,secret,config | ||
format: template | ||
template: "@.github/ISSUE_TEMPLATE/trivy-results.tpl" | ||
output: ${{ env.TRIVY_RESULTS_MARKDOWN }} | ||
|
||
- name: Insert YAML front matter into the results markdown | ||
if: always() | ||
run: | | ||
sed -i '1i\ | ||
---\ | ||
title: "[DO NOT CHANGE] Security Alert"\ | ||
labels: "trivy, vulnerability"\ | ||
---\ | ||
' "${{ env.TRIVY_RESULTS_MARKDOWN }}" | ||
- name: Create or update the trivy results issue | ||
uses: JasonEtco/create-an-issue@v2 | ||
if: always() | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
filename: ${{ env.TRIVY_RESULTS_MARKDOWN }} | ||
update_existing: true | ||
search_existing: open |
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,5 @@ | ||
{ | ||
"cSpell.words": [ | ||
"devcontainer" | ||
] | ||
} |
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,53 @@ | ||
FROM ubuntu:22.04 | ||
|
||
ENV GO_VERSION 1.17.13 | ||
ENV KUBECTL_VERSION v1.21.10 | ||
|
||
# KEEP the value as arm64. | ||
# This environment variable is for arm64, but should be left as is for any architecture | ||
# References: | ||
# https://github.com/etcd-io/etcd/issues/10677 | ||
# https://github.com/k0sproject/k0s/issues/424 | ||
ENV ETCD_UNSUPPORTED_ARCH arm64 | ||
|
||
# Development tools | ||
RUN apt-get update && apt-get upgrade -y && apt-get install -y \ | ||
wget \ | ||
git \ | ||
make \ | ||
gcc | ||
|
||
# Docker CLI | ||
# Referring to https://docs.docker.com/engine/install/ubuntu/#installation-methods | ||
RUN apt-get install -y \ | ||
ca-certificates \ | ||
curl \ | ||
gnupg \ | ||
&& install -m 0755 -d /etc/apt/keyrings \ | ||
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg \ | ||
| gpg --dearmor -o /etc/apt/keyrings/docker.gpg \ | ||
&& chmod a+r /etc/apt/keyrings/docker.gpg \ | ||
&& echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ | ||
"$(. /etc/os-release && echo "${VERSION_CODENAME}")" stable" \ | ||
| tee /etc/apt/sources.list.d/docker.list > /dev/null \ | ||
&& apt-get update && apt-get install -y \ | ||
docker-ce-cli | ||
|
||
# kubectl | ||
# Referring to https://kubernetes.io/ja/docs/tasks/tools/install-kubectl/ | ||
RUN curl -LO "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/"$(dpkg --print-architecture)"/kubectl" \ | ||
&& chmod +x ./kubectl \ | ||
&& mv ./kubectl /usr/local/bin/kubectl | ||
|
||
# golang | ||
# Referring to https://go.dev/doc/install | ||
RUN wget "https://go.dev/dl/go${GO_VERSION}.linux-"$(dpkg --print-architecture)".tar.gz" \ | ||
&& tar -C /usr/local -xzf "go${GO_VERSION}.linux-"$(dpkg --print-architecture)".tar.gz" | ||
ENV PATH "${PATH}:/usr/local/go/bin" | ||
ENV PATH "${PATH}:/root/go/bin" | ||
|
||
# kind | ||
# References: | ||
# https://github.com/kind-ci/examples/blob/master/.github/workflows/kind.yml | ||
# https://kind.sigs.k8s.io/docs/user/resources/ | ||
RUN GO111MODULE=on go install sigs.k8s.io/kind@latest |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.