diff --git a/src/ApiService/ApiService/Functions/NodeAddSshKey.cs b/src/ApiService/ApiService/Functions/NodeAddSshKey.cs index ae8ac9c29..5a5fe058a 100644 --- a/src/ApiService/ApiService/Functions/NodeAddSshKey.cs +++ b/src/ApiService/ApiService/Functions/NodeAddSshKey.cs @@ -46,7 +46,7 @@ public class NodeAddSshKey { } - [Function("node_add_ssh_key")] + [Function("NodeAddSshKey")] public Async.Task Run([HttpTrigger(AuthorizationLevel.Anonymous, "POST", Route = "node/add_ssh_key")] HttpRequestData req) { return _auth.CallIfUser(req, r => r.Method switch { "POST" => Post(r), diff --git a/src/ApiService/ApiService/Functions/Proxy.cs b/src/ApiService/ApiService/Functions/Proxy.cs index eb80ec08b..df65794d1 100644 --- a/src/ApiService/ApiService/Functions/Proxy.cs +++ b/src/ApiService/ApiService/Functions/Proxy.cs @@ -16,7 +16,7 @@ public class Proxy { _context = context; } - [Function("proxy")] + [Function("Proxy")] public Async.Task Run([HttpTrigger(AuthorizationLevel.Anonymous, "GET", "PATCH", "POST", "DELETE")] HttpRequestData req) { return _auth.CallIfUser(req, r => r.Method switch { "GET" => Get(r), diff --git a/src/ApiService/ApiService/Functions/ReproVmss.cs b/src/ApiService/ApiService/Functions/ReproVmss.cs index 790359ee5..a5385746e 100644 --- a/src/ApiService/ApiService/Functions/ReproVmss.cs +++ b/src/ApiService/ApiService/Functions/ReproVmss.cs @@ -15,8 +15,8 @@ public class ReproVmss { _context = context; } - [Function("repro_vms")] - public Async.Task Run([HttpTrigger(AuthorizationLevel.Anonymous, "GET", "POST", "DELETE")] HttpRequestData req) { + [Function("ReproVms")] + public Async.Task Run([HttpTrigger(AuthorizationLevel.Anonymous, "GET", "POST", "DELETE", Route = "repro_vms")] HttpRequestData req) { return _auth.CallIfUser(req, r => r.Method switch { "GET" => Get(r), "POST" => Post(r), diff --git a/src/ApiService/ApiService/Functions/WebhookLogs.cs b/src/ApiService/ApiService/Functions/WebhookLogs.cs index c50cdd6c3..cbed30d08 100644 --- a/src/ApiService/ApiService/Functions/WebhookLogs.cs +++ b/src/ApiService/ApiService/Functions/WebhookLogs.cs @@ -15,7 +15,7 @@ public class WebhookLogs { _context = context; } - [Function("Webhook_logs")] + [Function("WebhookLogs")] public Async.Task Run( [HttpTrigger(AuthorizationLevel.Anonymous, "POST", Route = "webhooks/logs")] HttpRequestData req) { return _auth.CallIfUser(req, r => r.Method switch { diff --git a/src/ApiService/ApiService/Functions/WebhookPing.cs b/src/ApiService/ApiService/Functions/WebhookPing.cs index ab30cc02b..e73fe9f81 100644 --- a/src/ApiService/ApiService/Functions/WebhookPing.cs +++ b/src/ApiService/ApiService/Functions/WebhookPing.cs @@ -15,7 +15,7 @@ public class WebhookPing { _context = context; } - [Function("Webhook_ping")] + [Function("WebhookPing")] public Async.Task Run( [HttpTrigger(AuthorizationLevel.Anonymous, "POST", Route = "webhooks/ping")] HttpRequestData req) { return _auth.CallIfUser(req, r => r.Method switch { diff --git a/src/deployment/azuredeploy.bicep b/src/deployment/azuredeploy.bicep index 7e2d1e950..e8ac1acc0 100644 --- a/src/deployment/azuredeploy.bicep +++ b/src/deployment/azuredeploy.bicep @@ -278,6 +278,46 @@ module functionSettings 'bicep-templates/function-settings.bicep' = { monitor_account_name: operationalInsights.outputs.monitorAccountName multi_tenant_domain: multi_tenant_domain enable_profiler: enable_profiler + functions_disabled: '0' + agent_function_names: [ + 'AgentCanSchedule' //0 + 'AgentCommands' //1 + 'AgentEvents' //2 + 'AgentRegistration' //3 + 'Containers' //4 + 'Download' //5 + 'Info' //6 + 'InstanceConfig' //7 + 'Jobs' //8 + 'JobTemplates' //9 + 'JobTemplatesManage' //10 + 'Negotiate' //11 + 'Node' //12 + 'NodeAddSshKey' //13 + 'Notifications' //14 + 'Pool' //15 + 'Proxy' //16 + 'QueueFileChanges' //17 + 'QueueNodeHeartbeat' //18 + 'QueueProxyUpdate' //19 + 'QueueSignalrEvents' //20 + 'QueueTaskHeartbeat' //21 + 'QueueUpdates' //22 + 'QueueWebhooks' //23 + 'ReproVms' //24 + 'Scaleset' //25 + 'Tasks' //26 + 'TimerDaily' //27 + 'TimerProxy' //28 + 'TimerRepro' //29 + 'TimerRetention' //30 + 'TimerTasks' //31 + 'TimerWorkers' //32 + 'Tools' //33 + 'Webhooks' //34 + 'WebhooksLogs' //35 + 'WebhooksPing' //36 + ] } dependsOn: [ function @@ -304,6 +344,46 @@ module netFunctionSettings 'bicep-templates/function-settings.bicep' = { monitor_account_name: operationalInsights.outputs.monitorAccountName multi_tenant_domain: multi_tenant_domain enable_profiler: enable_profiler + functions_disabled: '1' + agent_function_names: [ + 'AgentCanSchedule' //0 + 'AgentCommands' //1 + 'AgentEvents' //2 + 'AgentRegistration' //3 + 'Containers' //4 + 'Download' //5 + 'Info' //6 + 'InstanceConfig' //7 + 'Jobs' //8 + 'JobTemplates' //9 + 'JobTemplatesManage' //10 + 'Negotiate' //11 + 'Node' //12 + 'NodeAddSshKey' //13 + 'Notifications' //14 + 'Pool' //15 + 'Proxy' //16 + 'QueueFileChanges' //17 + 'QueueNodeHeartbeat' //18 + 'QueueProxyUpdate' //19 + 'QueueSignalrEvents' //20 + 'QueueTaskHeartbeat' //21 + 'QueueUpdates' //22 + 'QueueWebhooks' //23 + 'ReproVms' //24 + 'Scaleset' //25 + 'Tasks' //26 + 'TimerDaily' //27 + 'TimerProxy' //28 + 'TimerRepro' //29 + 'TimerRetention' //30 + 'TimerTasks' //31 + 'TimerWorkers' //32 + 'Tools' //33 + 'Webhooks' //34 + 'WebhookLogs' //35 + 'WebhookPing' //36 + ] } dependsOn: [ netFunction diff --git a/src/deployment/bicep-templates/function-settings-disabled-apps.bicep b/src/deployment/bicep-templates/function-settings-disabled-apps.bicep index 20e13059d..7c3767b12 100644 --- a/src/deployment/bicep-templates/function-settings-disabled-apps.bicep +++ b/src/deployment/bicep-templates/function-settings-disabled-apps.bicep @@ -5,10 +5,10 @@ param allFunctions array var disabledFunctions = [for f in allFunctions: 'AzureWebJobs.${f}.Disabled' ] var disabledFunctionsAppSettings = { - '${disabledFunctions[0]}' : functions_disabled_setting - '${disabledFunctions[1]}' : functions_disabled_setting - '${disabledFunctions[2]}' : functions_disabled_setting - '${disabledFunctions[3]}' : functions_disabled_setting + '${disabledFunctions[0]}' : 0 + '${disabledFunctions[1]}' : 0 + '${disabledFunctions[2]}' : 0 + '${disabledFunctions[3]}' : 0 '${disabledFunctions[4]}' : functions_disabled_setting '${disabledFunctions[5]}' : functions_disabled_setting diff --git a/src/deployment/bicep-templates/function-settings.bicep b/src/deployment/bicep-templates/function-settings.bicep index 048796469..af42bb629 100644 --- a/src/deployment/bicep-templates/function-settings.bicep +++ b/src/deployment/bicep-templates/function-settings.bicep @@ -26,14 +26,27 @@ param monitor_account_name string param functions_worker_runtime string param functions_extension_version string +param agent_function_names array +param functions_disabled string + param enable_profiler bool +var disabledFunctionName = 'disabledFunctions-${name}' + var telemetry = 'd7a73cf4-5a1a-4030-85e1-e5b25867e45a' resource function 'Microsoft.Web/sites@2021-02-01' existing = { name: name } +module disabledFunctions 'function-settings-disabled-apps.bicep' = { + name: disabledFunctionName + params:{ + functions_disabled_setting: functions_disabled + allFunctions: agent_function_names + } +} + var enable_profilers = enable_profiler ? { APPINSIGHTS_PROFILERFEATURE_VERSION : '1.0.0' DiagnosticServices_EXTENSION_VERSION: '~3' @@ -63,5 +76,5 @@ resource functionSettings 'Microsoft.Web/sites/config@2021-03-01' = { ONEFUZZ_KEYVAULT: keyvault_name ONEFUZZ_OWNER: owner ONEFUZZ_CLIENT_SECRET: client_secret - }, enable_profilers) + }, disabledFunctions.outputs.appSettings, enable_profilers) } diff --git a/src/integration-tests/integration-test.py b/src/integration-tests/integration-test.py index d06ecff45..354cd3754 100755 --- a/src/integration-tests/integration-test.py +++ b/src/integration-tests/integration-test.py @@ -1247,4 +1247,4 @@ def main() -> int: if __name__ == "__main__": - sys.exit(main()) + sys.exit(main()) \ No newline at end of file