Skip to content

Commit

Permalink
Merge pull request #79 from kfox1111/tpm-rpms
Browse files Browse the repository at this point in the history
Add rpms for the tpm bits
  • Loading branch information
kfox1111 authored Jan 26, 2025
2 parents 7a7436f + 01032fe commit c1d2c82
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 1 deletion.
6 changes: 5 additions & 1 deletion examples/rpms/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ RUN \
spectool -g -R k8s-spiffe-workload-jwt-exec-auth.spec && \
rpmbuild -ba k8s-spiffe-workload-jwt-exec-auth.spec && \
spectool -g -R k8s-spiffe-workload-auth-config.spec && \
rpmbuild -ba k8s-spiffe-workload-auth-config.spec
rpmbuild -ba k8s-spiffe-workload-auth-config.spec && \
spectool -g -R spire-server-nodeattestor-tpmdirect.spec && \
rpmbuild -ba spire-server-nodeattestor-tpmdirect.spec && \
spectool -g -R spire-agent-nodeattestor-tpmdirect.spec && \
rpmbuild -ba spire-agent-nodeattestor-tpmdirect.spec

RUN \
dnf localinstall -y https://github.com/smallstep/cli/releases/download/v${STEPVER}/step-cli-${STEPVER}-1.$(uname -i).rpm && \
Expand Down
56 changes: 56 additions & 0 deletions examples/rpms/spire-agent-nodeattestor-tpmdirect.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
##############################################################################
#
# To you, dear reader:
#
# If you are a normal user, we recommend not reading further. Its probably not
# the file your looking for.
#
# If you are looking at using this file as a base for your own work, please
# don't. It is a horrible example. Please look elsewhere.
#
# If you are a package maintainer, please read on. We recognize this spec file
# is blasphemous, a terrible abomination, a crime against nature, and more. We
# regret needing to produce it, but had to in order to attract enough users to
# find you. We beseech thee, kind and generous package maintainer, please help
# us mend our wicked ways by joining us and help us produce proper packaging.
# You are our only hope.
#
##############################################################################

%define ARCH %(echo %{_arch} | sed s/aarch64/arm64/ | sed s/x86_64/amd64/)

Summary: SPIRE Agent Node Attestor TPM Direct
Name: spire-agent-nodeattestor-tpmdirect
Version: 1.8.7
Release: 1
Group: Applications/Internet
License: Apache-2.0
URL: https://spiffe.io
Source0: https://github.com/boxboat/spire-tpm-plugin/releases/download/v%{version}/spire_tpm_plugin_tpm_attestor_agent_linux_%{ARCH}_v%{version}.tar.gz
Source1: https://github.com/boxboat/spire-tpm-plugin/releases/download/v%{version}/spire_tpm_plugin_get_tpm_pubhash_linux_%{ARCH}_v%{version}.tar.gz

%description
K8s SPIFFE Workload JWT Exec Auth Plugin

%global _missing_build_ids_terminate_build 0
%global debug_package %{nil}

%prep

%setup -c
%setup -T -D -a 1

%build

%install
mkdir -p "%{buildroot}/usr/bin"
mkdir -p "%{buildroot}/usr/libexec/spire/plugins"
cp -a tpm_attestor_agent %{buildroot}/usr/libexec/spire/plugins/agent-nodeattestor-tpmdirect
cp -a get_tpm_pubhash %{buildroot}/usr/bin/get-tpm-pubhash

%clean
rm -rf %{buildroot}

%files
/usr/bin/get-tpm-pubhash
/usr/libexec/spire/plugins/agent-nodeattestor-tpmdirect
51 changes: 51 additions & 0 deletions examples/rpms/spire-server-nodeattestor-tpmdirect.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
##############################################################################
#
# To you, dear reader:
#
# If you are a normal user, we recommend not reading further. Its probably not
# the file your looking for.
#
# If you are looking at using this file as a base for your own work, please
# don't. It is a horrible example. Please look elsewhere.
#
# If you are a package maintainer, please read on. We recognize this spec file
# is blasphemous, a terrible abomination, a crime against nature, and more. We
# regret needing to produce it, but had to in order to attract enough users to
# find you. We beseech thee, kind and generous package maintainer, please help
# us mend our wicked ways by joining us and help us produce proper packaging.
# You are our only hope.
#
##############################################################################

%define ARCH %(echo %{_arch} | sed s/aarch64/arm64/ | sed s/x86_64/amd64/)

Summary: SPIRE Server Node Attestor TPM Direct
Name: spire-server-nodeattestor-tpmdirect
Version: 1.8.7
Release: 1
Group: Applications/Internet
License: Apache-2.0
URL: https://spiffe.io
Source0: https://github.com/boxboat/spire-tpm-plugin/releases/download/v%{version}/spire_tpm_plugin_tpm_attestor_server_linux_%{ARCH}_v%{version}.tar.gz

%description
K8s SPIFFE Workload JWT Exec Auth Plugin

%global _missing_build_ids_terminate_build 0
%global debug_package %{nil}

%prep

%setup -c

%build

%install
mkdir -p "%{buildroot}/usr/libexec/spire/plugins"
cp -a tpm_attestor_server %{buildroot}/usr/libexec/spire/plugins/server-nodeattestor-tpmdirect

%clean
rm -rf %{buildroot}

%files
/usr/libexec/spire/plugins/server-nodeattestor-tpmdirect

0 comments on commit c1d2c82

Please sign in to comment.