Restricting a developer on the SQL database during development processes

al4629740
al4629740 used Ask the Experts™
on
I am going to have a developer work on a few ASP.NET web pages.  They will be connecting the web page to a backend SQL database hosted on Microsoft Azure.  I am concerned about security in the development process.  When he is working on the Azure SQL database, is there a role I can assign him and the application that will have certain restrictions?  Is there a role that controls what he can do with the data?  My guess is that the data should be backed up before he works on it, but are there other measures?  I will most certainly change the authentication when the application goes live, but he may need to access the app and database again so he would need a restricted account.  Any help in this area would be appreciated.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
gskTechnology consultant

Commented:
Hi Sir,

There could be various restrictions like he should not have alter or update on the required  tables.he should not have admin role.
please don't grant all priviledges.It all depends on the requirements.

The developer should have read access even on dev/qa/UAT and even prod environment.If there is any data in production which you  need to deploy on dev database ,please provide dummy data (changed values) to developer if data is critical.

he should have import /export data as csv file rights on dev environment.

Author

Commented:
Where do I create this role and is there an article or link you could point to?
gskTechnology consultant

Commented:
please tell what database you are using mysql,oracle,sqlserver or db2 .kindly specify
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
MSSQL
2012 I believe
gskTechnology consultant

Commented:
Hi Sir,

As you have asked about the link or related articles,please type
"mssql 2012 pdf" in google ,you will find links or pdf books
to look.please go through them.If any more clarification
required, please comment.
Technology and Business Process Advisor
Most Valuable Expert 2013
Commented:
Why are you working directly on your production environment?  You should be setting up a development environment that uses old data (even yesterday's data) and does not impact your production environment.  Once you are satisfied the work has been done correctly and things are functioning properly, you move the development code into production.
John TsioumprisSoftware & Systems Engineer

Commented:
Starting a development work with restrictions is like shooting a man on the leg while he is ready to run the marathon...Follow Lee's advice and you should be good to go...1 Azure instance for development , 1 Azure instance for production...keep them as similar as you can minus the data and you should be good to go..
If you insist on the restrictions probably the developer will try find some shortcuts to do his/her work that probably will cause more issues in the future...imagine that there is a validation method that your application relies on...your developer can't really test it so it makes the method the best according to his/her knowledge ....so there is a TODO ...or a comment but when the application goes live something is forgotten and ...disaster strikes...a simple comma or dot could mean the world...take a look at stock exchange accidents...
gskTechnology consultant

Commented:
According to my view the degree of restriction in dev environment  should be very less but still it should be there because QA and UAT environment is also there ,and if developer is almost free ,even then it has its own pros and cons.The data is very important part and that's why In-house development organizations wants to to track developer work.The same is true with large financial institutions and companies where even in dev environment ,developer is restricted.So proper roles should be grant to the developer, but at the same time
he should not feel stuck in his development work.

All the testing should be performed with connection with database,not with hard coded values values.sometimes organisation wants to keep small infrastructure of dev environment in that case QA  and even if not QA ,then  UAT(pre production environment) must have
similar conditions to PROD environment.

Proper Test plan a developer should carry or QA person should assist.

An application may have different level of users and all the UI forms and their data should not be available to them ,that's why developer
must have restriction.only then an application can be assumed to be developed and tested in right manner.
ste5anSenior Developer

Commented:
Lee is right: you need a separate development environment. Cause even when you restrict the developer, he may for example query large Cartesian products, which generates cost and may affect performance of your production system.

The development system must be setup in a way, so that development can fulfil the requirements. You only restrict the development system for the tasks to carry out. This means, when a single developer has different tasks for different privileged functionality, then restrictions is adjusted to match this situation in the live system.

John and gsk are both showing an aspect of permissions necessary in a dev system. But the important part is, that these are not really fix.

The only open question is: who's changing the permissions in the dev system when necessary? This depends on the size and structure of your development team as well as its development strategy (system).

E.g. when you use SCRUM, then permissions are setup before the sprint starts. And they are not changed during it.
Dung DinhDBA and Business Intelligence Developer

Commented:
You can connect to your Database Azure and create a SQL Account for your developer
USE [master];
GO
CREATE LOGIN user1 WITH PASSWORD =N'P@ssword';
GO
USE [ddazuredemo]
GO
CREATE USER user1 FOR LOGIN user1 WITH DEFAULT_SCHEMA = dbo;
ALTER ROLE [db_datareader] ADD MEMBER [user1];
------------------ TESTING--------------------
EXECUTE AS  USER='user1'
Go
CREATE TABLE TEST1(ID int)

OR if you integrate the Active Directory with Azure Directory, you can create an account for him and use GRANT statement to grant which permission on which database objects he is allowed to access or execute.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial