fabpot/local-php-security-checker

execution in Docker container: You are being redirected

Closed this issue · 4 comments

kemoc commented

I have ran command:
local-php-security-checker --path="$PROJECTMAPPINGFOLDER"
and have got:

/usr/local/bin/local-php-security-checker: line 1: `<html><body>You are being <a href="https://github-production-release-asset-2e65be.s3.amazonaws.com/329834563/e8f5bc80-56ff-11eb-95af-4f2e26378770?X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20210117%2Fus-east-1%2Fs3%2Faws4_request&amp;X-Amz-Date=20210117T204316Z&amp;X-Amz-Expires=300&amp;X-Amz-Signature=edca856d7204466a127b6c8cbf20a41531d8a89bdd0b65eb883beb16c4f24656&amp;X-Amz-SignedHeaders=host&amp;actor_id=0&amp;key_id=0&amp;repo_id=329834563&amp;response-content-disposition=attachment%3B%20filename%3Dlocal-php-security-checker_1.0.0_linux_amd64&amp;response-content-type=application%2Foctet-stream">redirected</a>.</body></html>'

https://github-production-release-asset-2e65be.s3.amazonaws.com/329834563/e8f5bc80-56ff-11eb-95af-4f2e26378770?X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20210117%2Fus-east-1%2Fs3%2Faws4_request&amp;X-Amz-Date=20210117T204316Z&amp;X-Amz-Expires=300&amp;X-Amz-Signature=edca856d7204466a127b6c8cbf20a41531d8a89bdd0b65eb883beb16c4f24656&amp;X-Amz-SignedHeaders=host&amp;actor_id=0&amp;key_id=0&amp;repo_id=329834563&amp;response-content-disposition=attachment%3B%20filename%3Dlocal-php-security-checker_1.0.0_linux_amd64&amp;response-content-type=application%2Foctet-stream

my Dockerfile uses image php:8.0-fpm

kemoc commented

There is something wrong with time i think: X-Amz-Date=20210117T204316Z
command time returns correct date/time

kemoc commented

command symfony security:check works correctly

kemoc commented

not sure why but helped download by wget against curl:

#RUN curl "https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_amd64"  --output /usr/local/bin/local-php-security-checker
RUN wget -O /usr/local/bin/local-php-security-checker "https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_amd64"

No idea why but dowloaded by curl is broken/have issue.

Thank you for the hint regarding redirects.

The following docker command works for me (adding --location or -L)

FROM php:7.4-cli
# ....
`RUN curl --location --silent --show-error --output /usr/local/bin/local-php-security-checker https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_amd64 && chmod +x /usr/local/bin/local-php-security-checker