Description
Set https_only to true in azure_rm_webapp to redirect the app’s HTTP requests to HTTPS.
Potential impact
The first HTTP request travels in plaintext. Login details or user input sent with it can be exposed or altered before the redirect.
Remediation
Use HTTPS from the start in user-facing links and client URLs. Test the redirect with an HTTP request that carries no sensitive data and verify that HTTPS succeeds with a valid certificate on your custom domain.
Examples
Both Ansible tasks target the same Windows app and change only https_only. Configure certificate bindings and deploy the application separately.
Before
yaml
- name: Web App 생성
azure_rm_webapp:
resource_group: myResourceGroup
name: myWinWebapp
https_only: false
plan:
resource_group: myAppServicePlan_rg
name: myAppServicePlan
is_linux: false
sku: S1
After
yaml
- name: Web App 생성
azure_rm_webapp:
resource_group: myResourceGroup
name: myWinWebapp
https_only: true
plan:
resource_group: myAppServicePlan_rg
name: myAppServicePlan
is_linux: false
sku: S1