All Projects → dataplat → AlwaysEncryptedSample

dataplat / AlwaysEncryptedSample

Licence: other
Sample ASP.NET MVC Application for demonstrating Microsoft SQL Server Always Encrypted Functionality

Programming Languages

C#
18002 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
powershell
5483 projects
HCL
1544 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to AlwaysEncryptedSample

Dbt Sqlserver
dbt adapter for SQL Server and Azure SQL
Stars: ✭ 41 (+192.86%)
Mutual labels:  microsoft, sql-server
SQLServerTools
This repo is the home of various SQL-Server-Tools
Stars: ✭ 28 (+100%)
Mutual labels:  microsoft, sql-server
Msphpsql
Microsoft Drivers for PHP for SQL Server
Stars: ✭ 1,570 (+11114.29%)
Mutual labels:  microsoft, sql-server
Azuredatastudio
Azure Data Studio is a data management tool that enables working with SQL Server, Azure SQL DB and SQL DW from Windows, macOS and Linux.
Stars: ✭ 6,605 (+47078.57%)
Mutual labels:  microsoft, sql-server
DacFx
SQL Server database schema validation, deployment, and upgrade runtime. Enables declarative database development and database portability across SQL Server versions and environments.
Stars: ✭ 152 (+985.71%)
Mutual labels:  microsoft, sql-server
Cleanmgrplus
🐾 A Improved Replacement for Microsoft Disk Cleanup
Stars: ✭ 224 (+1500%)
Mutual labels:  microsoft
Msgraph Sdk Powershell
Powershell SDK for Microsoft Graph
Stars: ✭ 239 (+1607.14%)
Mutual labels:  microsoft
Airsim Neurips2019 Drone Racing
Drone Racing @ NeurIPS 2019, built on Microsoft AirSim
Stars: ✭ 220 (+1471.43%)
Mutual labels:  microsoft
Pixel level land classification
Tutorial demonstrating how to create a semantic segmentation (pixel-level classification) model to predict land cover from aerial imagery. This model can be used to identify newly developed or flooded land. Uses ground-truth labels and processed NAIP imagery provided by the Chesapeake Conservancy.
Stars: ✭ 217 (+1450%)
Mutual labels:  microsoft
Xbox-GDK-Samples
Game development samples published by the Xbox Advanced Technology Group using the Microsoft GDK.
Stars: ✭ 128 (+814.29%)
Mutual labels:  microsoft
FritzBoxTelefon-dingsbums
Das Fritz!Box Telefon-dingsbums ist ein Outlook-Addin, welches ein direktes Wählen der Kontakte aus Outlook ermöglicht. Zusätzlich bietet es nützliche Funktionen, wie einen Anrufmonitor oder eine Rückwärtssuche.
Stars: ✭ 16 (+14.29%)
Mutual labels:  microsoft
Azure Event Hubs
☁️ Cloud-scale telemetry ingestion from any stream of data with Azure Event Hubs
Stars: ✭ 233 (+1564.29%)
Mutual labels:  microsoft
Microsoft Todo Osx
Unofficial Microsoft ToDo app for MacOS
Stars: ✭ 227 (+1521.43%)
Mutual labels:  microsoft
Timelinestoryteller
An expressive visual storytelling environment for presenting timelines on the web and in Power BI. Developed at Microsoft Research.
Stars: ✭ 244 (+1642.86%)
Mutual labels:  microsoft
Languageserver.jl
An implementation of the Microsoft Language Server Protocol for the julia language.
Stars: ✭ 223 (+1492.86%)
Mutual labels:  microsoft
privacysec
I don't have anything to hide, but I don't have anything to show you either.
Stars: ✭ 110 (+685.71%)
Mutual labels:  microsoft
Azure Devops Migration Tools
Azure DevOps Migration Tools allow you to migrate Teams, Backlogs, Tasks, Test Cases, and Plans & Suits from one Project to another in Azure DevOps / TFS both within the same Organisation, and between Organisations.
Stars: ✭ 218 (+1457.14%)
Mutual labels:  microsoft
Api Management Developer Portal
Azure API Management developer portal.
Stars: ✭ 229 (+1535.71%)
Mutual labels:  microsoft
Vscode
Visual Studio Code
Stars: ✭ 125,417 (+895735.71%)
Mutual labels:  microsoft
Azure Powershell
Microsoft Azure PowerShell
Stars: ✭ 2,873 (+20421.43%)
Mutual labels:  microsoft

Always Encrypted Sample Application

CircleCI Build Status Appveyoy Build status GitHub license

This is a sample ASP.NET application that demonstrates Always Encrypted features based on the Visual Studio 2013 Default ASP.NET MVC project. It is ONLY meant to demonstrate Always Encrypted. It is NOT meant to be a general purposes best practice web application.

Running

This application should compile in Visual Studio 2015+ out of the box. To compile it with Visual Studio 2013. the Microsoft .NET Framework 4.6 Targeting Pack is required. ADO.NET support for Always Encrypted is only present in .NET 4.6

Creating the database

If you edit the one connection string in the web.config to point to a SQL Server 2016+ instance that your windows user has sa access to, and press F5 to run the project it will create the database with three schemas and several tables. Once the database is created then you should be able to run the app as a user with db_datareader and db_datawriter permissions. However, this is a sample app not intended for production usage.

ALternatively, if you run the following T-SQL as SA to create the empty database, login, and user, The app will work out of the box.

CREATE DATABASE AlwaysEncryptedSample;
GO
CREATE LOGIN AlwaysEncryptedOwner WITH PASSWORD = '7aO!z@xUu!4r6EvD#D&l$sz6&h^rhxL6fzAHMpnOga@LO*WdsEdpfh4^Egtl';
GO
USE AlwaysEncryptedSample;
GO
CREATE USER AlwaysEncryptedOwner;
ALTER ROLE  db_owner  
       ADD MEMBER AlwaysEncryptedOwner;

Initially the columns are not encrypted. To encrypt them run the included powershell scripts. These script supports the -Debug and -Verbose parameters. This will create a self signed certificate in your user script repository and encrypt all the appropriate columns.

$ConnectionString = 'Data Source=localhost,1433;Initial Catalog=AlwaysEncryptedSample;UID=AlwaysEncryptedOwner;PWD=7aO!z@xUu!4r6EvD#D&l$sz6&h^rhxL6fzAHMpnOga@LO*WdsEdpfh4^Egtl;Application Name=AppVeyor CI Process;Column Encryption Setting=Enabled'
.\New-EncryptionKeys.ps1 $ConnectionString -ExportCertificate
.\Invoke-EncryptColumns.ps1 -ConnectionString $ConnectionString

Schemas

There are three schemas in the sample database.

Logging

This contains one table called log written to by log4net using the AdoNetAppender. The user name and client ip columns are encrypted using deterministic encryption. Note that this hurts performance a lot The point of including this is to show that as long as you are using parameterized queries, Always Encrypted can be added without code changes.

Authentication

This contains an implementation of the EF Code first IdentityContext. This is the current recommended authentication framework for web apps for ASP.NET applications. Since this already stores and transmits passwords in an encrypted fashion, the PasswordHash is not encrypted via Always Encrypted. However, a SSN (Social Security Number) field has been added to the User table which is encrypted.

Purchasing

This contains two tables for storing Credit Card information. The credit card number is stored using random encryption and CCV code is stored using deterministic encryption.

Using the app:

The app has two users Administrator with the password of Alm0nds! and CCAdmin with the password of Appl3s. The user administrator has access to an "Internals" page that lists the columns in the database, as well as the encryption information for them. The CCadmin user has a page that will let them import 1000 randomly generated fake credit cards, and then display them in a table. The app also suppors self registration.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].