Control: 9.10 Ensure FTP deployments are disabled
Description
By default, Azure Functions, Web and API Services can be deployed over FTP. If FTP is required for an essential deployment workflow, FTPS should be required for FTP login for all App Service Apps and Functions. Azure FTP deployment endpoints are public.
An attacker listening to traffic on a wifi network used by a remote employee or a corporate network could see login traffic in clear- text which would then grant them full control of the code base of the app or service. This finding is more severe if User Credentials for deployment are set at the subscription level rather than using the default Application Credentials which are unique per App.
Remediation
From Console
For Web Apps:
- Login to Azure Portal and go to 
App Services. - Click on each App.
 - Under 
Settingssection, click onConfiguration. - Go to 
General settingstab. - Under 
Platform settings, selectFTP statetoDisabledorFTPS only. - Click 
Save. 
For Function Apps:
- Login to Azure Portal and go to 
Function App. - Click on each App.
 - Under 
Settingssection, click onConfiguration. - Go to 
General settingstab. - Under 
Platform settings, selectFTP statetoDisabledorFTPS only. - Click 
Save. 
Usage
Run the control in your terminal:
powerpipe control run azure_compliance.control.cis_v140_9_10Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run azure_compliance.control.cis_v140_9_10 --shareSQL
This control uses a named query:
select    fa.id as resource,    case      when configuration -> 'properties' ->> 'ftpsState' = 'AllAllowed' then 'alarm'      else 'ok'    end as status,    case      when configuration -> 'properties' ->> 'ftpsState' = 'AllAllowed' then name || ' FTP deployments enabled.'      else name || ' FTP deployments disabled.'    end as reason    , fa.resource_group as resource_group  , sub.display_name as subscription  from    azure_app_service_function_app fa,    azure_subscription sub  where    sub.subscription_id = fa.subscription_idunion  select    wa.id as resource,    case      when configuration -> 'properties' ->> 'ftpsState' = 'AllAllowed' then 'alarm'      else 'ok'    end as status,    case      when configuration -> 'properties' ->> 'ftpsState' = 'AllAllowed' then name || ' FTP deployments enabled.'      else name || ' FTP deployments disabled.'    end as reason    , wa.resource_group as resource_group  , sub.display_name as subscription  from    azure_app_service_web_app as wa    left join azure_subscription as sub on sub.subscription_id = wa.subscription_id;