-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from przemeklal/static_analysis_and_hardening
fix static analysis errors and build hardened binary
- Loading branch information
Showing
8 changed files
with
41 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
go build -o hardened-binary -buildmode=pie -ldflags "-s -w -extldflags=-Wl,-z,now,-z,relro" userspace/userspace.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,12 +4,14 @@ | |
|
||
|
||
# -------- Builder stage. | ||
FROM centos | ||
MAINTAINER Billy McFall <[email protected]> | ||
FROM centos:7 | ||
|
||
# | ||
# Install required packages | ||
# | ||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
|
||
|
||
RUN rpm --import https://mirror.go-repo.io/centos/RPM-GPG-KEY-GO-REPO && curl -s https://mirror.go-repo.io/centos/go-repo.repo | tee /etc/yum.repos.d/go-repo.repo | ||
RUN yum groupinstall -y "Development Tools" | ||
RUN yum install -y wget numactl-devel git golang make; yum clean all | ||
|
@@ -20,7 +22,7 @@ RUN yum install -y wget numactl-devel git golang make; yum clean all | |
# Download and Build APP-NetUtil | ||
# | ||
WORKDIR /root/go/src/ | ||
RUN go get github.com/openshift/app-netutil 2>&1 > /tmp/UserspaceDockerBuild.log || echo "Can ignore no GO files." | ||
RUN go get github.com/openshift/app-netutil > /tmp/UserspaceDockerBuild.log 2>&1 || echo "Can ignore no GO files." | ||
WORKDIR /root/go/src/github.com/openshift/app-netutil | ||
RUN make c_sample | ||
RUN cp bin/libnetutil_api.so /lib64/libnetutil_api.so; cp bin/libnetutil_api.h /usr/include/libnetutil_api.h | ||
|
@@ -31,7 +33,7 @@ RUN cp bin/libnetutil_api.so /lib64/libnetutil_api.so; cp bin/libnetutil_api.h / | |
ENV DPDK_VER 19.08 | ||
ENV DPDK_DIR /usr/src/dpdk-${DPDK_VER} | ||
WORKDIR /usr/src/ | ||
RUN wget http://fast.dpdk.org/rel/dpdk-${DPDK_VER}.tar.xz | ||
RUN curl --output dpdk-${DPDK_VER}.tar.xz http://fast.dpdk.org/rel/dpdk-${DPDK_VER}.tar.xz | ||
RUN tar -xpvf dpdk-${DPDK_VER}.tar.xz | ||
|
||
ENV RTE_TARGET=x86_64-native-linuxapp-gcc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,9 @@ | |
|
||
|
||
# -------- Builder stage. | ||
FROM centos | ||
MAINTAINER Billy McFall <[email protected]> | ||
FROM centos:7 | ||
|
||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
|
||
# Install VPP - Needed by CNI-VPP | ||
RUN curl -s https://packagecloud.io/install/repositories/fdio/release/script.rpm.sh | bash | ||
|
@@ -23,7 +24,7 @@ RUN yum install -y git golang make | |
|
||
# Build the usrsp-app | ||
WORKDIR /root/go/src/ | ||
RUN go get github.com/intel/userspace-cni-network-plugin 2>&1 > /tmp/UserspaceDockerBuild.log || echo "Can ignore no GO files." | ||
RUN go get github.com/intel/userspace-cni-network-plugin > /tmp/UserspaceDockerBuild.log 2>&1 || echo "Can ignore no GO files." | ||
WORKDIR /root/go/src/github.com/intel/userspace-cni-network-plugin | ||
RUN make extras | ||
RUN cp docker/usrsp-app/usrsp-app /usr/sbin/usrsp-app | ||
|
@@ -61,5 +62,5 @@ COPY vppcni.sh vppcni.sh | |
#COPY usrsp-app /usr/sbin/usrsp-app | ||
|
||
|
||
CMD bash -C './vppcni.sh' | ||
CMD ["bash", "-C", "./vppcni.sh"] | ||
#CMD [ "./vppcni.sh" ] |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters