Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix][service-external] #28

Open
wants to merge 27 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
a2ca76b
Bump version: 0.2.2 → 0.2.3
vasartori Nov 24, 2023
61944a3
upgrade trivy to 0.49.1
vasartori Mar 12, 2024
497e823
ignorar vulnerabilidades não corrigidas é opcional
azevedod Jun 20, 2024
49fe9d5
fix bug external services
gfalves87 Nov 4, 2024
d5e8227
update alpine version
gfalves87 Nov 6, 2024
852b064
update dependencies
gfalves87 Nov 6, 2024
d2e273b
change db repository
gfalves87 Nov 6, 2024
df5e495
revert update trivy
gfalves87 Nov 6, 2024
4474641
revert clear cache command
gfalves87 Nov 6, 2024
6b81480
Update Trivy version and improve scanning configuration
gfalves87 Nov 25, 2024
da4fdd4
wip
gfalves87 Nov 26, 2024
ecc4390
wip
gfalves87 Nov 27, 2024
fbae263
Enhance scanner.py with improved logging and Trivy configuration
gfalves87 Nov 29, 2024
d89d773
Enhance scanner.py with improved logging and Trivy configuration
gfalves87 Nov 29, 2024
5ba5671
Update thread creation to properly pass arguments to scan.trivy method
gfalves87 Nov 29, 2024
13048f2
Add new environment variables for Trivy configuration:
gfalves87 Dec 3, 2024
49f6485
Add missing commas in os.getenv() calls for TRIVY_CACHE_DIR and TRIV…
gfalves87 Dec 3, 2024
2924298
Add new environment variables for Trivy configuration in values.yaml
gfalves87 Dec 4, 2024
44fbb51
Refactor Trivy command construction for better readability and flexi…
gfalves87 Dec 4, 2024
d5af066
Refactor thread creation in start_threads() to use TRIVY_SCAN_THREADS…
gfalves87 Dec 4, 2024
6cd4751
Changes to how the Trivy scan timeout is handled and specified.
gfalves87 Dec 4, 2024
76bd2d3
```
gfalves87 Dec 4, 2024
b047c3b
```
gfalves87 Dec 4, 2024
b0e3ef5
Enhance Trivy scanner configuration and documentation
gfalves87 Dec 13, 2024
78367ae
ajust version
gfalves87 Dec 13, 2024
bbf24fd
ajust version
gfalves87 Dec 13, 2024
cc67499
Add cache_id parameter to trivy() method calls in tests
gfalves87 Dec 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.2.2
current_version = 0.2.3
commit = True
tag = True

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.11-slim as base
FROM python:3.13-slim as base

# Run tests
FROM base as tester
Expand All @@ -19,7 +19,7 @@ RUN make test
FROM base as builder
COPY requirements.txt /
COPY scripts/download_trivy.sh /
ARG TRIVY_VERSION=0.47.0
ARG TRIVY_VERSION=0.57.1
RUN apt-get update && apt-get install -y wget && apt-get clean autoclean && apt-get autoremove -y && rm -rf /var/lib/{apt,dpkg,cache,log}/
RUN pip install --user -r /requirements.txt && \
chmod +x /download_trivy.sh && /download_trivy.sh
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CONTAINER_NAME=runtime-image-scanner
REGISTRY=$(CONTAINER_NAME)
VERSION_FILE=version.py
#Variable used only to download Trivy locally. For containers, the versions are declared in the Dockerfile.
TRIVY_VERSION=0.47.0
TRIVY_VERSION=0.57.1

patch: build-patch git-push
minor: build-minor git-push
Expand Down Expand Up @@ -42,7 +42,7 @@ build-major:

build:
@$(eval VERSION=`cat $(VERSION_FILE) | grep "VERSION"|cut -d"=" -f2 | sed -e 's/"//g' -e 's/ //g'`)
docker build -t $(REGISTRY):$(VERSION) .
docker build -t $(REGISTRY):$(VERSION)-RC- .

clean-dev:
docker rmi -f $(CONTAINER_NAME):devel
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ All parameters of this scanner are adjustable via environment variables.
| SCAN_INTERVAL | 43200 | no | Time in seconds of the execution interval |
| HTTP_PORT | 8080 | no | Port where the endpoint will listen |
| TRIVY_BIN_PATH | ./trivy | no | trivy binary path |
| IGNORE_UNFIXED | true | no | hide unfixed vulnerabilities |

## Performing unit tests
Test coverage: ![](coverage.svg)
Expand Down
1 change: 1 addition & 0 deletions README_pt-BR.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Todos os parâmetros desse scanner são ajustáveis via variáveis de ambiente.
|SCAN_INTERVAL|43200|não|Tempo em segundos do intervalo de execução|
|HTTP_PORT|8080|não|Porta onde o endpoint irá ouvir|
|TRIVY_BIN_PATH|./trivy|não|Path do binário do trivy|
|IGNORE_UNFIXED|true|no|Ignora as vulnerabilidades não corrigidas|

## Executando testes unitários
Cobertura dos testes: ![](coverage.svg)
Expand Down
4 changes: 2 additions & 2 deletions chart/runtime-image-scanner/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
appVersion: "v0.2.2"
appVersion: "v0.2.4"
description: Runtime image scanner.
name: runtime-image-scanner
version: 0.2.2
version: 0.2.4
6 changes: 5 additions & 1 deletion chart/runtime-image-scanner/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
image:
repository: gcr.io/totvs-kubernetes-service/runtime-image-scanner
tag: "v0.2.2"
tag: "v0.2.4"
pullPolicy: IfNotPresent

imagePullSecrets:
Expand All @@ -15,6 +15,10 @@ Envs:
value: "43200"
- name: HTTP_PORT
value: "8080"
- name: IGNORE_UNFIXED
value: "true"
- name: DB_REPOSITORY
value: "us-east1-docker.pkg.dev/tks-gcr-pub/trivy-db-mirror/trivy-db-mirror"

serviceAccount:
create: true
Expand Down
36 changes: 18 additions & 18 deletions requirements-development.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
bump2version==1.0.1
# bumpversion==0.6.0
cachetools==5.3.0
certifi==2022.12.7
chardet==5.1.0
charset-normalizer==3.1.0
coverage==7.2.2
coverage-badge==1.1.0
docutils==0.19
google-auth==2.16.2
kubernetes==26.1.0
cachetools==5.5.0
certifi==2024.8.30
chardet==5.2.0
charset-normalizer==3.4.0
coverage==7.6.4
coverage-badge==1.1.2
docutils==0.21.2
google-auth==2.35.0
kubernetes==31.0.0
lockfile==0.12.2
oauthlib==3.2.2
prometheus-client==0.16.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
python-dateutil==2.8.2
PyYAML==6.0
requests==2.31.0
requests-oauthlib==1.3.1
prometheus-client==0.21.0
pyasn1==0.6.1
pyasn1-modules==0.4.1
python-dateutil==2.9.0;post0
PyYAML==6.0.2
requests==2.32.3
requests-oauthlib==2.0.0
rsa==4.9
six==1.16.0
urllib3==1.26.15
websocket-client==1.5.1
urllib3==2.2.3
websocket-client==1.8.0
36 changes: 18 additions & 18 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
cachetools==5.3.2
certifi==2023.11.17
cachetools==5.5.0
certifi==2024.8.30
chardet==5.2.0
charset-normalizer==3.3.2
coverage==7.3.2
coverage-badge==1.1.0
docutils==0.20.1
google-auth==2.23.4
idna==3.4
kubernetes==28.1.0
charset-normalizer==3.4.0
coverage==7.6.4
coverage-badge==1.1.2
docutils==0.21.2
google-auth==2.35.0
idna==3.10
kubernetes==31.0.0
lockfile==0.12.2
oauthlib==3.2.2
prometheus-client==0.19.0
pyasn1==0.5.1
pyasn1-modules==0.3.0
python-dateutil==2.8.2
PyYAML==6.0.1
requests==2.31.0
requests-oauthlib==1.3.1
prometheus-client==0.21.0
pyasn1==0.6.1
pyasn1-modules==0.4.1
python-dateutil==2.9.0.post0
PyYAML==6.0.2
requests==2.32.3
requests-oauthlib==2.0.0
rsa==4.9
six==1.16.0
urllib3==1.26.18
websocket-client==1.6.4
urllib3==2.2.3
websocket-client==1.8.0
Loading