-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
House cleaning #635
House cleaning #635
Conversation
Bumps [FluentAssertions](https://github.com/fluentassertions/fluentassertions) from 6.12.0 to 6.12.1. - [Release notes](https://github.com/fluentassertions/fluentassertions/releases) - [Changelog](https://github.com/fluentassertions/fluentassertions/blob/develop/AcceptApiChanges.ps1) - [Commits](fluentassertions/fluentassertions@6.12.0...6.12.1) --- updated-dependencies: - dependency-name: FluentAssertions dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [Firely.Fhir.Packages](https://github.com/FirelyTeam/Firely.Fhir.Packages) from 4.7.0 to 4.8.0. - [Release notes](https://github.com/FirelyTeam/Firely.Fhir.Packages/releases) - [Commits](FirelyTeam/Firely.Fhir.Packages@v4.7.0...v4.8.0) --- updated-dependencies: - dependency-name: Firely.Fhir.Packages dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [Npgsql.EntityFrameworkCore.PostgreSQL](https://github.com/npgsql/efcore.pg) and [Npgsql](https://github.com/npgsql/npgsql). These dependencies needed to be updated together. Updates `Npgsql.EntityFrameworkCore.PostgreSQL` from 8.0.4 to 8.0.8 - [Release notes](https://github.com/npgsql/efcore.pg/releases) - [Commits](npgsql/efcore.pg@v8.0.4...v8.0.8) Updates `Npgsql` from 8.0.3 to 8.0.4 - [Release notes](https://github.com/npgsql/npgsql/releases) - [Commits](npgsql/npgsql@v8.0.3...v8.0.4) --- updated-dependencies: - dependency-name: Npgsql.EntityFrameworkCore.PostgreSQL dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Npgsql dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
It will make it easier on consumers concerning warnings. And the nullable parameters will express whether a null will be allowed.
Moving it to UdapEd. Also fixing up more compiler warnings.
…Assertions-6.12.1 Bump FluentAssertions from 6.12.0 to 6.12.1
…f7a557f0b7 Bump Npgsql.EntityFrameworkCore.PostgreSQL and Npgsql
….Fhir.Packages-4.8.0 Bump Firely.Fhir.Packages from 4.7.0 to 4.8.0
UdapDynamicClientRegistrationErrorDescriptions.UntrustedCertificate); | ||
_logger.LogWarning("{Error}::{Description}", | ||
UdapDynamicClientRegistrationErrors.UnapprovedSoftwareStatement, | ||
UdapDynamicClientRegistrationErrorDescriptions.UntrustedCertificate); |
Check failure
Code scanning / CodeQL
Clear text storage of sensitive information High
access to constant UntrustedCertificate
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 3 months ago
To fix the problem, we need to ensure that sensitive information, such as certificate thumbprints, is encrypted before being logged. We can use the System.Security.Cryptography.ProtectedData
class to encrypt the thumbprints before logging them. This will ensure that even if the logs are accessed by unauthorized users, the sensitive information remains protected.
- Encrypt the thumbprints before appending them to the log message.
- Update the logging statements to include the encrypted thumbprints instead of the plain text ones.
- Add necessary imports for the encryption functionality.
-
Copy modified line R39 -
Copy modified lines R44-R50 -
Copy modified line R314 -
Copy modified line R319 -
Copy modified line R323
@@ -38,2 +38,3 @@ | ||
using Udap.Util.Extensions; | ||
using System.Security.Cryptography; | ||
using static Udap.Model.UdapConstants; | ||
@@ -42,2 +43,9 @@ | ||
|
||
private string Encrypt(string data) | ||
{ | ||
byte[] dataBytes = Encoding.UTF8.GetBytes(data); | ||
byte[] encryptedBytes = ProtectedData.Protect(dataBytes, null, DataProtectionScope.CurrentUser); | ||
return Convert.ToBase64String(encryptedBytes); | ||
} | ||
|
||
/// <summary> | ||
@@ -305,3 +313,3 @@ | ||
var sb = new StringBuilder(); | ||
sb.AppendLine($"Client Thumbprint: {publicCert.Thumbprint}"); | ||
sb.AppendLine($"Client Thumbprint: {Encrypt(publicCert.Thumbprint)}"); | ||
|
||
@@ -310,3 +318,3 @@ | ||
sb.AppendLine( | ||
$"Intermediate Thumbprints: {string.Join(" | ", intermediateCertificates.Select(a => a.Thumbprint))}"); | ||
$"Intermediate Thumbprints: {string.Join(" | ", intermediateCertificates.Select(a => Encrypt(a.Thumbprint)))}"); | ||
|
||
@@ -314,3 +322,3 @@ | ||
|
||
sb.AppendLine($"Anchor Certificate Thumbprints: {string.Join(" | ", anchorCertificates.Select(a => a.Thumbprint))}"); | ||
sb.AppendLine($"Anchor Certificate Thumbprints: {string.Join(" | ", anchorCertificates.Select(a => Encrypt(a.Thumbprint)))}"); | ||
_logger.LogWarning("{Message}", sb.ToString()); |
Udap.Server/Security/Authentication/TieredOAuth/TieredOAuthAuthenticationHandler.cs
Fixed
Show fixed
Hide fixed
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
The idea is to build a functioning CdsHooks service that works with version 2.0 and another mode where it can run in a UDAP enabled experience.
This is experimental for testing what it would be like to integrate UDAP and CDS Hooks.
Removed all warnings.
Adding more Cancellation Token plumbing.
Removed code that was UdapEd only, such as IAccessTokenProvider and AuthTokenHttpMessageHandler
Package updates