Security defaults that belong in every ASP.NET Core application from day one.
87
83%
Does it follow best practices?
Impact
94%
1.91xAverage score across 5 eval scenarios
Passed
No known issues
A warehouse operations team needs an inventory management API built with ASP.NET Core and C#. An Angular dashboard on https://warehouse.example.com will consume this API. The system tracks products, stock levels, and stock adjustments (receiving shipments, recording sales, making corrections).
The API needs the following endpoints:
GET /api/inventory -- list all products with current stock levels (supports ?search=widget&lowStock=true&page=1)GET /api/inventory/{sku} -- get a single product's details and stock historyPOST /api/inventory -- add a new product to inventory (accepts sku, name, description, category, unitPrice, reorderPoint)PUT /api/inventory/{sku} -- update product detailsPOST /api/inventory/{sku}/adjustments -- record a stock adjustment (accepts type enum: Received, Sold, Correction, Return; quantity, reason)GET /api/inventory/{sku}/adjustments -- get stock adjustment history for a productGET /api/reports/low-stock -- list products below their reorder point (manager only)POST /api/inventory/bulk-import -- import products from a JSON array (admin only, accepts up to 100 items)Use an in-memory data store. Products have Sku, Name, Description, Category, UnitPrice, CurrentStock, ReorderPoint, CreatedAt, UpdatedAt. Adjustments have Id, Sku, Type, Quantity, PreviousStock, NewStock, Reason, UserId, CreatedAt.
Produce:
Program.cs -- Application setup with services and middlewareControllers/InventoryController.cs -- Product and stock endpointsControllers/ReportsController.cs -- Reporting endpointsModels/ -- Request/response DTOs and entity classesServices/InventoryService.cs -- Stock management business logicappsettings.json -- ConfigurationInventoryApi.csproj -- Project file with NuGet packagesevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
skills
aspnet-security-basics
verifiers