ministryofjustice / cloud-platform

Documentation on the MoJ cloud platform
MIT License
87 stars 45 forks source link

Would like to implement custom error page for ModSec annotation in ingress #4514

Closed itoulou closed 8 months ago

itoulou commented 1 year ago

Service name

GRC service

Gender Recognition Service

Service environment

Impact on the service

low impact

Provide real impact description on the service mentioned. It can include any potential blockers for the product team.

service not blocked but currently not GDS compliant

Problem description

I currently have ModSec annotation implemented on our GRC service but when triggered users will be served with default nginx error message. Followed documentation to use a custom error page via https://github.com/ministryofjustice/cloud-platform-custom-error-pages#usage but this repo is now deprecated and archived and I receive the following error in stack trace when i try to build the image with new error page...

============================================================================ => ERROR [builder 6/6] RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags '-extldflags "-static"' -o cloud-platform-custom-error-pages . 12.4s


[builder 6/6] RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags '-extldflags "-static"' -o cloud-platform-custom-error-pages .:

10 4.897 # golang.org/x/sys/unix

10 4.897 ../golang.org/x/sys/unix/syscall.go:83:16: undefined: unsafe.Slice

10 4.897 ../golang.org/x/sys/unix/syscall_linux.go:1018:20: undefined: unsafe.Slice

10 4.897 ../golang.org/x/sys/unix/syscall_linux.go:2289:9: undefined: unsafe.Slice

10 4.897 ../golang.org/x/sys/unix/syscall_unix.go:118:7: undefined: unsafe.Slice

10 4.897 ../golang.org/x/sys/unix/sysvshm_unix.go:33:7: undefined: unsafe.Slice

10 5.028 # github.com/prometheus/procfs/internal/util

10 5.028 ../github.com/prometheus/procfs/internal/util/parse.go:69:15: undefined: os.ReadFile

10 5.028 ../github.com/prometheus/procfs/internal/util/parse.go:78:15: undefined: os.ReadFile

10 5.028 ../github.com/prometheus/procfs/internal/util/readfile.go:36:9: undefined: io.ReadAll

10 12.15 # github.com/prometheus/common/expfmt

10 12.15 ../github.com/prometheus/common/expfmt/decode.go:89:34: cannot use v (type *io_prometheus_client.MetricFamily) as type protoreflect.ProtoMessage in argument to pbutil.ReadDelimited:

10 12.15 *io_prometheus_client.MetricFamily does not implement protoreflect.ProtoMessage (missing ProtoReflect method)

10 12.15 ../github.com/prometheus/common/expfmt/encode.go:120:36: cannot use v (type *io_prometheus_client.MetricFamily) as type protoreflect.ProtoMessage in argument to pbutil.WriteDelimited:

10 12.15 *io_prometheus_client.MetricFamily does not implement protoreflect.ProtoMessage (missing ProtoReflect method)

10 12.15 ../github.com/prometheus/common/expfmt/text_create.go:46:27: undefined: io.Discard


executor failed running [/bin/sh -c CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags '-extldflags "-static"' -o cloud-platform-custom-error-pages .]: exit code: 2 make: *** [.built-image] Error 1

Contact person

Slack - Ivan Touloumbadjian

AntonyBishop commented 1 year ago

Hi @itoulou is this request still required?

poornima-krishnasamy commented 8 months ago

Related to: https://github.com/ministryofjustice/cloud-platform/issues/5278

poornima-krishnasamy commented 8 months ago

Hi @itoulou , we have a ticket prioritised to look into updating the repo here: https://github.com/ministryofjustice/cloud-platform/issues/5278. Please keep an eye for any updates on that ticket.