Git Product home page Git Product logo

azure-appservice-security's Introduction

Azure App Service Security

Implementation of Azure App Service security features.

Create the infrastructure:

terraform init
terraform apply -auto-approve

Next, approve the Private Endpoint created by Front Door on behalf of App Service.

Access Restriction

Controls inbound connectivity. Functionality available when Public Access is set to TRUE.

Access can be controlled to the main site and the SCM (Advanced). Advanced can inherit rules from main.

This Terraform configuration will set up automatically ALLOW for:

  • Service Tag: AzureFrontDoor.Backend
  • HTTP Header: X-Azure-FDID

Do set Deny as the unmatched rule:

az resource update --resource-group rg-bigfactory --name app-bigfactory --resource-type "Microsoft.Web/sites" \
    --set properties.siteConfig.ipSecurityRestrictionsDefaultAction=Deny

Service Endpoints

It is possible to use the Azure backbone to access an App Service from a VM or other services.

This Terraform project automatically configures Microsoft.Web service endpoints for the VM subnet. Running Network Watcher will give the "next hop type" VirtualNetworkServiceEndpoint.

When removing the service endpoint, the next hop type will be Internet.

Private Endpoints

Couple of benefits:

  • Avoid public endpoints
  • Minimize the possibility of data exfiltration
  • On-premises

Set create_private_endpoint_flag to true to enable the private endpoint:

create_private_endpoint_flag = true

Front Door latency benchmark

This project will create three apps to measure differences in latency:

  • App 1 - AFD route with public endpoint.
  • App 2 - AFD route with private endpoint.
  • App 3 - No AFD, direct connection to the public endpoint.
export acr="crbigfactory"

Build and push the custom application:

cd app
bash acr-build-push.bash

Back to the root directory, change the configuration to pull from ACR:

webapp_deploy_from_acr = true

Apply:

terraform apply -auto-approve

Test the routes and measure the latency.

Virtual Network Integration

Only one VNET injection is supported.


Clean-up

Once done, delete the resources:

terraform destroy -auto-approve

azure-appservice-security's People

Contributors

epomatti avatar

Stargazers

 avatar

Watchers

 avatar  avatar

azure-appservice-security's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.