Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/security/threat-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,15 @@ evidence.
the password comes from a file that is never logged, hashed or reported. An inspecting
proxy can read heartbeat metadata and the bearer token in transit, so trust it as you
would the management host. It cannot forge commands.
- Console pack gallery (`GET /api/packs`, `POST /api/packs/install-requests`): management
loads `.bowerpack` archives only from the server-configured `BOWER_PACK_GALLERY_DIR`
and verifies every manifest signature and file digest against `BOWER_PACK_TRUSTED_KEYS`
before listing, before accepting an install submission, and again before approval.
Archives without a trusted key or with modified contents are refused with a plain reason
and cannot be submitted or approved; sample results expose pass/fail decisions only
(never raw sample inputs or sensitive strings). Pack installs require two-person
approval (the requester cannot approve) and write desired-policy hashes plus audit rows
atomically; every collector still verifies pack signatures independently on load.
- Management API abuse: Entra-only endpoints (except token enrolment and the
enrolled-collector credential, above), per-principal rate limiting, HSTS on
HTTPS, restricted CORS headers and methods, and fixed error messages that never
Expand Down
1 change: 1 addition & 0 deletions src/Bower.Management.Api/Bower.Management.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<ProjectReference Include="..\Bower.Evidence\Bower.Evidence.csproj" />
<ProjectReference Include="..\Bower.Integrity\Bower.Integrity.csproj" />
<ProjectReference Include="..\Bower.Jobs\Bower.Jobs.csproj" />
<ProjectReference Include="..\Bower.Packs\Bower.Packs.csproj" />
<ProjectReference Include="..\Bower.Pipeline\Bower.Pipeline.csproj" />
<ProjectReference Include="..\Bower.PolicyEngine\Bower.PolicyEngine.csproj" />
<ProjectReference Include="..\Bower.Redaction\Bower.Redaction.csproj" />
Expand Down
3 changes: 3 additions & 0 deletions src/Bower.Management.Api/ManagementApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ public static WebApplication Build(
builder.Configuration[SourceSetupSigner.KeyFileSetting]));
// Optional: without trusted keys offline site bundle imports are refused (503).
builder.Services.AddSingleton(OfflineSiteTrustKeys.FromConfiguration(builder.Configuration));
// Optional: signed pack gallery directory + trusted signing keys (fail closed when keys absent).
builder.Services.AddSingleton(PackGalleryService.FromConfiguration(builder.Configuration));

string[] allowedOrigins = builder.Configuration
.GetSection("Bower:AllowedOrigins")
Expand Down Expand Up @@ -346,6 +348,7 @@ await store.FleetAsync(clock.GetUtcNow(), cancellationToken))

OfflineSiteEndpoints.Map(api);
PipelineLiveEndpoints.Map(api);
PackGalleryEndpoints.Map(api);

api.MapGet(
"/collectors",
Expand Down
5 changes: 5 additions & 0 deletions src/Bower.Management.Api/ManagementJson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ public sealed record PipelineValidationResponse(
[JsonSerializable(typeof(IReadOnlyList<CollectorPipelineFlow>))]
[JsonSerializable(typeof(PipelineTapRequest))]
[JsonSerializable(typeof(PipelineTapResponse))]
[JsonSerializable(typeof(PackGalleryResponse))]
[JsonSerializable(typeof(PackInstallSubmission))]
[JsonSerializable(typeof(PackPopulationDiff))]
[JsonSerializable(typeof(PackInstallRequestRecord))]
[JsonSerializable(typeof(List<PackInstallRequestRecord>))]
[JsonSerializable(typeof(Dictionary<string, string>))]
[JsonSerializable(typeof(Microsoft.AspNetCore.Mvc.ProblemDetails))]
[JsonSerializable(typeof(HttpValidationProblemDetails))]
Expand Down
Loading