Control: Ensure that 'PHP version' is the latest, if used as a part of the WEB app
Description
Periodically, newer versions are released for PHP software either due to security flaws or to include additional functionality. Using the latest PHP version for web apps is recommended in order to take advantage of security fixes, if any, and/or new functionalities of the latest version. Currently, this policy only applies to Linux web apps.
Usage
Run the control in your terminal:
powerpipe control run terraform_azure_compliance.control.appservice_web_app_latest_php_versionSnapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run terraform_azure_compliance.control.appservice_web_app_latest_php_version --shareSQL
This control uses a named query:
select  address as resource,  case    when (attributes_std -> 'site_config') is null then 'alarm'    when (attributes_std -> 'site_config' ->> 'linux_fx_version')::text not like 'PHP%' then 'ok'    when (attributes_std -> 'site_config' ->> 'linux_fx_version')::text = 'PYTHON|3.9' then 'ok'    else 'alarm'  end status,  split_part(address, '.', 2) || case    when (attributes_std -> 'site_config') is null then ' ''site_config'' not defined'    when (attributes_std -> 'site_config' ->> 'linux_fx_version')::text not like 'PHP%' then' not using php version'    when (attributes_std -> 'site_config' ->> 'linux_fx_version')::text = 'PHP|8.0' then ' using the latest php version'    else ' not using latest php version'  end || '.' reason    , path || ':' || start_linefrom  terraform_resourcewhere  type = 'azurerm_app_service';