When writing a PoC you need to keep it as simple as possible and prove that from a technology perspective the project vision is feasible and is the right one. One of the fundamentals rules of a PoC is that it needs to cover things that are not general truth (e.g. You don’t want to prove that ASP.NET MVC can render HTML or expose an REST API).
Keeping a PoC as simple as possible can become a problem when you want to use customer data not only mocks data. When you have customer sensitive information, which should not be visible even to the development team you might end up in a strange situation.
The problem is not related on how you can do this. The biggest problem is the effort that you need to invest to create the deployment scripts or the automation mechanism that would allow the customer to deploy the solution in an isolated environment, where development team would not have access. This effort might require extra development effort that you don’t want to include in a PoC.
Keeping a PoC as simple as possible can become a problem when you want to use customer data not only mocks data. When you have customer sensitive information, which should not be visible even to the development team you might end up in a strange situation.
The problem is not related on how you can do this. The biggest problem is the effort that you need to invest to create the deployment scripts or the automation mechanism that would allow the customer to deploy the solution in an isolated environment, where development team would not have access. This effort might require extra development effort that you don’t want to include in a PoC.
It is clear on how we can achieve this using a classical
approach. We would need to separate environments for DEV and PoCWithRealData.
We need to use a separate environment, deployed on a different infrastructure
where development team don’t have access to it. Nothing special, but with a
little more complexity level from deployment perspective. For PoC you might not
want to create deployment scripts and other things like this, especially when
things are not too complicated.
Let us take a look on how we can use Azure SQL (also applies
for SQL Server) features to make our life more simple. In this context, we are
starting from the assumption that all client confidential information are stored
inside Azure SQL.
What if we would be able to allow development team to access
only mock data from Azure SQL, without having access to the rest of the data?
It is as creating a custom view for the development team that can be used to
fetch only mock data, without being able to see or access other information.
This can be achieved using row-level security feature that
is offered by Azure SQL. These features allow us to control and restrict user
access to data from SQL tables based on their roles, enabling us to have a full
control on what data can be accessed by each user.
Things that we need to do:
- Create a user that has access to entire database and it is be used by customer to populate the database
- Create the SQL script that populated storage with mock data
- Grant access to development users/roles to have access to mock data by creating the right security policy
- Create the migration script that would allow us to migrate confident data to storage
- Migrate the client confident data
- Test and validate with both users/roles
- Share the access rights for mock data with the development team
In this moment, we have only one environments that can be
used by both sides without any problems. The development team has access only
to their mock data and it is impossible for them to access the real data as
long as they use only their access rights.
To make things a little simpler, we can use the user
information that are used to access the Web Application also to access the SQL
instance. This would enable us to assign to our customer users a specific role
in Azure AD that enable access to confidential data. Without this role, users
can see only mock data.
An important thing that we need to keep in mind is how we can know that a row is mock data or customer confidential data. This can be achieved in two ways. The first option is to add an extra column that specify if data is real data or to have a specific range of values in the row ID for example that are reserved for mocks data.
In both cases, you need to ensure that the user/role that will be used by the development team has only reads data (SELECT). For extra rights, you need to use stored procedure or other mechanism to ensure that they will not alter confidential data.
Conclusion
This is only one way how we can simplify a PoC. Of course, the solution is not perfect. The biggest risk is from development team to get the admin access rights or to start to write inside the logs confidential data. Of course, both of these risks can be mitigate and kept under control.
Comments
Post a Comment