Added security / optimization compilation flags

This commit is contained in:
Alexey Pustovalov 2022-07-20 15:33:17 +03:00
parent c967d76685
commit bc7586360f
14 changed files with 28 additions and 14 deletions

View File

@ -47,7 +47,8 @@ RUN set -eux && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \
./bootstrap.sh && \ ./bootstrap.sh && \
export CFLAGS="-fPIC -pie -Wl,-z,relro -Wl,-z,now" && \ export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \
export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe -flto" && \
./configure \ ./configure \
--datadir=/usr/lib \ --datadir=/usr/lib \
--libdir=/usr/lib/zabbix \ --libdir=/usr/lib/zabbix \

View File

@ -41,7 +41,8 @@ RUN set -eux && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \
./bootstrap.sh && \ ./bootstrap.sh && \
export CFLAGS="-fPIC -pie -Wl,-z,relro -Wl,-z,now" && \ export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \
export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe" && \
./configure \ ./configure \
--datadir=/usr/lib \ --datadir=/usr/lib \
--libdir=/usr/lib/zabbix \ --libdir=/usr/lib/zabbix \

View File

@ -28,7 +28,8 @@ RUN set -eux && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \
./bootstrap.sh && \ ./bootstrap.sh && \
export CFLAGS="-fPIC -pie -Wl,-z,relro -Wl,-z,now" && \ export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \
export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe" && \
./configure \ ./configure \
--datadir=/usr/lib \ --datadir=/usr/lib \
--libdir=/usr/lib/zabbix \ --libdir=/usr/lib/zabbix \

View File

@ -51,7 +51,8 @@ RUN set -eux && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \
./bootstrap.sh && \ ./bootstrap.sh && \
export CFLAGS="-fPIC -pie -Wl,-z,relro -Wl,-z,now" && \ export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \
export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe" && \
./configure \ ./configure \
--datadir=/usr/lib \ --datadir=/usr/lib \
--libdir=/usr/lib/zabbix \ --libdir=/usr/lib/zabbix \

View File

@ -47,7 +47,8 @@ RUN set -eux && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \
./bootstrap.sh && \ ./bootstrap.sh && \
export CFLAGS="-fPIC -pie -Wl,-z,relro -Wl,-z,now" && \ export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \
export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe -flto" && \
./configure \ ./configure \
--datadir=/usr/lib \ --datadir=/usr/lib \
--libdir=/usr/lib/zabbix \ --libdir=/usr/lib/zabbix \

View File

@ -47,7 +47,8 @@ RUN set -eux && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \
./bootstrap.sh && \ ./bootstrap.sh && \
export CFLAGS="-fPIC -pie -Wl,-z,relro -Wl,-z,now" && \ export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \
export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe -flto" && \
./configure \ ./configure \
--datadir=/usr/lib \ --datadir=/usr/lib \
--libdir=/usr/lib/zabbix \ --libdir=/usr/lib/zabbix \

View File

@ -41,7 +41,8 @@ RUN set -eux && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \
./bootstrap.sh && \ ./bootstrap.sh && \
export CFLAGS="-fPIC -pie -Wl,-z,relro -Wl,-z,now" && \ export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \
export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe -flto" && \
./configure \ ./configure \
--datadir=/usr/lib \ --datadir=/usr/lib \
--libdir=/usr/lib/zabbix \ --libdir=/usr/lib/zabbix \

View File

@ -28,7 +28,8 @@ RUN set -eux && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \
./bootstrap.sh && \ ./bootstrap.sh && \
export CFLAGS="-fPIC -pie -Wl,-z,relro -Wl,-z,now" && \ export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \
export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe" && \
./configure \ ./configure \
--datadir=/usr/lib \ --datadir=/usr/lib \
--libdir=/usr/lib/zabbix \ --libdir=/usr/lib/zabbix \

View File

@ -47,7 +47,8 @@ RUN set -eux && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \
./bootstrap.sh && \ ./bootstrap.sh && \
export CFLAGS="-fPIC -pie -Wl,-z,relro -Wl,-z,now" && \ export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \
export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe -flto" && \
./configure \ ./configure \
--datadir=/usr/lib \ --datadir=/usr/lib \
--libdir=/usr/lib/zabbix \ --libdir=/usr/lib/zabbix \

View File

@ -47,7 +47,8 @@ RUN set -eux && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \
./bootstrap.sh && \ ./bootstrap.sh && \
export CFLAGS="-fPIC -pie -Wl,-z,relro -Wl,-z,now" && \ export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \
export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe -flto" && \
./configure \ ./configure \
--datadir=/usr/lib \ --datadir=/usr/lib \
--libdir=/usr/lib/zabbix \ --libdir=/usr/lib/zabbix \

View File

@ -41,7 +41,8 @@ RUN set -eux && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \
./bootstrap.sh && \ ./bootstrap.sh && \
export CFLAGS="-fPIC -pie -Wl,-z,relro -Wl,-z,now" && \ export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \
export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe" && \
./configure \ ./configure \
--datadir=/usr/lib \ --datadir=/usr/lib \
--libdir=/usr/lib/zabbix \ --libdir=/usr/lib/zabbix \

View File

@ -28,7 +28,8 @@ RUN set -eux && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \
./bootstrap.sh && \ ./bootstrap.sh && \
export CFLAGS="-fPIC -pie -Wl,-z,relro -Wl,-z,now" && \ export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \
export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe" && \
./configure \ ./configure \
--datadir=/usr/lib \ --datadir=/usr/lib \
--libdir=/usr/lib/zabbix \ --libdir=/usr/lib/zabbix \

View File

@ -51,7 +51,8 @@ RUN set -eux && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \
./bootstrap.sh && \ ./bootstrap.sh && \
export CFLAGS="-fPIC -pie -Wl,-z,relro -Wl,-z,now" && \ export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \
export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe" && \
./configure \ ./configure \
--datadir=/usr/lib \ --datadir=/usr/lib \
--libdir=/usr/lib/zabbix \ --libdir=/usr/lib/zabbix \

View File

@ -47,7 +47,8 @@ RUN set -eux && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \ sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \
./bootstrap.sh && \ ./bootstrap.sh && \
export CFLAGS="-fPIC -pie -Wl,-z,relro -Wl,-z,now" && \ export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \
export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe -flto" && \
./configure \ ./configure \
--datadir=/usr/lib \ --datadir=/usr/lib \
--libdir=/usr/lib/zabbix \ --libdir=/usr/lib/zabbix \