Skip to main content

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, nested MapGroup prefixes), 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, literal Password= in appsettings*.json ConnectionStrings
  • 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 \
  --index mlaify=https://pkg.mlaify.io/pypi/simple/ --index-strategy first-index
# 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 .sln file anywhere in the tree
  • A .cs file 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 minus Controller), [action] (method name minus Async) 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, or MapControllers().RequireAuthorization(), makes unmarked routes require auth. A route that requires auth gets an aspnet_authorize:<METHOD> <path> auth hint on its own line; an explicitly anonymous route gets an aspnet_allow_anonymous:<METHOD> <path> entrypoint hint and no auth hint. Core attributes auth hints to routes by a ±40-line window until Route carries 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 literal Password=/Pwd= inside an appsettings*.json ConnectionStrings entry is reported as connection_string_password (kind="config_literal"); the evidence names the entry, never the value.
  • F# (.fs) projects are detected via .fsproj but route extraction is not yet implemented (Giraffe / Saturn).
  • Razor Pages: @page in a .cshtml file emits an ANY route from the file's path under Pages/ (or Areas/<Area>/Pages/), with Index mapped 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 .razor components aren't covered.

License

MIT

Metadata

Release files for attackmap-analyzer-dotnet 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for attackmap-analyzer-dotnet 0.2.0
File Size Uploaded Provenance Actions
attackmap_analyzer_dotnet-0.2.0.tar.gz 29.4 kB With provenance Details for attackmap_analyzer_dotnet-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for attackmap-analyzer-dotnet 0.2.0
File Interpreter ABI Platform Actions
attackmap_analyzer_dotnet-0.2.0-py3-none-any.whl Python 3 none any Details for attackmap_analyzer_dotnet-0.2.0-py3-none-any.whl

Total release size: 52.6 kB

Release files / attackmap_analyzer_dotnet-0.2.0.tar.gz

Download URL attackmap_analyzer_dotnet-0.2.0.tar.gz
Size 29.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8caa64837e934eb5b6cd5e05889ee05e2cab2528e10d55eab6429d697a7f96c8
BLAKE2b-256 checksum
How to use checksums
93bdb9338d37e0e9d4dcaf724905a966a261f0fd05c6c652662d8bf8bab67892
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 log

Release files / attackmap_analyzer_dotnet-0.2.0-py3-none-any.whl

Download URL attackmap_analyzer_dotnet-0.2.0-py3-none-any.whl
Size 23.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0dce6c638263c92ef1a355181a357d103884e120566e6990e0504618751c6063
BLAKE2b-256 checksum
How to use checksums
c22d64f5f14029be3ecbbe180f81cd357de60dee02f73da73aeea5ff2237eb4d
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 log

Security for attackmap-analyzer-dotnet 0.2.0

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.

Select from 2 files

Attestation for attackmap_analyzer_dotnet-0.2.0.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 log

A 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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page