49 lines
1.5 KiB
C#
49 lines
1.5 KiB
C#
using System.Text.Json;
|
|
|
|
namespace OCSentinelCli.Configuration;
|
|
|
|
internal sealed record ClientConfiguration
|
|
{
|
|
public string SchemaVersion { get; init; } = "2.0";
|
|
|
|
public string Environment { get; init; } = "production";
|
|
|
|
public int LookbackDays { get; init; } = 7;
|
|
|
|
public int TopFindings { get; init; } = 10;
|
|
|
|
public string N8nWebhookUrl { get; init; } = string.Empty;
|
|
|
|
public string NinjaOrganizationId { get; init; } = string.Empty;
|
|
|
|
public string NinjaOrganizationName { get; init; } = string.Empty;
|
|
|
|
public string NinjaMachineId { get; init; } = string.Empty;
|
|
|
|
public string NinjaNodeId { get; init; } = string.Empty;
|
|
|
|
public string NinjaLocationId { get; init; } = string.Empty;
|
|
|
|
public string NinjaLocationName { get; init; } = string.Empty;
|
|
|
|
public string DeviceIdentifierMode { get; init; } = "machineName";
|
|
|
|
public int UploadTimeoutSeconds { get; init; } = 30;
|
|
|
|
public int UploadQueueMaxReports { get; init; } = 100;
|
|
|
|
public bool EnableVulnerabilityCorrelation { get; init; } = true;
|
|
|
|
public string VulnerabilityCsvPath { get; init; } = string.Empty;
|
|
|
|
public string SecretReference { get; init; } = "device-default";
|
|
|
|
public static ClientConfiguration Load(string path)
|
|
{
|
|
string fullPath = Path.GetFullPath(path);
|
|
string json = File.ReadAllText(fullPath);
|
|
ClientConfiguration? config = JsonSerializer.Deserialize<ClientConfiguration>(json, JsonOptions.Default);
|
|
return config ?? new ClientConfiguration();
|
|
}
|
|
}
|