Skip to content

Commit cb4699d

Browse files
Adrean BoyadzhievGitHub Enterprise
authored andcommitted
Merge pull request #58 from Conjur-Enterprise/CNJR-10628-pipeline-fixes
CNJR 10628 pipeline fixes
2 parents a08b042 + aadd8a3 commit cb4699d

25 files changed

+84
-91
lines changed

.trivyignore.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,10 @@ vulnerabilities:
104104
- id: CVE-2024-34156
105105
paths:
106106
- "usr/local/bin/gosu"
107+
# CVE-2025-47907 is a vulnerability affecting Go's `database/sql` package.
108+
# See: https://nvd.nist.gov/vuln/detail/CVE-2025-47907 and https://pkg.go.dev/vuln/GO-2025-3849
109+
# Gosu (https://github.com/tianon/gosu) handles setuid, setgid, setgroups, and exec syscalls,
110+
# and does not use the `database/sql` package. See: https://github.com/tianon/gosu/blob/master/SECURITY.md
111+
- id: CVE-2025-47907
112+
paths:
113+
- "usr/local/bin/gosu"

CHANGELOG.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1010
- Nothing should go in this section, please add to the latest unreleased version
1111
(and update the corresponding date), or add a new version.
1212

13-
## [1.7.29] - 2025-08-08
13+
## [1.7.29] - 2025-08-26
14+
15+
### Changed
16+
- Upgrade base docker images from Debian Bullseye to Bookworm.
17+
- Migrate from MySQL 8.1 to MySQL LTS and enable `mysql_native_password` plugin in the configuration files.
18+
- Remove deprecated docker compose version declarations
19+
- Update gosec security scanning configuration to use `securego/gosec:latest` docker image.
1420

1521
## [1.7.28] - 2025-04-01
1622

@@ -759,7 +765,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
759765
### Added
760766
- The first tagged version.
761767

762-
[Unreleased]: https://github.com/cyberark/secretless-broker/compare/v1.7.28...HEAD
768+
[Unreleased]: https://github.com/cyberark/secretless-broker/compare/v1.7.29...HEAD
763769
[0.2.0]: https://github.com/cyberark/secretless-broker/compare/v0.1.0...v0.2.0
764770
[0.3.0]: https://github.com/cyberark/secretless-broker/compare/v0.2.0...v0.3.0
765771
[0.4.0]: https://github.com/cyberark/secretless-broker/compare/v0.3.0...v0.4.0
@@ -813,3 +819,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
813819
[1.7.26]: https://github.com/cyberark/secretless-broker/compare/v1.7.25...v1.7.26
814820
[1.7.27]: https://github.com/cyberark/secretless-broker/compare/v1.7.26...v1.7.27
815821
[1.7.28]: https://github.com/cyberark/secretless-broker/compare/v1.7.27...v1.7.28
822+
[1.7.29]: https://github.com/cyberark/secretless-broker/compare/v1.7.28...v1.7.29

Dockerfile.coverage

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.24-bookworm as secretless-builder
1+
FROM golang:1.24-bookworm AS secretless-builder
22
LABEL maintainer="CyberArk Software Ltd."
33
LABEL builder="secretless-builder"
44

@@ -40,7 +40,7 @@ RUN go test -c -coverpkg="./..." ./cmd/secretless-broker && \
4040

4141

4242
# =================== MAIN CONTAINER ===================
43-
FROM alpine:3.20 as secretless-broker
43+
FROM alpine:3.20 AS secretless-broker
4444
LABEL maintainer="CyberArk Software Ltd."
4545

4646
RUN apk add -u --no-cache shadow libc6-compat openssl && \

Dockerfile.dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.24-bullseye
1+
FROM golang:1.24-bookworm
22
LABEL maintainer="CyberArk Software Ltd."
33

44
# On CyberArk dev laptops, golang module dependencies are downloaded with a

Jenkinsfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,16 @@ pipeline {
279279
steps {
280280
script {
281281
infraPoolConnect(INFRAPOOL_EXECUTORV2_AGENT_0) { infrapool ->
282-
infrapool.agentGet from: "${WORKSPACE}", to: "${WORKSPACE}"
282+
infrapool.agentSh "./bin/check_golang_security -s high -c medium -b ${env.BRANCH_NAME}"
283+
infrapool.agentStash name: 'gosec-scan-report', includes: 'gosec-scan-result.xml'
283284
}
284-
sh "./bin/check_golang_security -s High -c Medium -b ${env.BRANCH_NAME}"
285285
}
286-
junit(allowEmptyResults: true, testResults: 'gosec.output')
286+
}
287+
post {
288+
always {
289+
unstash 'gosec-scan-report'
290+
junit(allowEmptyResults: true, testResults: 'gosec-scan-result.xml')
291+
}
287292
}
288293
}
289294
}

bin/Dockerfile.website

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ruby:3-slim-bullseye
1+
FROM ruby:3-slim-bookworm
22

33
RUN apt-get -y update && \
44
apt-get -y install build-essential && \

bin/check_golang_security

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,31 +23,5 @@ while getopts 'b:c:s:' flag; do
2323
done
2424

2525

26-
# gosec => Scans go packages and flags security vulnerabilities
27-
if [[ ! -v BRANCH_NAME ]]; then
28-
# Running locally. Use a docker container.
29-
# Exclude test files and the third party go-mssqldb library
30-
excluded_directories="/secretless/test,/secretless/third_party/go-mssqldb"
31-
docker run --rm \
32-
-v "$toplevel_dir/:/secretless/" \
33-
secretless-dev \
34-
bash -exc "
35-
go install github.com/securego/gosec/v2/cmd/gosec@latest
36-
git config --global --add safe.directory /secretless
37-
./bin/run_gosec -c ${confidence} -s ${severity} -b ${current_branch} -e ${excluded_directories}
38-
"
39-
else
40-
# Running in Jenkins
41-
# For some reason the third_party directory is not being excluded properly on main branch builds. It appears in two forms:
42-
# /home/jenkins/agent/workspace/secretless-broker-main-full_main/third_party/go-mssqldb
43-
# /home/jenkins/agent/workspace/secretless-broker-main-full_main/secretless-broker-main-full_main/third_party/go-mssqldb
44-
# To accomodate the second case, we duplicate the name of the working directory to build the full path
45-
# Note this still doesn't work even though we exclude both paths.
46-
third_party_import_dir="$(pwd)/$(basename "$(pwd)")/third_party/go-mssqldb"
47-
excluded_directories="$(pwd)/test,$(pwd)/third_party/go-mssqldb,$third_party_import_dir"
48-
echo "Excluding directories: ${excluded_directories}"
49-
50-
go install github.com/securego/gosec/v2/cmd/gosec@latest
51-
git config --global --add safe.directory "${WORKSPACE}"
52-
./bin/run_gosec -c "${confidence}" -s "${severity}" -b "${current_branch}" -e "${excluded_directories}"
53-
fi
26+
excluded_directories="test,third_party/go-mssqldb,bin/juxtaposer,cmd/shared"
27+
./bin/run_gosec -c "${confidence}" -s "${severity}" -b "${current_branch}" -e "${excluded_directories}"

bin/juxtaposer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.24-alpine as perftool-builder
1+
FROM golang:1.24-alpine AS perftool-builder
22

33
# On CyberArk dev laptops, golang module dependencies are downloaded with a
44
# corporate proxy in the middle. For these connections to succeed we need to

bin/juxtaposer/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/cyberark/secretless-broker/bin/juxtaposer
22

3-
go 1.24.1
3+
go 1.24
44

55
require (
66
github.com/denisenkom/go-mssqldb v0.12.3

bin/run_gosec

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ excluded_dirs=$(for dir in ${excluded_directories//,/ }; do echo -n "-exclude-di
5252
modified_directories="./..."
5353

5454
# Get an array of directories containing modified files
55-
if [[ ${current_branch} != 'main' ]]; then
55+
if [[ ${current_branch} != 'main' ]]; then
5656
echo 'Current branch is not main - running gosec on modified packages for this branch only'
5757
# Jenkins already fetches the main refs so only run locally
5858
if [[ ! -v BRANCH_NAME ]]; then
@@ -62,18 +62,20 @@ if [[ ${current_branch} != 'main' ]]; then
6262
fi
6363

6464
# Remove output file just in case it exists
65-
rm -f "gosec.output"
65+
output_file="gosec-scan-result.xml"
66+
rm -f $output_file
6667

6768
set +e && set +o pipefail
6869

6970
# Run our scan, flagging only 'high' level issues with 'medium' or higher severity
70-
71-
"$(go env GOPATH)"/bin/gosec -fmt=junit-xml \
72-
-out=gosec.output \
73-
-severity="${severity}" \
74-
-confidence="${confidence}" \
71+
docker run --rm \
72+
-v "$(pwd):/secretless-broker/" \
73+
-w "/secretless-broker/" \
74+
securego/gosec:latest " -fmt=junit-xml \
75+
-out=${output_file} \
76+
-stdout \
77+
-verbose=text \
78+
-severity=${severity} \
79+
-confidence=${confidence} \
7580
${excluded_dirs} \
76-
"${modified_directories[@]}"
77-
78-
# Display output of gosec
79-
cat gosec.output
81+
${modified_directories}"

0 commit comments

Comments
 (0)