Skip to content

Commit

Permalink
Update dependencies to address CVE-2024-7254 (#240)
Browse files Browse the repository at this point in the history
This vulnerability affects the Java bindings. Go and Node bindings are
also updated; as are the tooling versions used to build the bindings.

Note that the Node bindings are now built targeting Node 18, since this
is the oldest currently supported LTS release.

Signed-off-by: Mark S. Lewis <[email protected]>
  • Loading branch information
bestbeforetoday authored Sep 23, 2024
1 parent af35fc5 commit 8e482ea
Show file tree
Hide file tree
Showing 16 changed files with 340 additions and 2,928 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ jobs:

- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '8'
distribution: temurin
java-version: 21

- name: Check package.json version
working-directory: bindings/node
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21.6
go-version: stable
cache: false

- name: Cache build dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21.6
go-version: stable
cache: false

- name: Run make
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go-bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21.6
go-version: stable
check-latest: true
cache: true
cache-dependency-path: build/bindings/go-${{ matrix.apiver }}/go.sum
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/java-bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ jobs:
- name: Set up Java for publishing to GitHub Packages
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '8'
cache: 'maven'
distribution: temurin
java-version: 21
cache: maven

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21.6
go-version: stable
cache: false

- name: Run make
Expand Down Expand Up @@ -76,9 +76,9 @@ jobs:
uses: actions/setup-java@v4
if: needs.ci_checks.outputs.publish_release == 'true'
with:
distribution: 'temurin'
java-version: '8'
cache: 'maven'
distribution: temurin
java-version: 21
cache: maven
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/node-bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 16
cache: 'npm'
node-version: 20
cache: npm
cache-dependency-path: bindings/node/package-lock.json
registry-url: https://registry.npmjs.org/

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21.6
go-version: stable
cache: false

- name: Run make
Expand Down
17 changes: 7 additions & 10 deletions .github/workflows/vulnerability-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,32 @@ name: "Security vulnerability scan"

on:
schedule:
- cron: "20 02 * * *"
- cron: "20 02 * * 0"
workflow_dispatch:

permissions:
contents: read

env:
GO_VERSION: '1.22'

jobs:
go:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version: stable
check-latest: true
cache: false
- name: Scan
run: make scan-go

node:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version: stable
cache: false
- uses: actions/setup-node@v4
with:
Expand All @@ -39,12 +36,12 @@ jobs:
run: make scan-node

java:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version: stable
cache: false
- uses: actions/setup-java@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
/bindings/go-apiv2/**/*.pb.go
/bindings/java/src
/bindings/node/src
/bindings/node/bom.json
24 changes: 13 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@ HTTPS_GIT := https://github.com/hyperledger/fabric-protos.git
SSH_GIT := ssh://[email protected]/hyperledger/fabric-protos.git

# This controls the version of buf to install and use.
BUF_VERSION := 1.32.2
BUF_VERSION := 1.42.0
# If true, Buf is installed from source instead of from releases
BUF_INSTALL_FROM_SOURCE := false

PROTOC_VERSION := 25.3
PROTOC_VERSION := 28.2
PROTOC_GEN_DOC_VERSION := 1.5.1
PROTOC_GEN_GO_VERSION := 1.33.0
PROTOC_GEN_GO_GRPC_VERSION := 1.3.0
PROTOC_GEN_GRPC_JAVA_VERSION := 1.63.0
PROTOC_GEN_JS_VERSION := 3.21.2
PROTOC_GEN_GO_VERSION := 1.34.2
PROTOC_GEN_GO_GRPC_VERSION := 1.5.1
PROTOC_GEN_GRPC_JAVA_VERSION := 1.68.0
PROTOC_GEN_JS_VERSION := 3.21.4
GRPC_TOOLS_VERSION := 1.12.4
TS_PROTOC_GEN_VERSION := 0.15.0

# This is the commit hash for the https://github.com/googleapis/googleapis repo
GRPC_STATUS_VERSION := f36c65081b19e0758ef5696feca27c7dcee5475e
GRPC_STATUS_VERSION := 3597f7db2191c00b100400991ef96e52d62f5841
GRPC_STATUS_PROTO := google/rpc/status.proto

### Everything below this line is meant to be static, i.e. only adjust the above variables. ###
Expand Down Expand Up @@ -281,14 +281,16 @@ scan-go: genprotos
cd bindings/go-apiv2 && govulncheck ./...

.PHONY: scan-java
scan-java: javabindings
scan-java:
go install github.com/google/osv-scanner/cmd/osv-scanner@latest
cd bindings/java && mvn --activate-profiles sbom -DskipTests install
osv-scanner --sbom=bindings/java/target/bom.json
osv-scanner scan --lockfile=bindings/java/pom.xml

.PHONY: scan-node
scan-node:
cd bindings/node && npm ci && npm audit --omit=dev
go install github.com/google/osv-scanner/cmd/osv-scanner@latest
cd bindings/node && \
npm sbom --omit dev --package-lock-only --sbom-format cyclonedx > bom.json && \
osv-scanner scan --sbom=bom.json

# clean deletes any files not checked in and the cache for all platforms.

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
This repository contains the [grpc] service and [protocol buffer][protobuf] definitions for the Hyperledger Fabric project.
Tools like `protoc` can transform these definitions into code that can be used by clients and libraries to interact with Fabric.

Language bindings for Go, Node and Java are generated from the protocol buffer definitions within this repository, and published for use by other projects. For more information, please see the [documentation](https://hyperledger.github.io/fabric-protos/).

Issues and pull requests related to any of the published language bindings should be raised in this repository.

## Building and testing

### Build using make
Expand Down
14 changes: 7 additions & 7 deletions bindings/go-apiv2/go.mod
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
module github.com/hyperledger/fabric-protos-go-apiv2

go 1.17
go 1.21.0

require (
google.golang.org/grpc v1.63.2
google.golang.org/protobuf v1.33.0
google.golang.org/grpc v1.67.0
google.golang.org/protobuf v1.34.2
)

require (
golang.org/x/net v0.24.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/text v0.17.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
)
Loading

0 comments on commit 8e482ea

Please sign in to comment.