Skip to main content

AttackMap Node Service Analyzer

attackmap-analyzer-node-service is a broad Node.js/TypeScript backend analyzer module for AttackMap.

It is designed for distributed service repositories and emits structured scan signals for:

  • service identity and role hints
  • route and handler registration hints
  • outbound HTTP and env-configured service URLs
  • datastore and storage usage hints
  • auth/signing/token hints
  • lightweight inter-service edge hints

This analyzer is intentionally heuristic and incremental. It is not Bluesky-specific.

Mount paths (#4)

Routes carry the prefixes of every router mount above them, across files:

  • Express / Koa X.use('/prefix', [mw...,] router), Hono X.route('/prefix', sub) and X.basePath('/prefix'), Elysia new Elysia({ prefix }) and X.group('/prefix', (g) => ...), Koa new Router({ prefix }), and Fastify X.register(plugin, { prefix }) (ignored for fastify-plugin wrapped plugins, as Fastify does);
  • a router mounted at two prefixes gives one route per path, each with its own auth;
  • route functions called with the app (require('./routes/users')(app), usersRoutes(app)) register on it;
  • chained calls count like separate statements: new Hono().use(mw).get('/x', h).route('/y', sub);
  • Fastify's full form X.route({ method, url }) and NestJS @Controller({ path }) are routes too.

Imports are followed through require(...) (including inline app.use('/x', require('./x'))), default / named / namespace imports, barrel re-exports (export { x } from './x', export * from), index files, compilerOptions.paths / baseUrl from the nearest tsconfig.json / jsconfig.json (and relative extends), and workspace packages by their package.json name. Nothing outside the repo is read. Mounts made in test files are ignored. A router that no visible code mounts keeps its file-local path.

Route auth (AttackMap#256)

Express, Koa, Hono, Elysia, Fastify and NestJS routes carry auth (required / anonymous / unknown), guards and guard_evidence:

  • required:
    • route-local auth middleware: router.post('/x', requireAuth, h), arrays, router.route('/x').post(mw, h), and route options { preHandler | onRequest | beforeHandle: [...] }; a registration made only of guards (app.get('/x', isAuthorized())) guards that path;
    • an earlier X.use([path,] mw), X.all('*', mw), Fastify addHook('onRequest' | 'preHandler', mw) or Elysia onBeforeHandle(mw) / guard({ beforeHandle }, ...) on the route's router, or on any router that mounts it (with the mount's own middleware);
    • NestJS @UseGuards(...) on the method or controller, or a global useGlobalGuards(...) / APP_GUARD. A metadata-driven role guard (RolesGuard, PermissionsGuard) counts only next to its @Roles(...) / @Permissions(...) metadata.
  • anonymous:
    • a route whose full path is listed in a guard's .unless({ path: ['/login', ...] });
    • a NestJS @Public() / @SkipAuth() / @AllowAnonymous() / @SetMetadata('isPublic', true) route, unless a guard is Passport's own AuthGuard('...'), which ignores that metadata.
  • unknown: everything else. That includes optionalAuth-style middleware and NestJS Optional... guards, .unless lists with regexes or other keys, routers mounted somewhere the analyzer can't see, and middleware registered after the route.

Middleware counts as a guard by name: authentication (requireAuth, authenticate, isAuthenticated, ensureLoggedIn, passport.authenticate(...), expressjwt(...), jwt(...), verifyToken, bearerAuth(...), fastify.authenticate) or a role / permission check (requireRole('admin'), isAdmin, authorize('admin'), checkPermissions, guard.check([...])), which stays visible in guards for AttackMap's function-level authorization check. An inline hook that calls request.jwtVerify() counts too. Rate limiters, body parsers, CORS / CSRF / helmet, optional / skip / public variants and trackers such as updateAuthenticatedUsers don't.

Not handled yet: Next.js middleware.ts matchers, NestJS RouterModule / setGlobalPrefix, and dynamic mount paths (app.use(prefix, router) with a variable).

Install

uv tool install attackmap --with attackmap-analyzer-node-service    # from PyPI
# or: pip install attackmap-analyzer-node-service    (installs attackmap too)
# or from source:
pip install git+https://github.com/mlaify/attackmap-analyzer-node-service.git

Usage

attackmap analyze /path/to/repo --module node-service

Metadata

Release files for attackmap-analyzer-node-service 0.4.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-node-service 0.4.0
File Size Uploaded Provenance Actions
attackmap_analyzer_node_service-0.4.0.tar.gz 60.7 kB With provenance Details for attackmap_analyzer_node_service-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for attackmap-analyzer-node-service 0.4.0
File Interpreter ABI Platform Actions
attackmap_analyzer_node_service-0.4.0-py3-none-any.whl Python 3 none any Details for attackmap_analyzer_node_service-0.4.0-py3-none-any.whl

Total release size: 105.9 kB

Release files / attackmap_analyzer_node_service-0.4.0.tar.gz

Download URL attackmap_analyzer_node_service-0.4.0.tar.gz
Size 60.7 kB
Tags Source
SHA-256 checksum
How to use checksums
abb2a8bcea1b7cad7286317698082b73d3105e7ceea4f343e470ca32627d56b0
BLAKE2b-256 checksum
How to use checksums
888788b29450ebb6086034cfb852e830ebf6198b200233583603a2f76772a13d
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 25, 2026.

Transparency log

Release files / attackmap_analyzer_node_service-0.4.0-py3-none-any.whl

Download URL attackmap_analyzer_node_service-0.4.0-py3-none-any.whl
Size 45.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a2a26a49f11df744084af83803671d9252f63b2ede1da06af0269d3a60f4dc11
BLAKE2b-256 checksum
How to use checksums
d541eb246d1bb1029c192e37a1a1416a57d0a70999b34ed1561c3c44f1ed86b1
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 25, 2026.

Transparency log

Security for attackmap-analyzer-node-service 0.4.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_node_service-0.4.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 25, 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.

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