Azure / Azure/azure-functions-core-tools

Interop+Crypto+OpenSslCryptographicException when FIPS 140-2 Enabled

Open
#3,144 0 comments 0 reactions 0 assignees View on GitHub
investigate
Dominant language
C#
Stars
1.5k
Forks
498
Avg merge
5d 4h
Merged PRs (30d)
15

Description

When running a simple stateful Logic App (Standard) workflow with Azure Function Core Tools 4.0.4736 on Ubuntu Pro 20.04 with FIPS 140-2 enabled causes the following exception (trace below). The same workflow runs successfully when FIPS is disabled.

```
Interop+Crypto+OpenSslCryptographicException: error:060800C8:digital envelope routines:EVP_DigestInit_ex:disabled for FIPS
```

Might this error be related to MD5 not being FIPS compliant? Is there a way to run a workflow on Ubuntu with FIPS 140-2 enabled and without disabling/modifying environment controls, possibly using a different hashing algorithm? Thank you.

**Environment**
Azure Functions Core Tools 4.0.4736
Azurite 3.16.0
Ubuntu 20.04 (Azure VM), plan pro-20_04-gen2
GitHub self-hosted runner

```json
{
"version": "2.0",
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle.Workflows",
"version": "[1.*, 2.0.0)"
},
"logging": {
"fileLoggingMode": "always",
"logLevel": {
"default": "Trace"
}
}
}
```

```json
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "node"
}
}
```
```
[2022-09-06T18:44:59.156Z] Incoming HTTP request succeeded: correlationId='84b0d3a8-3371-4328-9018-8790de92946d', authorizationSource='Management', authorizationAction='', operationName='POST/API/MANAGEMENT/WORKFLOWS/TRIGGERS/LISTCALLBACKURL', httpMethod='post', hostName='ubunturunner01', targetUri='http://ubunturunner01:7071/runtime/webhooks/workflow/api/management/workflows/test-workflow/triggers/manual/listCallbackUrl?api-version=2019-10-01-edge-preview', userAgent='curl/7.68.0', clientRequestId='', clientSessionId='', clientIpAddress='', clientApplicationId='', apiVersion='2019-10-01-edge-preview', contentLength='-1', serviceRequestId=':84b0d3a8-3371-4328-9018-8790de92946d', durationInMilliseconds='73', httpStatusCode='200', exceptionMessage='', errorCode='', failureCause='', errorMessage='', referer='', commandName='', parameterSetName='', contentType='application/json; charset=utf-8', contentEncoding='', armServiceRequestId='', organizationId='', activityVector='IN', locale='', additionalProperties='', targetResourceProvider='', targetResourceType='', extensionVersion='1.2.7.0', siteName='UNDEFINED_SITE_NAME', slotName='', activityId='84b0d3a8-3371-4328-9018-8790de92946d'.
[2022-09-06T18:44:59.186Z] Executed HTTP request: {
[2022-09-06T18:44:59.186Z] requestId: "e2e0bf09-2eaa-4f3d-a47d-0395eb8d1aed",
[2022-09-06T18:44:59.186Z] identities: "(WebJobsAuthLevel:Admin, WebJobsAuthLevel:Admin)",
[2022-09-06T18:44:59.186Z] status: "200",
[2022-09-06T18:44:59.186Z] duration: "317"
[2022-09-06T18:44:59.186Z] }
[2022-09-06T18:44:59.259Z] Executing HTTP request: {
[2022-09-06T18:44:59.259Z] requestId: "6a0f11f0-f733-430b-80aa-3aa0d75e3bbc",
[2022-09-06T18:44:59.259Z] method: "post",
[2022-09-06T18:44:59.259Z] userAgent: "curl/7.68.0",
[2022-09-06T18:44:59.259Z] uri: "/api/test-workflow/triggers/manual/invoke"
[2022-09-06T18:44:59.259Z] }
[2022-09-06T18:44:59.268Z] Request successfully matched the route with name 'test-workflow' and template 'api/test-workflow/triggers/manual/invoke'
[2022-09-06T18:44:59.320Z] Executing 'Functions.test-workflow' (Reason='This function was programmatically called via the host APIs.', Id=14372122-1dbb-4f53-804c-dc6e6206edf2)
[2022-09-06T18:44:59.354Z] Incoming HTTP request starts: correlationId='5b292b43-a5a8-4bb6-bef1-0bd4857857e0', authorizationSource='', authorizationAction='', operationName='POST/API/TRIGGERS/PATHS/INVOKE', httpMethod='post', hostName='localhost', targetUri='http://localhost:7071/api/test-workflow/triggers/manual/invoke?api-version=2022-05-01&sp=%2ftriggers%2fmanual%2frun&sv=1.0&sig=*sanitized*', userAgent='curl/7.68.0', clientRequestId='', clientSessionId='', clientIpAddress='', clientApplicationId='', apiVersion='2022-05-01', contentLength='-1', serviceRequestId='', durationInMilliseconds='-1', httpStatusCode='-1', exceptionMessage='', errorCode='', failureCause='', errorMessage='', referer='', commandName='', parameterSetName='', contentType='', contentEncoding='', armServiceRequestId='', organizationId='', activityVector='IN', locale='', additionalProperties='', targetResourceProvider='', targetResourceType='', extensionVersion='1.2.7.0', siteName='UNDEFINED_SITE_NAME', slotName='', activityId='5b292b43-a5a8-4bb6-bef1-0bd4857857e0'.
[2022-09-06T18:44:59.379Z] Storage operation completed: correlationId='5b292b43-a5a8-4bb6-bef1-0bd4857857e0', operationName='StorageDataProvider.Find.FlowAccessKey', accountName='devstoreaccount1', resourceType='table', resourceName='flowfa4a3e390f5de0aflowaccesskeys', clientRequestId='1a99eb34-840c-4d40-924c-1974ec564b34', operationStatus='RanToCompletion', durationInMilliseconds='5', exceptionMessage='', requestsStarted='1', requestsCompleted='1', requestsTimedout='0', requestsDetails='[{"httpStatusCode":200,"httpStatusMessage":"OK","serviceRequestID":"dd9cddf5-3e85-4adb-9df5-8fcb6f36be41","startTime":"2022-09-06T18:44:59.3730743Z","endTime":"2022-09-06T18:44:59.3790182Z"}]', organizationId='', activityVector='IN.01', ingressBytes='0', egressBytes='0', additionalProperties='', extensionVersion='1.2.7.0', siteName='UNDEFINED_SITE_NAME', slotName='', activityId='5b292b43-a5a8-4bb6-bef1-0bd4857857e0'.
[2022-09-06T18:44:59.475Z] Debug message: correlationId='5b292b43-a5a8-4bb6-bef1-0bd4857857e0', operationName='POST/API/TRIGGERS/INVOKE', message='Http request failed with ErrorResponseMessageException. HttpStatus: 'InternalServerError', ErrorCode: 'MultipleErrorsOccurred' and Exception: 'Microsoft.Azure.Workflows.Common.ErrorResponses.ErrorResponseMessageException: Multiple errors occurred: ''.
[2022-09-06T18:44:59.475Z] ---> System.AggregateException: One or more errors occurred. (error:060800C8:digital envelope routines:EVP_DigestInit_ex:disabled for FIPS) (error:060800C8:digital envelope routines:EVP_DigestInit_ex:disabled for FIPS)
[2022-09-06T18:44:59.475Z] ---> Interop+Crypto+OpenSslCryptographicException: error:060800C8:digital envelope routines:EVP_DigestInit_ex:disabled for FIPS
[2022-09-06T18:44:59.475Z] at Interop.Crypto.CheckValidOpenSslHandle(SafeHandle handle)
[2022-09-06T18:44:59.475Z] at Internal.Cryptography.HashProviderDispenser.EvpHashProvider..ctor(IntPtr algorithmEvp)
[2022-09-06T18:44:59.475Z] at System.Security.Cryptography.IncrementalHash.CreateHash(HashAlgorithmName hashAlgorithm)
[2022-09-06T18:44:59.475Z] at System.Security.Cryptography.MD5CryptoServiceProvider..ctor()
[2022-09-06T18:44:59.475Z] at Microsoft.WindowsAzure.ResourceStack.Common.Algorithms.ComputeHash.ComputeMd5Hash(Byte[] data)
[2022-09-06T18:44:59.475Z] at Microsoft.Azure.Workflows.Data.Extensions.JTokenExtensions.ToInlineContentLink(JToken content)
[2022-09-06T18:44:59.475Z] at Microsoft.Azure.Workflows.Data.DataProviders.ScaleUnitDataProvider.UploadFlowOperationContent(String flowId, String flowContentSequenceId, JToken content, String blobKeyPrefix, Boolean canInlineContent, Nullable`1 maxInliningCharacterLimit)
[2022-09-06T18:44:59.475Z] at Microsoft.Azure.Workflows.Data.DataProviders.ScaleUnitDataProvider.UploadFlowTriggerContent(String flowId, String flowContentSequenceId, JToken content, Boolean canInlineContent)
[2022-09-06T18:44:59.475Z] --- End of inner exception stack trace ---
[2022-09-06T18:44:59.475Z] ---> (Inner Exception #1) Interop+Crypto+OpenSslCryptographicException: error:060800C8:digital envelope routines:EVP_DigestInit_ex:disabled for FIPS
[2022-09-06T18:44:59.475Z] at Interop.Crypto.CheckValidOpenSslHandle(SafeHandle handle)
[2022-09-06T18:44:59.475Z] at Internal.Cryptography.HashProviderDispenser.EvpHashProvider..ctor(IntPtr algorithmEvp)
[2022-09-06T18:44:59.475Z] at System.Security.Cryptography.IncrementalHash.CreateHash(HashAlgorithmName hashAlgorithm)
[2022-09-06T18:44:59.475Z] at System.Security.Cryptography.MD5CryptoServiceProvider..ctor()
[2022-09-06T18:44:59.475Z] at Microsoft.WindowsAzure.ResourceStack.Common.Algorithms.ComputeHash.ComputeMd5Hash(Byte[] data)
[2022-09-06T18:44:59.475Z] at Microsoft.Azure.Workflows.Data.Extensions.JTokenExtensions.ToInlineContentLink(JToken content)
[2022-09-06T18:44:59.475Z] at Microsoft.Azure.Workflows.Data.DataProviders.ScaleUnitDataProvider.UploadFlowOperationContent(String flowId, String flowContentSequenceId, JToken content, String blobKeyPrefix, Boolean canInlineContent, Nullable`1 maxInliningCharacterLimit)
[2022-09-06T18:44:59.475Z] at Microsoft.Azure.Workflows.Data.DataProviders.ScaleUnitDataProvider.UploadFlowTriggerContent(String flowId, String flowContentSequenceId, JToken content, Boolean canInlineContent)<---
[2022-09-06T18:44:59.475Z]
[2022-09-06T18:44:59.475Z] --- End of inner exception stack trace ---'.', exception='Interop+Crypto+OpenSslCryptographicException: error:060800C8:digital envelope routines:EVP_DigestInit_ex:disabled for FIPS
[2022-09-06T18:44:59.476Z] at Interop.Crypto.CheckValidOpenSslHandle(SafeHandle handle)
[2022-09-06T18:44:59.476Z] at Internal.Cryptography.HashProviderDispenser.EvpHashProvider..ctor(IntPtr algorithmEvp)
[2022-09-06T18:44:59.476Z] at System.Security.Cryptography.IncrementalHash.CreateHash(HashAlgorithmName hashAlgorithm)
[2022-09-06T18:44:59.476Z] at System.Security.Cryptography.MD5CryptoServiceProvider..ctor()
[2022-09-06T18:44:59.476Z] at Microsoft.WindowsAzure.ResourceStack.Common.Algorithms.ComputeHash.ComputeMd5Hash(Byte[] data)
[2022-09-06T18:44:59.476Z] at Microsoft.Azure.Workflows.Data.Extensions.JTokenExtensions.ToInlineContentLink(JToken content)
[2022-09-06T18:44:59.476Z] at Microsoft.Azure.Workflows.Data.DataProviders.ScaleUnitDataProvider.UploadFlowOperationContent(String flowId, String flowContentSequenceId, JToken content, String blobKeyPrefix, Boolean canInlineContent, Nullable`1 maxInliningCharacterLimit)
[2022-09-06T18:44:59.476Z] at Microsoft.Azure.Workflows.Data.DataProviders.ScaleUnitDataProvider.UploadFlowTriggerContent(String flowId, String flowContentSequenceId, JToken content, Boolean canInlineContent)', organizationId='', activityVector='IN.02', additionalProperties='', extensionVersion='1.2.7.0', siteName='UNDEFINED_SITE_NAME', slotName='', activityId='5b292b43-a5a8-4bb6-bef1-0bd4857857e0'.
[2022-09-06T18:44:59.479Z] Error message: correlationId='5b292b43-a5a8-4bb6-bef1-0bd4857857e0', operationName='POST/API/TRIGGERS/INVOKE', message='Http request failed with unhandled exception of type 'OpenSslCryptographicException' and message: 'Interop+Crypto+OpenSslCryptographicException: error:060800C8:digital envelope routines:EVP_DigestInit_ex:disabled for FIPS
[2022-09-06T18:44:59.479Z] at Interop.Crypto.CheckValidOpenSslHandle(SafeHandle handle)
[2022-09-06T18:44:59.479Z] at Internal.Cryptography.HashProviderDispenser.EvpHashProvider..ctor(IntPtr algorithmEvp)
[2022-09-06T18:44:59.479Z] at System.Security.Cryptography.IncrementalHash.CreateHash(HashAlgorithmName hashAlgorithm)
[2022-09-06T18:44:59.479Z] at System.Security.Cryptography.MD5CryptoServiceProvider..ctor()
[2022-09-06T18:44:59.479Z] at Microsoft.WindowsAzure.ResourceStack.Common.Algorithms.ComputeHash.ComputeMd5Hash(Byte[] data)
[2022-09-06T18:44:59.479Z] at Microsoft.Azure.Workflows.Data.Extensions.JTokenExtensions.ToInlineContentLink(JToken content)
[2022-09-06T18:44:59.479Z] at Microsoft.Azure.Workflows.Data.DataProviders.ScaleUnitDataProvider.UploadFlowOperationContent(String flowId, String flowContentSequenceId, JToken content, String blobKeyPrefix, Boolean canInlineContent, Nullable`1 maxInliningCharacterLimit)
[2022-09-06T18:44:59.479Z] at Microsoft.Azure.Workflows.Data.DataProviders.ScaleUnitDataProvider.UploadFlowTriggerContent(String flowId, String flowContentSequenceId, JToken content, Boolean canInlineContent)'.', exception='Interop+Crypto+OpenSslCryptographicException: error:060800C8:digital envelope routines:EVP_DigestInit_ex:disabled for FIPS
[2022-09-06T18:44:59.479Z] at Interop.Crypto.CheckValidOpenSslHandle(SafeHandle handle)
[2022-09-06T18:44:59.479Z] at Internal.Cryptography.HashProviderDispenser.EvpHashProvider..ctor(IntPtr algorithmEvp)
[2022-09-06T18:44:59.479Z] at System.Security.Cryptography.IncrementalHash.CreateHash(HashAlgorithmName hashAlgorithm)
[2022-09-06T18:44:59.479Z] at System.Security.Cryptography.MD5CryptoServiceProvider..ctor()
[2022-09-06T18:44:59.479Z] at Microsoft.WindowsAzure.ResourceStack.Common.Algorithms.ComputeHash.ComputeMd5Hash(Byte[] data)
[2022-09-06T18:44:59.479Z] at Microsoft.Azure.Workflows.Data.Extensions.JTokenExtensions.ToInlineContentLink(JToken content)
[2022-09-06T18:44:59.479Z] at Microsoft.Azure.Workflows.Data.DataProviders.ScaleUnitDataProvider.UploadFlowOperationContent(String flowId, String flowContentSequenceId, JToken content, String blobKeyPrefix, Boolean canInlineContent, Nullable`1 maxInliningCharacterLimit)
[2022-09-06T18:44:59.479Z] at Microsoft.Azure.Workflows.Data.DataProviders.ScaleUnitDataProvider.UploadFlowTriggerContent(String flowId, String flowContentSequenceId, JToken content, Boolean canInlineContent)', organizationId='', activityVector='IN.02', additionalProperties='', extensionVersion='1.2.7.0', siteName='UNDEFINED_SITE_NAME', slotName='', activityId='5b292b43-a5a8-4bb6-bef1-0bd4857857e0'.
[2022-09-06T18:44:59.483Z] Error message: correlationId='5b292b43-a5a8-4bb6-bef1-0bd4857857e0', operationName='POST/API/TRIGGERS/INVOKE', message='Http request failed with unhandled exception of type 'OpenSslCryptographicException' and message: 'Interop+Crypto+OpenSslCryptographicException: error:060800C8:digital envelope routines:EVP_DigestInit_ex:disabled for FIPS
[2022-09-06T18:44:59.483Z] at Interop.Crypto.CheckValidOpenSslHandle(SafeHandle handle)
[2022-09-06T18:44:59.483Z] at Internal.Cryptography.HashProviderDispenser.EvpHashProvider..ctor(IntPtr algorithmEvp)
[2022-09-06T18:44:59.483Z] at System.Security.Cryptography.IncrementalHash.CreateHash(HashAlgorithmName hashAlgorithm)
[2022-09-06T18:44:59.483Z] at System.Security.Cryptography.MD5CryptoServiceProvider..ctor()
[2022-09-06T18:44:59.483Z] at Microsoft.WindowsAzure.ResourceStack.Common.Algorithms.ComputeHash.ComputeMd5Hash(Byte[] data)
[2022-09-06T18:44:59.483Z] at Microsoft.Azure.Workflows.Data.Extensions.JTokenExtensions.ToInlineContentLink(JToken content)
[2022-09-06T18:44:59.483Z] at Microsoft.Azure.Workflows.Data.DataProviders.ScaleUnitDataProvider.UploadFlowOperationContent(String flowId, String flowContentSequenceId, JToken content, String blobKeyPrefix, Boolean canInlineContent, Nullable`1 maxInliningCharacterLimit)
[2022-09-06T18:44:59.483Z] at Microsoft.Azure.Workflows.Data.DataProviders.ScaleUnitDataProvider.UploadFlowTriggerContent(String flowId, String flowContentSequenceId, JToken content, Boolean canInlineContent)'.', exception='Interop+Crypto+OpenSslCryptographicException: error:060800C8:digital envelope routines:EVP_DigestInit_ex:disabled for FIPS
[2022-09-06T18:44:59.483Z] at Interop.Crypto.CheckValidOpenSslHandle(SafeHandle handle)
[2022-09-06T18:44:59.483Z] at Internal.Cryptography.HashProviderDispenser.EvpHashProvider..ctor(IntPtr algorithmEvp)
[2022-09-06T18:44:59.483Z] at System.Security.Cryptography.IncrementalHash.CreateHash(HashAlgorithmName hashAlgorithm)
[2022-09-06T18:44:59.483Z] at System.Security.Cryptography.MD5CryptoServiceProvider..ctor()
[2022-09-06T18:44:59.483Z] at Microsoft.WindowsAzure.ResourceStack.Common.Algorithms.ComputeHash.ComputeMd5Hash(Byte[] data)
[2022-09-06T18:44:59.483Z] at Microsoft.Azure.Workflows.Data.Extensions.JTokenExtensions.ToInlineContentLink(JToken content)
[2022-09-06T18:44:59.483Z] at Microsoft.Azure.Workflows.Data.DataProviders.ScaleUnitDataProvider.UploadFlowOperationContent(String flowId, String flowContentSequenceId, JToken content, String blobKeyPrefix, Boolean canInlineContent, Nullable`1 maxInliningCharacterLimit)
[2022-09-06T18:44:59.483Z] at Microsoft.Azure.Workflows.Data.DataProviders.ScaleUnitDataProvider.UploadFlowTriggerContent(String flowId, String flowContentSequenceId, JToken content, Boolean canInlineContent)', organizationId='', activityVector='IN.02', additionalProperties='', extensionVersion='1.2.7.0', siteName='UNDEFINED_SITE_NAME', slotName='', activityId='5b292b43-a5a8-4bb6-bef1-0bd4857857e0'.
[2022-09-06T18:44:59.486Z] Incoming HTTP request ends with server failure: correlationId='5b292b43-a5a8-4bb6-bef1-0bd4857857e0', authorizationSource='Direct', authorizationAction='', operationName='POST/API/TRIGGERS/PATHS/INVOKE', httpMethod='post', hostName='localhost', targetUri='http://localhost:7071/api/test-workflow/triggers/manual/invoke?api-version=2022-05-01&sp=%2ftriggers%2fmanual%2frun&sv=1.0&sig=*sanitized*', userAgent='curl/7.68.0', clientRequestId='', clientSessionId='', clientIpAddress='', clientApplicationId='', apiVersion='2022-05-01', contentLength='-1', serviceRequestId=':5b292b43-a5a8-4bb6-bef1-0bd4857857e0', durationInMilliseconds='147', httpStatusCode='500', exceptionMessage='', errorCode='', failureCause='Service', errorMessage='', referer='', commandName='', parameterSetName='', contentType='application/json; charset=utf-8', contentEncoding='', armServiceRequestId='', organizationId='', activityVector='IN', locale='', additionalProperties='', targetResourceProvider='', targetResourceType='', extensionVersion='1.2.7.0', siteName='UNDEFINED_SITE_NAME', slotName='', activityId='5b292b43-a5a8-4bb6-bef1-0bd4857857e0'.
[2022-09-06T18:44:59.509Z] Executed 'Functions.test-workflow' (Succeeded, Id=14372122-1dbb-4f53-804c-dc6e6206edf2, Duration=214ms)
[2022-09-06T18:44:59.578Z] Executed HTTP request: {
[2022-09-06T18:44:59.578Z] requestId: "6a0f11f0-f733-430b-80aa-3aa0d75e3bbc",
[2022-09-06T18:44:59.578Z] identities: "",
[2022-09-06T18:44:59.578Z] status: "500",
[2022-09-06T18:44:59.578Z] duration: "318"
[2022-09-06T18:44:59.578Z] }
```

Contributor guide

Open the contributing guide

Research direction

No repository files or tests are named. Start by tracing the stack from MD5CryptoServiceProvider and ComputeMd5Hash through ToInlineContentLink and UploadFlowTriggerContent, then determine whether those components are owned by this repository. Done means establishing a supported FIPS-enabled workflow path without disabling environment controls, or documenting that the failure is outside this tool.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp, ubuntu
Domain
cli, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.