Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fake version bump to test trivy scan #172

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft
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
10 changes: 5 additions & 5 deletions .github/workflows/security-scan.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Security scan
on:
# Run only on version bump pull requests that modify Dockerfile
pull_request:
# Run only on pushes to version bump pull requests that modify Dockerfile
push:
paths:
- '**/Dockerfile'
branches:
Expand All @@ -17,12 +17,12 @@ jobs:
uses: actions/checkout@v4
- name: Run Trivy in table mode
# Table output is only useful when running on a pull request or push.
if: contains(fromJSON('["pull_request"]'), github.event_name)
if: contains(fromJSON('["push"]'), github.event_name)
uses: aquasecurity/[email protected]
with:
scan-type: fs
scan-ref: ./newrelic-php-daemon-docker/${{ github.ref_name }}
trivy-config: ./newrelic-php-daemon-docker/trivy.yaml
scan-ref: ./${{ github.ref_name }}
trivy-config: ./trivy.yaml
format: table
exit-code: 1

Expand Down
30 changes: 30 additions & 0 deletions 9.22.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#------------------------------------------------------------------------------
# Copyright [2019] New Relic Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#------------------------------------------------------------------------------


FROM alpine:3.13 AS build

ENV NEWRELIC_VERSION 11.3.0.16
ENV NEWRELIC_NAME newrelic-php5-${NEWRELIC_VERSION}-linux-musl
ENV NEWRELIC_SHA bebd7cb1137296c78b04816654c02fe330efc937947a00c6d7239f197835c5d1

RUN set -ex; \
wget -O /tmp/${NEWRELIC_NAME}.tar.gz https://download.newrelic.com/php_agent/archive/${NEWRELIC_VERSION}/${NEWRELIC_NAME}.tar.gz; \
cd /tmp/; \
echo "$NEWRELIC_SHA $NEWRELIC_NAME.tar.gz" | sha256sum -c; \
tar -xzf ${NEWRELIC_NAME}.tar.gz; \
export NR_INSTALL_SILENT=1; \
${NEWRELIC_NAME}/newrelic-install install_daemon

FROM alpine:3.13

COPY --from=build /usr/bin/newrelic-daemon /bin/newrelic-daemon

HEALTHCHECK --interval=5s --timeout=1s --start-period=1s --retries=3 CMD pidof newrelic-daemon || exit 1

EXPOSE 31339

ENTRYPOINT [ "/bin/newrelic-daemon" ]
CMD ["--foreground", "--logfile", "/proc/self/fd/1", "--port", "31339"]
26 changes: 26 additions & 0 deletions 9.22.0/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh
#------------------------------------------------------------------------------
# Copyright [2019] New Relic Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#------------------------------------------------------------------------------
set -e

defaultArgs=" --logfile /proc/self/fd/1 --watchdog-foreground --address=$(hostname):31339"

case "$1" in
-*)
#args start with a flag
set -- /usr/bin/newrelic-daemon $defaultArgs "$@"
;;
'/usr/bin/newrelic-daemon')
# Remove the first element from the arguments
shift 1
set -- /usr/bin/newrelic-daemon $defaultArgs "$@"
;;
*)
#likely invalid args, but the daemon will handle it with graceful messages.
set -- /usr/bin/newrelic-daemon $defaultArgs "$@"
;;
esac

exec "$@"
Loading