attackmap-analyzer-dotnet
C# / .NET (ASP.NET Core) ecosystem analyzer for AttackMap.
This analyzer extracts structured signals from .NET solutions and projects:
- Web frameworks — ASP.NET Core minimal APIs (
app.MapGet,app.MapPost,app.MapMethods, nestedMapGroupprefixes), attribute routing on controllers ([HttpGet],[HttpPost],[Route],[AcceptVerbs], with class-level[Route]prefix joining and[controller]/[action]/[area]token substitution),MapHub<T>,MapControllerRoute, Razor Pages@page;MapGrpcService<T>as a protocol hint - Databases — Entity Framework Core (
UseSqlServer/UseNpgsql/UseMySql/UseSqlite), Dapper, System.Data.SqlClient / Microsoft.Data.SqlClient, Npgsql, MySql.Data / MySqlConnector, MongoDB.Driver, StackExchange.Redis, AWS SDK (S3, DynamoDB) - Auth packages —
AddJwtBearer(Microsoft.AspNetCore.Authentication.JwtBearer),AddOpenIdConnect, ASP.NET Identity (UserManager,SignInManager,IdentityUser,PasswordHasher), per-route[Authorize]/[AllowAnonymous]/.RequireAuthorization()/.AllowAnonymous(), Duende IdentityServer, BCrypt.Net, Argon2 - HTTP clients (external calls) —
HttpClient.GetAsync/PostAsync/SendAsync,HttpRequestMessage,RestClient(RestSharp),new Uri(...) - Secrets —
Environment.GetEnvironmentVariable("..."),IConfiguration["..."]/Configuration["..."]/builder.Configuration["..."]with secret-shaped keys, literalPassword=inappsettings*.jsonConnectionStrings - Service hints —
<RootNamespace>and<AssemblyName>from.csproj
All emissions populate AttackMap's Signal v2 fields (line numbers, evidence snippets, confidence scores) so downstream insights can cite path/to/file.cs:NN.
Install
uv tool install attackmap --with attackmap-analyzer-dotnet # from PyPI
# or: pip install attackmap-analyzer-dotnet (installs attackmap too)
# or from source:
pip install git+https://github.com/mlaify/attackmap-analyzer-dotnet.git
The analyzer is auto-discovered by AttackMap via the attackmap.analyzers entry-point group.
Usage with AttackMap
# Auto-discovered when installed:
attackmap analyze /path/to/dotnet/repo
# Or invoke explicitly:
attackmap analyze /path/to/dotnet/repo --module dotnet
Detection
detect() returns true when any of the following are present, ignoring bin/, obj/, .vs/, .idea/, .git/, node_modules/, packages/, TestResults/, and publish/:
- A
.csproj,.fsproj, or.slnfile anywhere in the tree - A
.csfile anywhere in the tree
Coverage notes
- Route templates follow ASP.NET semantics: a controller annotated with
[Route("api/[controller]")]causes its[HttpGet("{id:int}", Name = "GetUser")]action to emit as/api/Orders/{id:int}. An action template starting with/or~/is absolute and replaces the controller prefix.[controller](class name minusController),[action](method name minusAsync) and[area]([Area("...")]) are substituted case-insensitively. A class prefix applies only inside that class's body. Every emitted path starts with/. - Minimal API groups:
var api = app.MapGroup("/api"); var v2 = api.MapGroup("/v2"); v2.MapGet("/orders/{id}", ...)emits/api/v2/orders/{id}. Inline chains (app.MapGroup("/x").MapGet("/y", ...)) work too. A group built in another file or by a custom extension method isn't followed. - Per-route auth: each route's effective state is computed.
[AllowAnonymous](attribute) or.AllowAnonymous()(minimal API, on the endpoint or any enclosing group) wins over[Authorize]/.RequireAuthorization(), as in ASP.NET. An authorization fallback policy, orMapControllers().RequireAuthorization(), makes unmarked routes require auth. A route that requires auth gets anaspnet_authorize:<METHOD> <path>auth hint on its own line; an explicitly anonymous route gets anaspnet_allow_anonymous:<METHOD> <path>entrypoint hint and no auth hint. Core attributes auth hints to routes by a ±40-line window untilRoutecarries an auth field (mlaify/AttackMap#256), so in a compact controller a neighbor's hint can still show up on an anonymous route.[Authorize]inherited from a base controller class isn't followed. - Connection strings:
GetConnectionString("DefaultConnection")names a connection string, so it isn't reported as a secret. A literalPassword=/Pwd=inside anappsettings*.jsonConnectionStringsentry is reported asconnection_string_password(kind="config_literal"); the evidence names the entry, never the value. - F# (.fs) projects are detected via
.fsprojbut route extraction is not yet implemented (Giraffe / Saturn). - Razor Pages:
@pagein a.cshtmlfile emits anANYroute from the file's path underPages/(orAreas/<Area>/Pages/), withIndexmapped to its folder and an optional@page "template"appended (or used as-is when it starts with/). Page auth conventions (AuthorizeFolder,[Authorize]on the PageModel) aren't read yet. Blazor.razorcomponents aren't covered.
License
MIT
Metadata
Release files for attackmap-analyzer-dotnet 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| attackmap_analyzer_dotnet-0.2.1.tar.gz | 29.5 kB | With provenance | Details for attackmap_analyzer_dotnet-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| attackmap_analyzer_dotnet-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for attackmap_analyzer_dotnet-0.2.1-py3-none-any.whl |
Total release size: 52.6 kB
Release files / attackmap_analyzer_dotnet-0.2.1.tar.gz
| Download URL | attackmap_analyzer_dotnet-0.2.1.tar.gz |
|---|---|
| Size | 29.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8e20777d63228cc1f7631952a9ff4abd2af3cd41d40be82f04c353f4dbfc6ff8
|
|
BLAKE2b-256 checksum How to use checksums |
5e5edfb730877f408705a2ef815fe8e41d0a1b421bf95afabc7dc97937cb61fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.
Transparency logRelease files / attackmap_analyzer_dotnet-0.2.1-py3-none-any.whl
| Download URL | attackmap_analyzer_dotnet-0.2.1-py3-none-any.whl |
|---|---|
| Size | 23.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4cfe3f9858b6a1fcfc14a025b322010a3be7233ee7d0f6643acbecbb2a661e97
|
|
BLAKE2b-256 checksum How to use checksums |
5ee819288243ae8e5427207c0eaa78eefb9826df246974d19229dd9e1ca03711
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.
Transparency logSecurity for attackmap-analyzer-dotnet 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for attackmap_analyzer_dotnet-0.2.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.