Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Henry Been - Secure Deployments - Keeping your ...

Avatar for Alfred Alfred
December 11, 2018

Henry Been - Secure Deployments - Keeping your application secrets private

As Henry presented at the Amsterdam Secure Software Development Meetup on Dec 11th, 2018

Avatar for Alfred

Alfred

December 11, 2018

More Decks by Alfred

Other Decks in Technology

Transcript

  1. WONDERING WHO IS THAT GUY? HENRY BEEN Independent Devops &

    Azure Architect E: [email protected] T: @henry_been L: linkedin.com/in/henrybeen W: henrybeen.nl
  2. Secret management goals No team member needs production access Frequently

    change secrets Decouple authentication from authorization No secrets in source control
  3. 1. Let operations deploys 2. Enter manually in the portal

    3. Encrypted in source control 4. Use once, obscure https endpoint HOW NOT TO..
  4. USING RELEASE ORCHESTRATOR • Secrets are pretty secure • Easy

    to start with • Fits existing situations • You see and copy secrets • Secrets visible in portal • Duplication of secrets • Cannot roll secrets easily Pros Cons
  5. Prerequisite: Have primary & secondary secrets 1. Change the secret

    in release orchestrator to secondary secret 2. Release 3. Roll primary secret 4. Change the secret in release orchestrator to primary secret 5. Release 6. Roll secondary secret Intermezzo: Roll a secret
  6. USING ARM TEMPLATES • No manual copying or sharing of

    secrets • No more manual duplication of Azure keys • Secrets visible in portal • Still cannot roll secrets easily Pros Cons
  7. HOWTO: Local Development 1. Grant your developer account access to

    (another) Key Vault • Best alternative • Requires your machine to be in the same AD domain 2. Only use Key Vault in Azure (locally use Web.config) • You have to write code to do this (though pretty straightforward) 3. Manually create a development identity and use that • However… do not check secrets into source control
  8. DIRECTLY ACCESS KEY VAULT • No manual copying or sharing

    of secrets • No more duplication of Azure keys • Secrets no longer visible in portal • Changed secrets are automatically picked up • Only available on Azure Web Apps, Azure Functions and DataFactory V2 Pros Cons
  9. DIRECTLY ACCESS SERVICE • No more secrets • Only available

    on Azure Web Apps, Azure Functions and DataFactory V2 • Only on supported services Pros Cons
  10. Supported services • Azure Resource Manager • Azure Key Vault

    • Azure Data Lake • Azure SQL DB • Azure Event Hubs • Azure Service Bus • Azure Storage https://docs.microsoft.com/en-us/azure/active-directory/managed-service-identity/services-support-msi
  11. Runtime AppSettings App.config ConfigBuilders Approach 5 CONFIG BUILDERS Requires: •

    (.NET Framework ≥ 4.7.1 &&.NET Framework 4.7.1 Development Tools) || ASP.NET Core 2.0
  12. Premade config builders • EnvironmentConfigBuilder • UserSecretsConfigBuilder • AzureKeyVaultConfigBuilder •

    KeyPerFileConfigBuilder • SimpleJsonConfigBuilder • Extensible interface to plug in your own! https://docs.microsoft.com/en-us/azure/active-directory/managed-service-identity/services-support-msi
  13. Use your release orchestrator Manual deployment NEVER EVER EVUHRR When

    you deploy only code Keyvault and ARM templates When you also deploy infra Application identity / KeyVault When available & possible Application identity / Oauth resource When available & possible WHAT TO USE WHEN? Config builders When available & possible
  14. DO TRY THIS AT HOME! HENRY BEEN Independent Devops &

    Azure Architect E: [email protected] T: @henry_been L: linkedin.com/in/henrybeen W: henrybeen.nl