Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
34 changes: 18 additions & 16 deletions .github/workflows/release-rpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ jobs:
rpm_name_an23: ${{ steps.extract-version.outputs.rpm_name_an23 }}
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: '1.21'

- name: Set up Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: '18'

Expand All @@ -52,11 +52,11 @@ jobs:
RELEASE=$(grep -m1 '^%define alinux_release' rpm/trustee.spec | awk '{print $3}')
echo "VERSION=$VERSION"
echo "RELEASE=$RELEASE"
echo "rpm_name_al8=trustee-${VERSION}-${RELEASE}.al8" >> $GITHUB_OUTPUT
echo "rpm_name_an23=trustee-${VERSION}-${RELEASE}.an23" >> $GITHUB_OUTPUT
echo "rpm_name_al8=trustee-${VERSION}-${RELEASE}.al8" >> "$GITHUB_OUTPUT"
echo "rpm_name_an23=trustee-${VERSION}-${RELEASE}.an23" >> "$GITHUB_OUTPUT"

- name: Upload build artifacts tarball
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: build-artifacts-tarball
if-no-files-found: error
Expand All @@ -79,10 +79,10 @@ jobs:
buildspec_suffix: "an23"
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Download build artifacts tarball
uses: actions/download-artifact@v4
uses: actions/download-artifact@v7
with:
name: build-artifacts-tarball
path: ./
Expand All @@ -99,21 +99,24 @@ jobs:

# Create buildspec for release
export GITHUB_RELEASE VERSION RELEASE
# shellcheck disable=SC2016
envsubst '$GITHUB_RELEASE $VERSION $RELEASE' \
< rpm/${{ matrix.os_flavor.name }}/trustee.${{ matrix.os_flavor.buildspec_suffix }}.buildspec.yaml.template \
> ./trustee-${VERSION}-${RELEASE}.${{ matrix.os_flavor.buildspec_suffix }}.buildspec.yaml
< "rpm/${{ matrix.os_flavor.name }}/trustee.${{ matrix.os_flavor.buildspec_suffix }}.buildspec.yaml.template" \
> "./trustee-${VERSION}-${RELEASE}.${{ matrix.os_flavor.buildspec_suffix }}.buildspec.yaml"

# Copy buildspec for local build
# Install yq
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
sudo chmod +x /usr/local/bin/yq

cp ./trustee-${VERSION}-${RELEASE}.${{ matrix.os_flavor.buildspec_suffix }}.buildspec.yaml rpm/trustee.${{ matrix.os_flavor.buildspec_suffix }}.buildspec.yaml
cp "./trustee-${VERSION}-${RELEASE}.${{ matrix.os_flavor.buildspec_suffix }}.buildspec.yaml" \
"rpm/trustee.${{ matrix.os_flavor.buildspec_suffix }}.buildspec.yaml"
# Replace URL with local path for local build
yq -i ".inputs.source.url = \"file://${GITHUB_WORKSPACE}/build-artifacts-v${VERSION}.tar.gz\"" rpm/trustee.${{ matrix.os_flavor.buildspec_suffix }}.buildspec.yaml
yq -i ".inputs.source.url = \"file://${GITHUB_WORKSPACE}/build-artifacts-v${VERSION}.tar.gz\"" \
"rpm/trustee.${{ matrix.os_flavor.buildspec_suffix }}.buildspec.yaml"

- name: Upload build input artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: build-input-${{ matrix.os_flavor.id }}
if-no-files-found: error
Expand All @@ -127,7 +130,7 @@ jobs:
spec_path: rpm/trustee.${{ matrix.os_flavor.buildspec_suffix }}.buildspec.yaml

- name: Upload RPM packages as build output artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: build-output-${{ matrix.os_flavor.id }}
path: |
Expand Down Expand Up @@ -163,5 +166,4 @@ jobs:
rpm_detail_provenance: true
upload_provenance_to_rekor: true
release_tag_name: ${{ github.event.release.tag_name || inputs.tag_name }}
prerelease: false

prerelease: ${{ github.event.release.prerelease || contains(github.event.release.tag_name, '-') || contains(inputs.tag_name, '-') }}
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion deps/verifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ cfg-if = "1.0.0"
chrono = { version = "0.4", features = ["serde"], optional = true }
codicon = { version = "3.0", optional = true }
# TODO: change it to "0.1", once released.
csv-rs = { git = "https://github.com/openanolis/csv-rs", rev = "b67a07e", optional = true, default-features = false, features = [
csv-rs = { git = "https://github.com/jialez0/csv-rs.git", rev = "1c6fa975f1c74fefbea63739c91feb23efae7186", optional = true, default-features = false, features = [
"network",
] }
eventlog = { path = "../eventlog" }
Expand Down
4 changes: 2 additions & 2 deletions dist/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ build:
CGO_ENABLED=1 GOOS=linux go build -mod vendor -a -installsuffix cgo -ldflags="-s -w" -o gateway cmd/server/main.go && \
cd ..
cargo build -p kbs --locked --release --no-default-features --features coco-as-grpc,aliyun,tpm-pca,encrypted-local-fs,encrypted-db
cargo build --bin restful-as --release --features restful-bin --locked
cargo build --bin grpc-as --release --features grpc-bin --locked
cargo build --bin restful-as --release --features restful-bin,hygon-dcu-verifier --locked
cargo build --bin grpc-as --release --features grpc-bin,hygon-dcu-verifier --locked
cargo build --bin rvps --release
cargo build --bin rvps-tool --release
cargo build --bin attestation-challenge-client --release --features attestation-challenge-client --locked
Expand Down
100 changes: 84 additions & 16 deletions rpm/trustee.spec
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
%define alinux_release 1
%define alinux_release beta
%global config_dir /etc/trustee
%global debug_package %{nil}
%global __brp_mangle_shebangs %{nil}

Name: trustee
Version: 1.10.0
Version: 1.10.1
Release: %{alinux_release}%{?dist}
Summary: Daemon services for attestation and secret distribution
Group: Applications/System
Expand Down Expand Up @@ -81,22 +81,77 @@ popd
install -d %{buildroot}/var/lib/attestation/token/ear/policies/opa
install -m 0644 %{SOURCE5} %{buildroot}/var/lib/attestation/token/ear/policies/opa/default.rego

%pre
if [ ! -s /etc/trustee/private.key ] && [ -s /etc/trustee/public.pub ]; then
echo "Cannot install Trustee: private.key is missing while public.pub exists" >&2
exit 1
fi

%post
systemctl daemon-reload
openssl genpkey -algorithm ed25519 > /etc/trustee/private.key
openssl pkey -in /etc/trustee/private.key -pubout -out /etc/trustee/public.pub
systemctl start trustee
private_key=/etc/trustee/private.key
public_key=/etc/trustee/public.pub

if [ -s "$private_key" ] && [ -s "$public_key" ]; then
: # Preserve the existing pair across upgrades.
elif [ -s "$private_key" ]; then
# Recover a missing public key from the existing private key without rotating
# the signing identity.
umask 077
public_key_tmp=$(mktemp /etc/trustee/.public.pub.XXXXXX) || {
exit 1
}
if openssl pkey -in "$private_key" -pubout -out "$public_key_tmp"; then
chmod 0644 "$public_key_tmp"
chown root:root "$public_key_tmp"
mv -f "$public_key_tmp" "$public_key"
else
rm -f "$public_key_tmp"
exit 1
fi
elif [ -s "$public_key" ]; then
echo "Cannot recover Trustee signing key: private.key is missing" >&2
exit 1
else
# First installation: generate both files before publishing either one.
umask 077
private_key_tmp=$(mktemp /etc/trustee/.private.key.XXXXXX) || exit 1
public_key_tmp=$(mktemp /etc/trustee/.public.pub.XXXXXX) || {
rm -f "$private_key_tmp"
exit 1
}
if ! openssl genpkey -algorithm ed25519 -out "$private_key_tmp" ||
! openssl pkey -in "$private_key_tmp" -pubout -out "$public_key_tmp"; then
rm -f "$private_key_tmp" "$public_key_tmp"
exit 1
fi
chmod 0600 "$private_key_tmp"
chmod 0644 "$public_key_tmp"
chown root:root "$private_key_tmp" "$public_key_tmp"
mv -f "$private_key_tmp" "$private_key"
mv -f "$public_key_tmp" "$public_key"
fi

chmod 0600 "$private_key"
chmod 0644 "$public_key"
chown root:root "$private_key" "$public_key"

if [ -d /run/systemd/system ]; then
systemctl daemon-reload
systemctl start trustee
fi

%post -n trustee-frontend
systemctl enable trustee-frontend
systemctl start trustee-frontend

%preun
if [ $1 == 0 ]; then #uninstall
systemctl unmask trustee kbs as as-restful rvps
systemctl stop trustee kbs as as-restful rvps
systemctl disable trustee kbs as as-restful rvps
rm -rf /etc/trustee/private.key /etc/trustee/public.pub
if [ "$1" -eq 0 ]; then # uninstall
if [ -d /run/systemd/system ]; then
systemctl unmask trustee kbs as as-restful rvps
systemctl stop trustee kbs as as-restful rvps
systemctl disable trustee kbs as as-restful rvps
fi
rm -f /etc/trustee/private.key /etc/trustee/public.pub
fi

%preun -n trustee-frontend
Expand All @@ -106,7 +161,7 @@ if [ $1 == 0 ]; then #uninstall
fi

%postun
if [ $1 == 0 ]; then #uninstall
if [ "$1" -eq 0 ] && [ -d /run/systemd/system ]; then # uninstall
systemctl daemon-reload
systemctl reset-failed
fi
Expand All @@ -130,10 +185,10 @@ fi
%{_prefix}/bin/trustee-gateway
%{_prefix}/bin/rvps-tool
%exclude %{_prefix}/bin/attestation-challenge-client
%{config_dir}/kbs-config.toml
%{config_dir}/as-config.json
%{config_dir}/rvps.json
%{config_dir}/gateway.yml
%config(noreplace) %{config_dir}/kbs-config.toml
%config(noreplace) %{config_dir}/as-config.json
%config(noreplace) %{config_dir}/rvps.json
%config(noreplace) %{config_dir}/gateway.yml
%{_prefix}/lib/systemd/system/kbs.service
%{_prefix}/lib/systemd/system/as.service
%{_prefix}/lib/systemd/system/as-restful.service
Expand All @@ -152,6 +207,19 @@ fi
/var/lib/attestation/token/ear/policies/opa/default.rego

%changelog
* Mon Sep 21 2026 Jiale Zhang <zhangjiale@linux.alibaba.com> - 1.10.1-beta
- Verifier/Hygon DCU: update csv-rs to Hygon's latest secure-adapter revision
and normalize fixed-width chip IDs for local certificate lookup
- RPM: preserve existing Trustee configuration and signing keys across upgrades,
safely recover a missing public key, reject an unrecoverable public-only state,
and support package lifecycle operations without systemd

* Thu Sep 17 2026 Jiale Zhang <zhangjiale@linux.alibaba.com> - 1.10.1-alpha
- Verifier/Hygon DCU: use the hardware-validated csv-rs revision for mixed
PROTO/SECURE adapters and the current driver ioctl ABI
- Build: explicitly retain the existing verifier set while enabling the Hygon
DCU verifier in both RESTful and gRPC attestation-service binaries

* Mon Sep 14 2026 Jiale Zhang <zhangjiale@linux.alibaba.com> - 1.10.0-1
- AS policy: add an opt-in RegoVM backend with async host functions and
concurrency-safe compiled-program caching
Expand Down
Loading