Wednesday, April 5, 2017

Dynamic Data Masking (DDM)


Microsoft introduced an impressive new feature in SQL Server 2016 called Dynamic Data Masking (DDM).

Dynamic Data Masking allows a developer or administrator to decide how much of  sensitive data to reveal, with minimal impact on the application layer. This feature also helps to simplify the design and coding of security in N application by making the data at the database level.

Dynamic Data Masking does not modify, nor change the actual data stored in a table.  It applies the masking functions on the table’s column at the time of returning a data as the result of a query.

Dynamic Data Masking supports four data masking functions, as listed below, using which you can mask the data at the database level:

  1. Default
  2. Random
  3. Custom String
  4. Email

Note:  There are two ways using which you can apply the DDM functions. You can apply this at the time you create the table or you can apply this function in the existing table that contains data using an ALTER statement.

Default

The default function of Dynamic Data Masking masks data on the basis of the column's data type.

·         If the data type is date and time, then it shows the data in 1900-01-01 00:00:00.000 formats.

·         If the data type is numeric then it shows a 0.

·         If data type is string, then it displays data by adding Xs in the string. This function can add maximum 4 X’s in string data, if string contains less than 4 characters, then it will show X for fewer characters only.

An example of the Default Dynamic Data Masking function is shown below.

In this whole article, we will use the same table, so let's create this table. The below script will create a table named DDM_Student_Sample.

While creating the table, we will apply the default DDM function on the Student_DOB column. The actual data of the Student_DOB column will not be visible to the user who has read permission. Instead of the actual data, SQL Server will return data in the 1900-01-01 00.00.00.000 format

--Create a table DDM_Student_Sample & apply default function on Student_DOB column

Create table DDM_Student_Sample

(

Student_ID int,

Student_DOB datetime masked with (function = 'default()'),

Student_Name varchar(100),

Student_Email_Id nvarchar(100)

)

After table creation, we need to insert some data into table to check how the Default DDM function works. So we will use below query to insert four rows into the table.

-- Insert some values into DDM_Student_Sample table



insert into DDM_Student_Sample values (1234,'05/17/1989','Stuart Little Joe','StuartJoe@DDM.com')

insert into DDM_Student_Sample values (2134,'03/01/1990','Alexa sentmov','AlexaSt@DDM.com')

insert into DDM_Student_Sample values (1324,'06/21/1992','SentLaw Rents','SentLawR@DDM.com')

insert into DDM_Student_Sample values (1254,'10/29/1987','pitterpie Laafte','PetterpieL@DDM.com')

After inserting the data we will use the below script to check an actual data stored in the table- DDM_Student_Sample. ( here we are using the user credentials who is having full access or adequate permission which require to check an actual data of  the table and those users only will be able to see the sensitive information like  as shown in above figure.)

-- Check the actual data in the table DDM_Student_Sample using the below query

Select * from [dbo].[DDM_Student_Sample]



Now we will create a user and grant read permission on DDM_Student_Sample table using below script:

--Create DDM_Read user & Grant select (read) permision on table DDM_Student_Sample

CREATE USER DDM_Read WITHOUT LOGIN

As we have applied Default DDM function on column Student_DOB, so lets check how the data will appear when user having read permission on a table using below script.

-- Check the data using user DDM_Read who is having select permission on DDM_Student_Sample table

EXECUTE AS USER = 'DDM_Read'

SELECT * FROM [dbo].[DDM_Student_Sample]

REVERT



From thne above output we can see that user DDM_Read is not able to see the actual data for the Student_DOB column because we have applied the Default Dynamic Data Masking function on this column. Hence, data of column Student_DOB showing in the 1900-01-01 00.00.00.000 format.

If you want to allow a few users who have less privileges, like the user, DDM_Read, then grant the UNMASK permission for this set of users:

-- Grant UNMASK permission to user

Grant UNMASK to DDM_Read

After granting UNMASK permission to the user, DDM_Read, they will be able to see the actual data, like shown in the below figure.



Use the below script to revoke the UNMASK permission of user, DDM_Read.

-- Revoke the Unmask permission of user

Revoke UNMASK to DDM_Read

Random

This DDM function is applied on numeric data types only. It displays a random value for the specified range. In the below example we will apply the Random function on the Student_ID column.

-- apply Random DDM function on Student_ID column

Alter Table[dbo].[DDM_Student_Sample] Alter Column Student_ID Add masked with (function='Random(1,4)')

After applying the Random function, when we try to check the data of table using the DDM_Read user (user with read permission only), the data of the table will look like shown in below figure:



In the above figure, we can see that actual values for Student_ID are replaced with some random numeric values. Again, if you want to allow less privileged user to check the actual data of the table, then grant the UNMASK permission.

Custom String

This DDM function uses the below syntax to mask the data:

Syntax :  Partial(prefix,[padding],suffix)

·         Prefix – Starting numbers of character to be displayed.

·         Suffix – Last number of characters to be displayed from specified column value

·         Padding –Custom padding string for masking.

We will apply the Custom String DDM function on Student_Name column with the below values :

·         Prefix = 3 -- It will displayed first three characters of Student_Name column values.

·         Suffix= 9  -- It will display last 9 characters of Student_Name column values.

·         Padding = &&**& -- It will start masking from 4th character and display this Padding string.

Use the below script to apply Custom String function on a Student_Name column of table DDM_Student_Sample.

-- apply Partial DDM function on Student_Name column

Alter Table[dbo].[DDM_Student_Sample] Alter Column Student_Name Add masked with (function='Partial(3,"&&**&",9)')

And then check the data using DDM_Read user.



The data in the column, Student_Name, will look like it does above for the user, DDM_Read, due to the Custom String DDM function.

The Email Function

This DDM function will displays the first character of an email address, masking the rest of the characters with XXX@XXXX until the suffix “.com”. For example, if we apply the email DDM function for an email address like abc@ddm.com, then this email address will appear as "aXXX@XXXX.com".

Using the below script, we will apply the email DDM function on the Student_Email_Id column of the table,  DDM_Student_Sample, and check how the data will appear to the user, DDM_Read user.

-- apply Email DDM function on Student_Email_Id column

Alter Table[dbo].[DDM_Student_Sample] Alter Column Student_Email_Id Add masked with (function='Email()')

And the values of Student_Email_ID appear in the below format to the user, DDM_Read:



So, in the above image we can see that how data will look after applying the Default, Random, Custom String, and Email Dynamic Data Masking functions to the user who is having less (read only) permission on the table.

We can use below script to remove all the Dynamic Data masking functions on the table :

-- remove the DDM function

Alter Table[dbo].[DDM_Student_Sample] Alter Column Student_Email_Id Drop Masked

Alter Table[dbo].[DDM_Student_Sample] Alter Column Student_Name Drop Masked

Alter Table[dbo].[DDM_Student_Sample] Alter Column Student_DOB Drop Masked

Alter Table[dbo].[DDM_Student_Sample] Alter Column Student_ID Drop Masked

After removal of all Dynamic Data Masking function a sensitive data will be visible to the user DDM_Read as shown in below figure.



Conclusion

Dynamic Data Masking Feature in SQL Server 2016 allows user to mask the data at database level without altering or obfuscating the actual stored data in a table. We can say this feature adds an advantage for the DBA, allowing them to hide the sensitive data from set of user who are having less privileges. This feature saves the extra effort of obfuscating or masking data when a vendor visits your company to fix some issue related to data in a database.

Mobile Access for Visual Studio

Engage in project management on the go! You can now participate in projects wherever you are!
All views, cards and work items have been designed to perfectly fit your phone's screen. Finding the information you need is as easy as it only gets. You can now deliver an added value to the team by clarifying requirements or answering questions - all quicker than ever. All your input is automatically synchronised with Visual Studio and can be utilised by your team using the ordinary interface (either web or IDE).

Features




Sprints for Visual Studio Team Services has a growing list of features. Here are some of the most common use cases:

View and Monitor

  • List sprints and iterations
  • List Product Backlog Items and User Stories
  • Filter Bugs or User Stories
  • Monitor the state of tasks from a mobile report
  • View the details of specific work items

Cooperate

  • Contact team members working on the project
  • Add comments and remarks
  • Assign team members to specific work items
  • Edit the details of work items

Act

  • Log and schedule work
  • Estimate with story points or effort
  • Change states (e.g. close a task or reopen a bug)
  • Redact texts


Use Mobile Access regardless of your role or type of project


Mobile Access to Visual Studio helps people inovlved in a project in various ways. The app delivers key features and does it in a lean and straightforward manner.


Scrum Masters and Project Managers


As a leader of the project you get a continuous access to the progress of your team. Whether in a meeting or on route you are enabled to add comments, answer questions, add details, estimate and track progress of specific tasks. You have got access to the scope of the sprint/iteration at all times.


Development Team


As a member of the project team you get access to tasks assigned to yourself and your coworkers. You can now update the remaining work even after leaving the office. Haven't we all remembered to update our times only after saying goodbye to everyone? Have an implementation idea or a question to your teammate that just popped to your head as soon as you left? Now it is as easy as going into the app on your phone and leaving a comment in a specific work item.


Product Owners


Keep track of the scope of your product right from your mobile. View the estimations committed by the development team and monitor their path to delivering the sprint's goal. You can also answer questions from your team members directly in the work items.


Stakeholders


Even if you're not an active member of a product team, you're now free to oversee the progress of work easily from your phone. Not only can you browse through requirements for the current sprint and iteration but you also have access to any past or planned work as well. You can monitor multiple projects without leaving the app or entering separate credentials

Don't use ascii characters with parameter descriptions.


IN CRM 2016/365 when you include speech marks in the description box for a parameter, and then save and close the process, when you open it up again, the parameter will have completely disappeared -  no warning message or validation error or anything.



Looks like someone from the dev. team forgot to XML-encode the parameter description. As a result, the saving custom action will wipe clean your entire parameter list when the descriptions contains one of the following: "&'<>.

Don’t be fooled by the presence of the parameters after you press the Save button – they are good as gone at this stage.

Flow, Logic Apps, Azure Functions, Azure webjobs - what's the difference??


On the other hand, Logic Apps can enable advanced or mission-critical integrations (e.g. B2B processes) where enterprise-level DevOps and security practices are required. It is typical for a business workflow to grow in complexity overtime. Accordingly, you can start with a flow at first, then convert it to a logic app as needed.

The following table helps you determine whether Flow or Logic Apps is best for a given integration.+

Flow
Logic Apps
Audience
office workers, business users
IT pros, developers
Scenarios
Self-service
Mission-critical
Design Tool
In-browser, UI only
In-browser and Visual Studio, Code view available
DevOps
Ad-hoc, develop in production
source control, testing, support, and automation and manageability in Azure Resource Management
Admin Experience
Security
Standard practices: data sovereignty, encryption at rest for sensitive data, etc.
Security assurance of Azure: Azure Security, Security Center, audit logs, and more.



Functions vs. WebJobs


We can discuss Azure Functions and Azure App Service WebJobs together because they are both code-first integration services and designed for developers.

These enable you to run a script or a piece of code in response to various events, such as new Storage Blobs or a WebHook request. Here are their similarities:  

·         Both are built on Azure App Service and enjoy features such as source control, authentication, and monitoring.

·         Both are developer-focused services.

·         Both support standard scripting and programming languages.

·         Both have NuGet and NPM support.



Functions is the natural evolution of WebJobs in that it takes the best things about WebJobs and improves upon those.. The improvements include:  

·         Streamlined dev, test, and run of code, directly in the browser.

·         Built-in integration with more Azure services and 3rd-party services like GitHub WebHooks.

·         Pay-per-use, no need to pay for an App Service plan.

·         Automatic, dynamic scaling.

·         For existing customers of App Service, running on App Service plan still possible (to take advantage of under-utilized resources).

·         Integration with Logic Apps.



The following table summarizes the differences between Functions and WebJobs:+

Functions
WebJobs
Scaling
Configurationless scaling
scale with App Service plan
Pricing
Pay-per-use or part of App Service plan
Part of App Service plan
Run-type
triggered, scheduled (by timer trigger)
triggered, continuous, scheduled
Trigger events
In-browser development
x
Window scripting
experimental
x
PowerShell
experimental
x
C#
x
x
F#
x
Bash
experimental
x
PHP
experimental
x
Python
experimental
x
JavaScript
x
x

Whether to use Functions or WebJobs ultimately depends on what you're already doing with App Service.

When you have an App Service app for which you want to run code snippets, and you want to manage those together in the same DevOps environment, then use WebJobs.

If you want to run code snippets for other Azure services or even 3rd-party apps, or if you want to manage your integration code snippets separately from your App Service apps, or if you want to call your code snippets from a Logic app, then take advantage of all the improvements in Functions.  

Flow, Logic Apps, and Functions together


As previously mentioned, which service is best suited to you depends on your situation.  

·         For simple business optimization, then use Flow.

·         If your integration scenario is too advanced for Flow, or you need DevOps capabilities and security compliances, then use Logic Apps.

·         If a step in your integration scenario requires highly custom transformation or specialized code, then write a function app, and then trigger a function as an action in your logic app.

You can call a logic app in a flow. You can also call a function in a logic app, and a logic app in a function. The integration between Flow, Logic Apps, and Functions continue to improve overtime. You can build something in one service and use it in the other services. Therefore, any investment you make in these three technologies is worthwhile.+

Next Steps


Get started with each of the services by creating your first flow, logic app, function app, or WebJob. Click any of the following links:+


·         Create a logic app



+

Or, get more information on these integration services with the following links:+



·         Logic Apps Live Webcast


More Than One Form Was Opened at Once for the Lookup Control

In Dynamics 365 for Finance and Operations, when subscribing to a lookup event to modify an existing lookup on a form control, you must...