Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to mask IP in AWS cloud watch in AWS ELB via AWS cli by custom header?

Is there any way to configure AWS loadbalancer via AWS cli to put predefine text like na in place of IP?

Example data log

https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/access-log-collection.html#access-log-entry-examples

like image 322
Ramratan Gupta Avatar asked Feb 05 '19 10:02

Ramratan Gupta


1 Answers

I am not sure why you would like to do. The whole purpose of access log is to see from where the traffic is coming from. Which will not be relevant if you replace the IP address with NA.

So, the simple thing is to disable the whole logs. But I think you need the log as well without the IP, may be due to some audit purpose or anything. For that you need to get the logs and edit it by a script. I don't think you can have a predefined way that AWS do not log the IP as it is the main purpose for those logs.

hope this helps.

cheers

like image 119
Krunal Barot Avatar answered Sep 21 '22 05:09

Krunal Barot