-
Notifications
You must be signed in to change notification settings - Fork 0
Add Linux client support (.NET 8) for cross-platform Secure Boot monitoring #10
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
Open
Copilot
wants to merge
50
commits into
main
Choose a base branch
from
copilot/add-linux-client-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 34 commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
9b7091a
Initial plan
Copilot 155b2d4
Fix build errors in PowerShellSecureBootCertificateEnumerator for .NE…
Copilot a88e424
Add Linux client support (.NET 8) with platform-specific implementations
Copilot 5477b82
Update documentation for Linux client support
Copilot 0ed2c87
Add test project for Linux client with basic unit tests
Copilot 0f4133b
Add comprehensive implementation summary for Linux client support
Copilot f0da4f7
Update AzureQueueReportSink.cs
robgrame 0682f03
Update AzureQueueReportSink.cs
robgrame 5a85d40
Update AzureQueueReportSink.cs
robgrame 287150e
Update AzureQueueReportSink.cs
robgrame da5366c
Update AzureQueueReportSink.cs
robgrame e7b7aba
Update AzureQueueReportSink.cs
robgrame aec34bc
Update ISecureBootCertificateEnumerator.cs
robgrame 34af9eb
Update SinkCoordinator.cs
robgrame e0bd782
Update LinuxRegistrySnapshotProvider.cs
robgrame 0c2c59c
Update LinuxEventLogReader.cs
robgrame 9e6bf8d
Update LinuxEventLogReader.cs
robgrame 54f0407
Update ReportBuilder.cs
robgrame 6d83e20
Update LinuxSecureBootCertificateEnumerator.cs
robgrame 971ef9b
Update SecureBootWatcherService.cs
robgrame 9e7b263
Update LinuxSecureBootCertificateEnumerator.cs
robgrame ff6002f
Update LinuxSecureBootCertificateEnumerator.cs
robgrame c9f12c0
Update README.md
robgrame 8cf363c
Update AzureQueueReportSink.cs
robgrame 85264f2
Update AzureQueueReportSink.cs
robgrame 9753fae
Update AzureQueueReportSink.cs
robgrame 6a330fc
Update ISecureBootCertificateEnumerator.cs
robgrame f86fd42
Update LinuxSecureBootCertificateEnumerator.cs
robgrame 2c5421d
Update LinuxSecureBootCertificateEnumerator.cs
robgrame 8e8b9d9
Update ReportBuilder.cs
robgrame 33cf81a
Update LinuxSecureBootCertificateEnumerator.cs
robgrame 3e1a8ab
Update LinuxSecureBootCertificateEnumerator.cs
robgrame 163fabe
Update LinuxSecureBootCertificateEnumerator.cs
robgrame 04bc708
Update LinuxSecureBootCertificateEnumerator.cs
robgrame 1669144
Update FileEventCheckpointStore.cs
robgrame 62df7a2
Update FileShareReportSink.cs
robgrame 70f6a8b
Update AzureQueueReportSink.cs
robgrame c521108
Update LinuxEventLogReader.cs
robgrame 51101da
Update LinuxSecureBootCertificateEnumerator.cs
robgrame d4e6da9
Update AzureQueueReportSink.cs
robgrame 63b05b1
Update LinuxRegistrySnapshotProviderTests.cs
robgrame 1fa9e0f
Update ReportBuilder.cs
robgrame 90e1a4d
Update Program.cs
robgrame cefb506
Update AzureQueueReportSink.cs
robgrame 588e258
Update AzureQueueReportSink.cs
robgrame 01c6acc
Update AzureQueueReportSink.cs
robgrame 27cb227
Update WebApiReportSink.cs
robgrame 459ecf0
Update LinuxEventLogReader.cs
robgrame 97f00c9
Update LinuxSecureBootCertificateEnumerator.cs
robgrame ddbad92
Update AzureQueueReportSink.cs
robgrame File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...reBootWatcher.Client.Tests/obj/Debug/net48/SecureBootWatcher.Client.Tests.AssemblyInfo.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../obj/Debug/net48/SecureBootWatcher.Client.Tests.GeneratedMSBuildEditorConfig.editorconfig
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-21.9 KB
(79%)
...lient.Tests/obj/Debug/net48/SecureBootWatcher.Client.Tests.csproj.AssemblyReference.cache
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+0 Bytes
(100%)
...ootWatcher.Client/obj/Debug/net48/SecureBootWatcher.Client.csproj.AssemblyReference.cache
Binary file not shown.
31 changes: 31 additions & 0 deletions
31
SecureBootWatcher.LinuxClient.Tests/SecureBootWatcher.LinuxClient.Tests.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <Nullable>enable</Nullable> | ||
|
|
||
| <IsPackable>false</IsPackable> | ||
| <IsTestProject>true</IsTestProject> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="coverlet.collector" Version="6.0.0" /> | ||
| <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" /> | ||
| <PackageReference Include="xunit" Version="2.5.3" /> | ||
| <PackageReference Include="xunit.runner.visualstudio" Version="2.5.3" /> | ||
| <PackageReference Include="Moq" Version="4.20.70" /> | ||
| <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.10" /> | ||
| <PackageReference Include="Microsoft.Extensions.Options" Version="9.0.10" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <Using Include="Xunit" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <ProjectReference Include="..\SecureBootWatcher.LinuxClient\SecureBootWatcher.LinuxClient.csproj" /> | ||
| <ProjectReference Include="..\SecureBootWatcher.Shared\SecureBootWatcher.Shared.csproj" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
56 changes: 56 additions & 0 deletions
56
SecureBootWatcher.LinuxClient.Tests/Services/LinuxRegistrySnapshotProviderTests.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,56 @@ | ||||||||||||||||||||||||||||||||
| using Microsoft.Extensions.Logging; | ||||||||||||||||||||||||||||||||
| using Microsoft.Extensions.Logging.Abstractions; | ||||||||||||||||||||||||||||||||
| using SecureBootWatcher.LinuxClient.Services; | ||||||||||||||||||||||||||||||||
| using SecureBootWatcher.Shared.Models; | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| namespace SecureBootWatcher.LinuxClient.Tests.Services; | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| public class LinuxRegistrySnapshotProviderTests | ||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||
| [Fact] | ||||||||||||||||||||||||||||||||
| public async Task CaptureAsync_ShouldReturnSnapshot() | ||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||
| // Arrange | ||||||||||||||||||||||||||||||||
| var logger = NullLogger<LinuxRegistrySnapshotProvider>.Instance; | ||||||||||||||||||||||||||||||||
| var provider = new LinuxRegistrySnapshotProvider(logger); | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| // Act | ||||||||||||||||||||||||||||||||
| var result = await provider.CaptureAsync(CancellationToken.None); | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| // Assert | ||||||||||||||||||||||||||||||||
| Assert.NotNull(result); | ||||||||||||||||||||||||||||||||
| Assert.True(result.CollectedAtUtc <= DateTimeOffset.UtcNow); | ||||||||||||||||||||||||||||||||
| Assert.True(result.CollectedAtUtc > DateTimeOffset.UtcNow.AddMinutes(-1)); | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| [Fact] | ||||||||||||||||||||||||||||||||
| public async Task CaptureAsync_ShouldSetDeploymentState() | ||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||
| // Arrange | ||||||||||||||||||||||||||||||||
| var logger = NullLogger<LinuxRegistrySnapshotProvider>.Instance; | ||||||||||||||||||||||||||||||||
| var provider = new LinuxRegistrySnapshotProvider(logger); | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| // Act | ||||||||||||||||||||||||||||||||
| var result = await provider.CaptureAsync(CancellationToken.None); | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| // Assert | ||||||||||||||||||||||||||||||||
| Assert.NotEqual(SecureBootDeploymentState.NotStarted, result.DeploymentState); | ||||||||||||||||||||||||||||||||
| // Linux systems will return Unknown (no EFI vars path) or Unknown (EFI vars exist) | ||||||||||||||||||||||||||||||||
| // since UEFI CA 2023 tracking is Windows-specific | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| [Fact] | ||||||||||||||||||||||||||||||||
| public async Task CaptureAsync_WithCancellationToken_ShouldComplete() | ||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||
| // Arrange | ||||||||||||||||||||||||||||||||
| var logger = NullLogger<LinuxRegistrySnapshotProvider>.Instance; | ||||||||||||||||||||||||||||||||
| var provider = new LinuxRegistrySnapshotProvider(logger); | ||||||||||||||||||||||||||||||||
| var cts = new CancellationTokenSource(); | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| // Act | ||||||||||||||||||||||||||||||||
| var result = await provider.CaptureAsync(cts.Token); | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| // Assert | ||||||||||||||||||||||||||||||||
| Assert.NotNull(result); | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
| var cts = new CancellationTokenSource(); | |
| // Act | |
| var result = await provider.CaptureAsync(cts.Token); | |
| // Assert | |
| Assert.NotNull(result); | |
| using (var cts = new CancellationTokenSource()) | |
| { | |
| // Act | |
| var result = await provider.CaptureAsync(cts.Token); | |
| // Assert | |
| Assert.NotNull(result); | |
| } |
15 changes: 15 additions & 0 deletions
15
SecureBootWatcher.LinuxClient/Configuration/ConfigurationExtensions.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| using Microsoft.Extensions.Configuration; | ||
| using Microsoft.Extensions.DependencyInjection; | ||
| using SecureBootWatcher.Shared.Configuration; | ||
|
|
||
| namespace SecureBootWatcher.LinuxClient.Configuration | ||
| { | ||
| internal static class ConfigurationExtensions | ||
| { | ||
| public static IServiceCollection AddSecureBootWatcherOptions(this IServiceCollection services, IConfiguration configuration) | ||
| { | ||
| services.Configure<SecureBootWatcherOptions>(configuration.GetSection("SecureBootWatcher")); | ||
| return services; | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.