How to edit 403 error message in AWS WAF

0

is there a way to customize the 403 error message that WAF puts out? Right now our clients are seeing:

<html> <head><title>403 Forbidden</title></head> <body> <center><h1>403 Forbidden</h1></center> </body> </html>

Is there way to edit this? So that clients aren't seeing html tags etc if they receive a 403 error trying to log into our app? The WAF rule that is triggering this is the AWS-AWSManagedRulesBotControlRuleSet...being that it is a managed rule I can't edit the JSON to put out a different output (is this just a console limitation?). And I tried using the custom response bodies section on the rule but it isn't what I need. I just want to change the above out to say something like: "403 Forbidden" but I don't want clients to be seeing <html> <head> etc on the app...like I'm not sure if I can use the terminal to edit this? I attached a picture so you can see what the error message looks like...it just looks really unprofessional imo. example of message on app

gefragt vor einem Monat251 Aufrufe
1 Antwort
1
profile pictureAWS
EXPERTE
beantwortet vor einem Monat
profile picture
EXPERTE
A_J
überprüft vor einem Monat
  • So would I need to create a new rule from scratch? Or I could implement this with an AWS managed rule?

  • it you open the first URL Didier sent you will see "You can get started with the Custom Response feature by configuring the action associated with any new or existing WAF rule, or the default action associated with your web ACL." so you can create a new rule or use the exisiting one

  • so if I follow these instructions (as illustrated in this video:https://www.youtube.com/watch?v=Cd9c-y3v4y4) this isn't going to work for me because I can't edit a managed rule for AWS

  • checking through this https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html i believe this is exactly what you need

  • could I zoom you and show you what im talking about?

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen