PrimusSaaS.Security 2.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package PrimusSaaS.Security --version 2.0.0
                    
NuGet\Install-Package PrimusSaaS.Security -Version 2.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PrimusSaaS.Security" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PrimusSaaS.Security" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="PrimusSaaS.Security" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PrimusSaaS.Security --version 2.0.0
                    
#r "nuget: PrimusSaaS.Security, 2.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package PrimusSaaS.Security@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PrimusSaaS.Security&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=PrimusSaaS.Security&version=2.0.0
                    
Install as a Cake Tool

PrimusSaaS.Security

Version: 1.0.0-preview.1
Status: 🚧 UNDER DEVELOPMENT - Milestone 1 Foundation Phase

Enterprise-grade security analysis module with absolute data isolation. All vulnerability scanning, dependency checking, and compliance validation happens 100% locally within your infrastructure.


🔒 Core Guarantee

Your code NEVER leaves your infrastructure. Period.

  • Zero external API calls (compile-time blocked)
  • No cloud dependencies (fully self-contained)
  • Complete privacy (verifiable by network monitoring)
  • Offline capable (works without internet)

🚀 Quick Start (5 minutes)

Installation

dotnet add package PrimusSaaS.Security --prerelease

Integration

// Program.cs
using PrimusSaaS.Security;

var builder = WebApplication.CreateBuilder(args);

// Add Primus Security (3 lines!)
builder.Services.AddPrimusSecurity(options =>
{
    options.EnableStaticAnalysis = true;
    options.EnableDependencyScanning = true;
    options.ComplianceStandards = new[] { "OWASP", "PCI-DSS" };
});

var app = builder.Build();

// Verify data isolation on startup
var verification = PrimusSecurityExtensions.VerifyDataIsolation();
if (!verification.IsFullyIsolated)
{
    throw new InvalidOperationException(
        "Security module failed data isolation verification!"
    );
}

app.Run();

Done! Your API now has security analysis running locally.


✨ Features

✅ Phase 1: Foundation (Completed)

  • Project structure created
  • Core models defined (SecurityFinding, ScanResult)
  • Configuration options
  • DI extensions
  • Data isolation verification
  • PDF Reporting (QuestPDF)

✅ Phase 2: Core Engine (Completed)

  • Static Code Analysis (Roslyn Analyzers)

    • Base Analyzer Infrastructure
    • Rule PS0001: SQL Injection (ADO.NET, EF Core, Dapper)
    • Rule PS0002: XSS Detection (Html.Raw, innerHTML)
    • Rule PS0003: Hardcoded Secret Constants (AWS, Stripe, etc.)
  • Secret Detection

    • Regex-based detection (Standard patterns embedded)
    • Entropy-based detection
    • Zero-config/Out-of-the-box support
  • Dependency Scanning

    • Local CVE database (SQLite) support
    • NuGet package vulnerability lookup
    • Semver range matching (Strict & Loose)

🗄️ CVE Database Maintenance

Because PrimusSaaS.Security is offline-first, it does not download vulnerability data at runtime. You must provide the cve.db file.

Generating the Database

  1. Clone the GitHub Advisory Database.
  2. Run the Primus Data Aggregator tool:
    dotnet run --project tools/PrimusSaaS.Security.DataAggregator \
      -- "path/to/advisory-database" \
      -- "path/to/output/cve.db"
    
  3. Distribute the resulting cve.db to your build agents or developers.

📊 Current Implementation Status

Overall Progress: ▰▰▰▰▰▰▰▰▰▱ 90% (Preview Release Ready)

Milestone 1: Foundation        ▰▰▰▰▰▰▰▰▰▰ 100%
Milestone 2: Core Engine        ▰▰▰▰▰▰▰▰▰▰ 100%
Milestone 3: Data Tools         ▰▰▰▰▰▰▰▰▰▰ 100% (Aggregator Tool Ready)
Milestone 4: Test Coverage      ▰▰▰▰▰▰▰▱▱▱  70% (15 tests)

Current Limitations:

  • Static Analysis (Roslyn Analyzers) runs at compile-time only — not via ScanAsync()
  • CVE database (cve.db) must be provided by the user (offline-first design)

Next Steps:

  1. Integration testing in your CI/CD pipeline.
  2. Regular updates of your cve.db snapshot.

🎯 Example Use Case

Before Primus Security

// Manual security review required
// Consultant costs: $5,000
// Time: 3-5 days
// Frequency: Once per quarter

After Primus Security

// Automated continuous security scanning
builder.Services.AddPrimusSecurity(options =>
{
    options.EnableStaticAnalysis = true;  // Instant SQL injection, XSS detection
    options.EnableSecretDetection = true; // Catch hardcoded API keys
    options.CveDatabasePath = "/app/data/cve.db"; // Local DB path
    
    options.OnScanComplete = async (result) => 
    {
        // Generate PDF Report
        var reporter = new PdfSecurityReporter();
        reporter.GenerateReport(result, $"scan-report-{DateTime.Now:yyyyMMdd}.pdf");
    };
});

📞 Support & Feedback


⚖️ License

MIT License - see LICENSE file for details


🔒 Remember: Your code NEVER leaves your infrastructure. We guarantee it.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on PrimusSaaS.Security:

Package Downloads
PrimusSaaS.Security.AI

AI-powered remediation agent for the PrimusSaaS Security scanner. Connects to Azure OpenAI and GitHub Models to generate fix explanations, threat narratives, and enhanced before/after code patches. Includes prompt injection detection to prevent adversarial inputs.

PrimusSaaS.Security.Reporting

Security reporting, compliance mapping, and branded HTML/PDF report generation for the Primus Security Suite. Produces SARIF 2.1.0, OWASP Top 10 2021 JSON/Markdown/PDF, CWE/OWASP/PCI-DSS/GDPR compliance scores, and pixel-perfect corporate HTML reports matching the Primus design system. Includes HtmlFormatter, PdfFormatter, SarifFormatter, JsonFormatter, CsvFormatter, ComplianceMapper, and SecurityReportGenerator with full triage/patch-coverage data.

PrimusSaaS.Security.Heuristics

Heuristic behavioral analyzer for detecting suspicious runtime patterns.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.2.0 34 3/11/2026
2.0.0 160 1/12/2026

v2.0.0:
- Standardized Framework Release.
- Renamed all packages to PrimusSaaS.* namespace.
- Synchronized versions across the entire suite.
- Enhanced metadata and fixed consistency issues.