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

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.3.1
File Size Uploaded Provenance Actions
attackmap_analyzer_node_service-0.3.1.tar.gz 60.4 kB With provenance Details for attackmap_analyzer_node_service-0.3.1.tar.gz

Built distribution (wheel)

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

Total release size: 105.6 kB

Release files / attackmap_analyzer_node_service-0.3.1.tar.gz

Download URL attackmap_analyzer_node_service-0.3.1.tar.gz
Size 60.4 kB
Tags Source
SHA-256 checksum
How to use checksums
be599977691a5f6e77257552974133cd2633cc5a0be5513f5e4a496d9a8eb7cf
BLAKE2b-256 checksum
How to use checksums
16a96647b3d7fe3d002112d8c3cc0dc41504d5cea3a62f317631ca806f29fdf3
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_node_service-0.3.1-py3-none-any.whl

Download URL attackmap_analyzer_node_service-0.3.1-py3-none-any.whl
Size 45.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
63c612353179a269428dba83b78c880b4b4e9e200e81177dbe48626ba177f3c8
BLAKE2b-256 checksum
How to use checksums
9ffa35c0e679f353a82ea597acaa7ab22ee306717333ee721e85136ee582f8cc
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-node-service 0.3.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.

Select from 2 files

Attestation for attackmap_analyzer_node_service-0.3.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 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.3.1 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