A way to warn developers that they are on a production site

We have a web application deployed in several environments (Dev, QA, etc.), as well as Production. Oddly enough, in non-production areas there are noticeable markings that indicate in what environment this is happening, but Production does not (for obvious reasons). The danger is that the developer will do something at the factory, thinking that they are in some other environment. Of course, self-discipline is your friend here (close Prod as soon as you are done), but is there something systematic that we can do to help us that does not affect the user experience in Prod?

+3
source share
4 answers

.NET

Check the requester’s IP address and see if it’s on your personal subnet.

if (Request.UserHostAddress.StartsWith("192.168.1."))
{
    // show control
}
+2
source

Advanced answer, from the comment:

Do not allow developers on production systems. This is not a comic answer. if you have dev / qa / etc. machines, the developer must be unusual for the production. So unusual that they will “tremble with fear” when they are in production. I have done this for> 25 years, and I still get this fear. (it's good)

+5
source

.NET AD

, .

if (System.Net.Dns.GetHostEntry(Request.UserHostAddress).HostName.EndsWith(".myIntenalDomain.local"))
{
    // show control
}
+1

I agree with the “related product” as soon as you do this. ”However, there are times when developers constantly need access to prod servers. If you are worried, force the developers to use a specific machine (other than their own) to make changes to prod. This gives a physical signal since they must change machines so that they are more careful.

0
source

Source: https://habr.com/ru/post/1775689/


All Articles