Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

AZURE SECURITY BEST PRACTICES GRIGORE CIPRIAN-STEFAN

Slide 3

Slide 3 text

INTRO ABOUT ME ▸ Working at Maxcode for some time ▸ Part of a team developing Azure cloud applications ▸ And I am into devops culture

Slide 4

Slide 4 text

INTRO MOTIVATION - DEVOPS CULTURE ▸ “DevOps is a cultural movement encouraging collaboration between operations specialists and developers” ▸ ”DevOps culture blurs the line between the roles of developer and operations staff and may eventually eliminate the distinction.”

Slide 5

Slide 5 text

INTRO MOTIVATION - SECURITY AWARENESS ▸ Our teams have more power - from the development phase through the release stage. ▸ We need to think about security in most of the aspects, not development.

Slide 6

Slide 6 text

INTRO CLOUD BENEFITS ▸ The responsibility of security is shared between the implementor and cloud provider (Microsoft) ▸ Microsoft said the cloud security is their top priority

Slide 7

Slide 7 text

INTRO WHAT LEFT TO US, THE DEVS? ▸ A lot… ▸ We need to know what the cloud offers in terms of security, what’s default, what extra options do we have, also what are the best practices.. ▸ White paper with best practices - they are in format like this - describe the recommended practice, mention what you can use from azure (what capability/features/component), and what happens if you don’t

Slide 8

Slide 8 text

AREAS 6 FUNCTIONAL AREAS ▸ Azure security capabilities - 6 functional areas ▸ Each area having a multitude of components/capability

Slide 9

Slide 9 text

▸ I propose a new one: CASINO ▸ Compute (and keys) ▸ Applications ▸ Storage (and Data) ▸ Identity ▸ Networking ▸ Operations AREAS 6 FUNCTIONAL AREAS - HOW TO GRASP THEM ▸ There is a method… ▸ We are accustomed with all kind of acronyms/abbreviations - SOLID, DRY, KISS, STRIDE …

Slide 10

Slide 10 text

NEXT ▸ I will go through each of the functional areas and present some capabilities and best practices ▸ Nota bene - Not all of them are mandatory for use - that depends on speci fi c client’s requirements, possible some of the features insuring additional costs. ▸ Show you a case study

Slide 11

Slide 11 text

COMPUTE (AND KEYS) COMPUTE (AND KEYS) ▸ Hardware Security Module ▸ Azure Key Vault ▸ Virtual machine backup ▸ SQL VM TDE ▸ VM Disk Encryption ▸ Virtual networking ▸ Patch Updates ▸ Antimalware & Antivirus ▸ Azure Security Center C A S I N O

Slide 12

Slide 12 text

BEST PRACTICE : CHOOSE A KEY MANAGEMENT SOLUTION Protecting your keys is essential to protecting your data in the cloud. COMPUTE (AND KEYS) C A S I N O

Slide 13

Slide 13 text

AZURE KEY VAULT ▸ Securely stores and access secrets ▸ Secrets can be ▸ Api Keys, Connection Strings, Passwords ▸ Keys (private keys) ▸ Certi fi cates (SSL) COMPUTE (AND KEYS) C A S I N O

Slide 14

Slide 14 text

AZURE KEY VAULT ▸ It may resemble with a windows certi fi cate store ▸ Sort of … COMPUTE (AND KEYS) C A S I N O

Slide 15

Slide 15 text

AZURE KEY VAULT - CENTRALISE YOUR SECRETS ▸ By having in only one place you can control their distribution ▸ Reduce chances of accidentally leaking information ▸ The devs don’t need to store the secrets in application code / git repos (e.g. connection strings can be placed in vault) ▸ Access the secret info by using URIs. COMPUTE (AND KEYS) C A S I N O

Slide 16

Slide 16 text

AZURE KEY VAULT - HARDWARE SECURITY MODULE (HSM) ▸ They are stored in HSMs ▸ HSMs are (FIPS) 140-2 Level 2 validated (usually required for credit card processing) Q: What is the difference between a software-protected and HSM-protected key with Azure Key Vault? A: Both types of key have the key stored in the HSM at rest. The difference is for a software- protected key when cryptographic operations are performed they are performed in software in compute VMs while for HSM-protected keys the cryptographic operations are performed within the HSM 
 In test/dev environments using the software-protected option is recommended while in production use HSM-protected. The only downside with HSM-protected is an additional charge per-month if the key is used in that month. COMPUTE (AND KEYS) C A S I N O

Slide 17

Slide 17 text

AZURE KEY VAULT - HOW TO USE VAULT CREATE THE KEY VAULT COMPUTE (AND KEYS) C A S I N O

Slide 18

Slide 18 text

AZURE KEY VAULT - HOW TO USE VAULT SETUP DOTNET CORE CONSOLE APP COMPUTE (AND KEYS) C A S I N O

Slide 19

Slide 19 text

AZURE KEY VAULT - HOW TO USE VAULT USAGE FROM DOTNET CORE CONSOLE APP COMPUTE (AND KEYS) C A S I N O

Slide 20

Slide 20 text

AZURE KEY VAULT - WHAT ELSE ▸ Monitor access and use ▸ APIs for sign/verify/encrypt ▸ Soft delete capability; purge later COMPUTE (AND KEYS) C A S I N O

Slide 21

Slide 21 text

IDENTITY AND ACCESS MANAGEMENT ▸ Azure Active Directory ▸ Role-based access control (RBAC) IDENTITY AND ACCESS MANAGEMENT C A S I N O

Slide 22

Slide 22 text

BEST PRACTICE : OPTIMISE IDENTITY AND ACCESS MANAGEMENT Centralise identity management, Use role-based access control. IDENTITY AND ACCESS MANAGEMENT C A S I N O

Slide 23

Slide 23 text

AZURE ACTIVE DIRECTORY (AD) - DEFINITION IDENTITY AND ACCESS MANAGEMENT C A S I N O

Slide 24

Slide 24 text

AZURE ACTIVE DIRECTORY (AD) - USE CASES - RIGHTS TO USERS ‣ admin/owner gives rights for access azure resources to users; e.g. on resource groups, or on storage account IDENTITY AND ACCESS MANAGEMENT C A S I N O

Slide 25

Slide 25 text

AZURE ACTIVE DIRECTORY (AD) - USE CASES - RIGHTS TO EXTERNAL APPS ‣ admin/owner gives rights for access resources to external applications like TFS/Azure Pipeline (access Azure resources from your CI/CD pipeline) ‣ … Using an already created Service Principal IDENTITY AND ACCESS MANAGEMENT C A S I N O

Slide 26

Slide 26 text

AZURE ACTIVE DIRECTORY (AD) - USE CASES - RIGHTS TO EXTERNAL APPS ‣ admin/owner gives rights for access resources to external applications like TFS/Azure Pipeline (access Azure resources from your CI/CD pipeline) ‣ … Using an already created Service Principal ‣ Or creating a new one IDENTITY AND ACCESS MANAGEMENT C A S I N O

Slide 27

Slide 27 text

AZURE ACTIVE DIRECTORY (AD) - USE CASES - RIGHTS TO AD APPS ‣ admin/owner gives rights for access resources to apps or services from Azure; e.g. access Azure Key Vault from an app service or azure function ‣ … Using a “managed service identity” - each service has its own identity IDENTITY AND ACCESS MANAGEMENT C A S I N O

Slide 28

Slide 28 text

AZURE ACTIVE DIRECTORY (AD) - USE CASES - RIGHTS TO AD APPS ‣ admin/owner gives rights for access resources to apps or services from Azure; e.g. access Azure Key Vault from an app service or azure function ‣ … Using a “managed service identity” - each service has its own identity IDENTITY AND ACCESS MANAGEMENT C A S I N O

Slide 29

Slide 29 text

AZURE ACTIVE DIRECTORY (AD) - ANOTHER USE CASE ▸ As a developer want to use it in my code… IDENTITY AND ACCESS MANAGEMENT C A S I N O

Slide 30

Slide 30 text

AZURE ACTIVE DIRECTORY (AD) - MICROSOFT IDENTITY PLATFORM ▸ formerly Azure Active Directory for developers ▸ Programmer’s heaven: ▸ How to "Build a single-page app”, “Build a protected web API”, “Build a daemon app that calls web APIs” ▸ How to “Build a customer-facing app that signs in social & local identities” IDENTITY AND ACCESS MANAGEMENT C A S I N O

Slide 31

Slide 31 text

AZURE ACTIVE DIRECTORY (AD) - MICROSOFT IDENTITY PLATFORM ▸ formerly Azure Active Directory for developers ▸ Programmer’s heaven: ▸ How to "Build a single-page app”, “Build a protected web API”, “Build a daemon app that calls web APIs” ▸ How to “Build a customer-facing app that signs in social & local identities” IDENTITY AND ACCESS MANAGEMENT C A S I N O

Slide 32

Slide 32 text

RBAC - ROLE BASED ACCESS CONTROL IDENTITY AND ACCESS MANAGEMENT C A S I N O

Slide 33

Slide 33 text

STORAGE & DATA ▸ Encryption in Transit ▸ Encryption at Rest ▸ Client-Side Encryption ▸ Storage analytics ▸ Role-Based Access Control (RBAC) ▸ Shared Access Signature STORAGE & DATA C A S I N O

Slide 34

Slide 34 text

BEST PRACTICE : PROTECT YOUR DATA BY USING ENCRYPTION Azure SQL Database transparent data encryption helps protect data on disk and protects against unauthorised access to hardware. STORAGE & DATA C A S I N O

Slide 35

Slide 35 text

▸ How is it protected? ▸ Security practice to follow: protect data at rest, protect data in transit, in use ▸ Same for SQL Server AZURE SQL STORAGE & DATA C A S I N O

Slide 36

Slide 36 text

TRANSPARENT DATA ENCRYPTION (ENCRYPTION-AT-REST) ▸ Protects data at rest ▸ It solves the risk of physical device being stolen ▸ Enabled by default for new databases ▸ No code to be changed STORAGE & DATA C A S I N O

Slide 37

Slide 37 text

TRANSPARENT DATA ENCRYPTION (ENCRYPTION-AT-REST) ▸ 2 options for choosing the encryption key ▸ Service managed key ▸ Customer managed key (from Key Vault) - BYOK STORAGE & DATA C A S I N O

Slide 38

Slide 38 text

TRANSPORT LAYER SECURITY TLS (ENCRYPTION-IN-TRANSIT) ▸ Use “encrypt=true;trustservercerti fi cate=false” in connection string STORAGE & DATA C A S I N O

Slide 39

Slide 39 text

ALWAYS ENCRYPTED (ENCRYPTION-IN-USE) ▸ Data is encrypted on client side ▸ Protect sensitive data stored in speci fi c database columns from being access by admins (for example, credit card numbers, national identi fi cation numbers) ▸ The encryption key is never exposed to SQL and can be stored either in the Windows Certi fi cate Store or in Azure Key Vault. STORAGE & DATA C A S I N O

Slide 40

Slide 40 text

ALWAYS ENCRYPTED (ENCRYPTION-IN-USE) - INITIAL SETUP ▸ With SSMS or Powershell ▸ Select Columns to be encrypted ▸ Have Master Key - stored in Azure Vault or Certi fi cate Store STORAGE & DATA C A S I N O

Slide 41

Slide 41 text

ALWAYS ENCRYPTED (ENCRYPTION-IN-USE) - INITIAL SETUP ▸ With SSMS or Powershell ▸ Select Columns to be encrypted ▸ Have Master Key - stored in Azure Vault or Certi fi cate Store STORAGE & DATA C A S I N O

Slide 42

Slide 42 text

ALWAYS ENCRYPTED (ENCRYPTION-IN-USE) - INITIAL SETUP ▸ With SSMS or Powershell ▸ Select Columns to be encrypted ▸ Have Master Key - stored in Azure Vault or Certi fi cate Store STORAGE & DATA C A S I N O

Slide 43

Slide 43 text

ALWAYS ENCRYPTED (ENCRYPTION-IN-USE) - INITIAL SETUP ▸ What gets created in the end ▸ How does data look like encrypted STORAGE & DATA C A S I N O

Slide 44

Slide 44 text

ALWAYS ENCRYPTED (ENCRYPTION-IN-USE) - CODE CHANGES ▸ Use “Column Encryption Setting=Enabled” in connection string STORAGE & DATA C A S I N O

Slide 45

Slide 45 text

ALWAYS ENCRYPTED (ENCRYPTION-IN-USE) - CODE CHANGES ▸ Init KeyVault for Always Encrypted STORAGE & DATA C A S I N O

Slide 46

Slide 46 text

ALWAYS ENCRYPTED (ENCRYPTION-IN-USE) - DOWNSIDES ▸ Not all queries are supported - those which requires some sql engine processing such as “LIKE” query ▸ e.g. 1 - like ▸ e.g. 2 - assign ▸ Can use EF, however for code fi rst, you still need to do initial setup STORAGE & DATA C A S I N O

Slide 47

Slide 47 text

▸ Q: Can it be used from App Service? ▸ A: Yes, check https://github.com/microsoft/azure-sql- security-sample ALWAYS ENCRYPTED (ENCRYPTION-IN-USE) - WHAT ELSE? STORAGE & DATA C A S I N O

Slide 48

Slide 48 text

NETWORKING ▸ Network Security Groups (NSG) ▸ Azure Virtual Network ▸ VPN Gateway ▸ Application Gateway ▸ Web Application Firewall ▸ Traf fi c Manager ▸ Azure Load Balancer ▸ Azure Security Center NETWORKING C A S I N O

Slide 49

Slide 49 text

FEW BEST PRACTICES ▸ Optimise uptime and performance - using a load balancer (Application Gateway, Traf fi c Manager, or internal Load balancer) ▸ Disable RDP/SSH access to virtual machines NETWORKING C A S I N O

Slide 50

Slide 50 text

NETWORKING C A S I N O

Slide 51

Slide 51 text

APPLICATION ▸ Web Application vulnerability scanning ▸ Penetration testing ▸ Web Application fi rewall ▸ Authentication and authorization in Azure App Service ▸ Layered Security Architecture ▸ Web server diagnostics and application diagnostics APPLICATION C A S I N O

Slide 52

Slide 52 text

FEW BEST PRACTICES ▸ Use Web Application fi rewall is based on OWAS core set list of vulnerabilities APPLICATION C A S I N O

Slide 53

Slide 53 text

APPLICATION FEW BEST PRACTICES ▸ Regularly run tools for vulnerability scanning (TinFoil) APPLICATION C A S I N O

Slide 54

Slide 54 text

APPLICATION FEW BEST PRACTICES ▸ Layered Security Architecture APPLICATION C A S I N O

Slide 55

Slide 55 text

APPLICATION FEW BEST PRACTICES ▸ Have webserver/application diagnostics logging enabled APPLICATION C A S I N O

Slide 56

Slide 56 text

OPERATIONS ▸ Security and Audit Dashboard ▸ Azure Resource Manager ▸ Application Insights ▸ Azure Monitor ▸ Azure Monitor Logs ▸ Azure Advisor ▸ Azure Security Center OPERATIONS C A S I N O

Slide 57

Slide 57 text

BEST PRACTICE : AUTOMATE THE BUILD AND DEPLOYMENT OF SERVICES. Infrastructure as code is a set of techniques and practices that help IT pros remove the burden of day-to-day build and management of modular infrastructure. It enables IT pros to build and maintain their modern server. OPERATIONS C A S I N O

Slide 58

Slide 58 text

ARM - AZURE RESOURCE MANAGER ▸ You can use Azure Resource Manager to provision your applications by using a declarative template. ▸ In a single template, you can deploy multiple services along with their dependencies. You use the same template to repeatedly deploy your application in every stage of the application lifecycle. ▸ Repeatable deployments (no human errors) OPERATIONS C A S I N O

Slide 59

Slide 59 text

MONITOR THE PERFORMANCE OF YOUR APPLICATIONS Monitoring is the act of collecting and analysing data to determine the performance, health, and availability of your application. An effective monitoring strategy helps you understand the detailed operation of the components of your application. It helps you increase your uptime by notifying you of critical issues so that you can resolve them before they become problems. It also helps you detect anomalies that might be security related. OPERATIONS C A S I N O

Slide 60

Slide 60 text

APPLICATION INSIGHTS ▸ monitor live web applications ▸ automatically detects performance anomalies ▸ includes powerful analytics tools to help you diagnose issues and to understand what users actually do with your app OPERATIONS C A S I N O

Slide 61

Slide 61 text

CASE STUDY INITIAL SETUP

Slide 62

Slide 62 text

CASE STUDY COMPUTE & ENCRYPT

Slide 63

Slide 63 text

CASE STUDY IDENTITY

Slide 64

Slide 64 text

CASE STUDY STORAGE AND DATA

Slide 65

Slide 65 text

CASE STUDY NETWORKING

Slide 66

Slide 66 text

CASE STUDY APPLICATION

Slide 67

Slide 67 text

CASE STUDY OPERATIONS

Slide 68

Slide 68 text

CASE STUDY FINAL

Slide 69

Slide 69 text

END CONCLUSIONS / TAKEAWAYS ▸ I hope you’ve learned something new about security capabilities/ tools from azure ▸ You can grasp the security capabilities easily now (remember - casino) ▸ and… most of the security best practices are already there

Slide 70

Slide 70 text

END QUESTIONS ?

Slide 71

Slide 71 text

END THANK YOU !