Question

We have a web app deployed in several environments (Dev, QA, etc.) as well as Production. Ironically enough, the non-production sites have prominent markings saying what environment it is, but Production does not (for obvious reasons). The danger is that a developer will do something on production thinking that they are in some other environment. Of course, self-discipline is your friend here (close Prod as soon as you're done) but is there anything systematic we can put in place to help us out that will not affect the user experience in Prod?

Was it helpful?

Solution

.NET

Check the requester's IP address and see if it falls within your private subnet.

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

OTHER TIPS

Promoted to answer, from comment:

Don't allow developers on the production systems This is not a joke answer. if you have dev/qa/etc. machines, it should be extremely unusual for a developer to be on production. So unusual that they will 'quake in fear' when they are on production boxes. I've done this for > 25 years, and I still get that fear. (it's a good thing)

.NET with machines in an AD domain

Check the requester's host name and see if it ends with your internal domain name.

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

I agree with 'close prod as soon as your done with it'. However there are cases where developers are constantly requiring access to prod servers. If you are that worried then force developers to use a specific machine (other than their own) to make changes to prod. This gives a physical cue since they have to change machines that they better be careful.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top