Semantic Entrypoint Schema

Part of Sprint 0411 - Semantic Entrypoint Engine (Task 23)

This document defines the schema for semantic entrypoint analysis, which enriches container scan results with application-level intent, capabilities, and threat modeling.

Current composition (verified 2026-07-19): The schema, analyzers, and in-memory temporal diff are library capabilities. The production Scanner Worker registers AddEntryTraceAnalyzer(), not AddSemanticEntryTraceAnalyzer(), and does not persist or emit semantic or temporal results. The CLI, SBOM, and RichGraph sections below describe the intended integration contract, not a currently reachable production path.


Overview

The Semantic Entrypoint Engine analyzes container entrypoints to infer:

  1. Application Intent - What kind of application is running (web server, worker, CLI, etc.)
  2. Capabilities - What system resources the application accesses (network, filesystem, database, etc.)
  3. Attack Surface - Potential security threat vectors based on capabilities
  4. Data Boundaries - Data flow boundaries with sensitivity classification

This semantic layer enables more precise vulnerability prioritization by understanding which code paths are actually reachable from the entrypoint.


Schema Definitions

SemanticEntrypoint

The root type representing semantic analysis of an entrypoint.

interface SemanticEntrypoint {
  id: string;                        // Unique identifier for this analysis
  specification: EntrypointSpecification;
  intent: ApplicationIntent;
  capabilities: CapabilityClass;     // Bitmask of detected capabilities
  attackSurface: ThreatVector[];
  dataBoundaries: DataFlowBoundary[];
  confidence: SemanticConfidence;
  language?: string;                 // Primary language (python, java, node, dotnet, go)
  framework?: string;                // Detected framework (django, spring-boot, express, etc.)
  frameworkVersion?: string;
  runtimeVersion?: string;
  analyzedAt: string;                // ISO-8601 timestamp
}

ApplicationIntent

Enumeration of application types.

ValueDescriptionCommon Indicators
UnknownIntent could not be determinedFallback
WebServerHTTP/HTTPS serverFlask, Django, Express, ASP.NET Core, Gin
WorkerBackground job processorCelery, Sidekiq, BackgroundService
CliToolCommand-line interfaceClick, argparse, Cobra, Picocli
ServerlessFaaS functionLambda handler, Cloud Functions
StreamProcessorEvent stream handlerKafka Streams, Flink
RpcServerRPC/gRPC servergRPC, Thrift
DaemonLong-running serviceCustom main loops
TestRunnerTest executionpytest, JUnit, xunit
BatchJobScheduled/periodic taskCron-style entry
ProxyNetwork proxy/gatewayEnvoy, nginx config

CapabilityClass (Bitmask)

Flags indicating detected capabilities. Multiple flags can be combined.

FlagValueDescription
None0x0No capabilities detected
NetworkListen0x1Binds to network ports
NetworkOutbound0x2Makes outbound network requests
FileRead0x4Reads from filesystem
FileWrite0x8Writes to filesystem
ProcessSpawn0x10Spawns child processes
DatabaseSql0x20SQL database access
DatabaseNoSql0x40NoSQL database access
MessageQueue0x80Message queue producer/consumer
CacheAccess0x100Cache system access (Redis, Memcached)
CryptoSign0x200Cryptographic signing operations
CryptoEncrypt0x400Encryption/decryption operations
UserInput0x800Processes user input
SecretAccess0x1000Reads secrets/credentials
CloudSdk0x2000Cloud provider SDK usage
ContainerApi0x4000Container/orchestration API access
SystemCall0x8000Direct syscall/FFI usage

ThreatVector

Represents a potential attack vector.

interface ThreatVector {
  type: ThreatVectorType;
  confidence: number;                // 0.0 to 1.0
  contributingCapabilities: CapabilityClass;
  evidence: string[];
  cweId?: number;                    // CWE identifier
  owaspCategory?: string;            // OWASP category
}

ThreatVectorType

TypeCWEOWASPTriggered By
SqlInjection89A03:InjectionDatabaseSql + UserInput
CommandInjection78A03:InjectionProcessSpawn + UserInput
PathTraversal22A01:Broken Access ControlFileRead/FileWrite + UserInput
Ssrf918A10:SSRFNetworkOutbound + UserInput
Xss79A03:InjectionNetworkListen + UserInput
InsecureDeserialization502A08:Software and Data IntegrityUserInput + dynamic types
SensitiveDataExposure200A02:Cryptographic FailuresSecretAccess + NetworkListen
BrokenAuthentication287A07:Identification and AuthNetworkListen + SecretAccess
InsufficientLogging778A09:Logging FailuresNetworkListen without logging
CryptoWeakness327A02:Cryptographic FailuresCryptoSign/CryptoEncrypt

DataFlowBoundary

Represents a data flow boundary crossing.

interface DataFlowBoundary {
  type: DataFlowBoundaryType;
  direction: DataFlowDirection;      // Inbound | Outbound | Bidirectional
  sensitivity: DataSensitivity;      // Public | Internal | Confidential | Restricted
  confidence: number;
  port?: number;                     // For network boundaries
  protocol?: string;                 // http, grpc, amqp, etc.
  evidence: string[];
}

DataFlowBoundaryType

TypeSecurity SensitiveDescription
HttpRequestYesHTTP/HTTPS endpoint
GrpcCallYesgRPC service
WebSocketYesWebSocket connection
DatabaseQueryYesDatabase queries
MessageBrokerNoMessage queue pub/sub
FileSystemNoFile I/O boundary
CacheNoCache read/write
ExternalApiYesThird-party API calls
CloudServiceYesCloud provider services

SemanticConfidence

Confidence scoring for semantic analysis.

interface SemanticConfidence {
  score: number;                     // 0.0 to 1.0
  tier: ConfidenceTier;
  reasons: string[];
}

enum ConfidenceTier {
  Unknown = 0,
  Low = 1,
  Medium = 2,
  High = 3,
  Definitive = 4
}
TierScore RangeDescription
Unknown0.0No analysis possible
Low0.0-0.4Heuristic guess only
Medium0.4-0.7Partial evidence
High0.7-0.9Strong indicators
Definitive0.9-1.0Explicit declaration found

SBOM Property Extensions

When semantic data is included in CycloneDX or SPDX SBOMs, the following property namespace is used:

stellaops:semantic.*

Property Names

PropertyTypeDescription
stellaops:semantic.intentstringApplicationIntent value
stellaops:semantic.capabilitiesstringComma-separated capability names
stellaops:semantic.capability.countintNumber of detected capabilities
stellaops:semantic.threatsJSONArray of threat vector summaries
stellaops:semantic.threat.countintNumber of identified threats
stellaops:semantic.risk.scorefloatOverall risk score (0.0-1.0)
stellaops:semantic.confidencefloatConfidence score (0.0-1.0)
stellaops:semantic.confidence.tierstringConfidence tier name
stellaops:semantic.languagestringPrimary language
stellaops:semantic.frameworkstringDetected framework
stellaops:semantic.framework.versionstringFramework version
stellaops:semantic.boundary.countintNumber of data boundaries
stellaops:semantic.boundary.sensitive.countintSecurity-sensitive boundaries
stellaops:semantic.owasp.categoriesstringComma-separated OWASP categories
stellaops:semantic.cwe.idsstringComma-separated CWE IDs

RichGraph Integration

Semantic data is attached to richgraph-v1 nodes via the Attributes dictionary:

Attribute KeyDescription
semantic_intentApplicationIntent value
semantic_capabilitiesComma-separated capability flags
semantic_threatsComma-separated threat types
semantic_risk_scoreRisk score (formatted to 3 decimal places)
semantic_confidenceConfidence score
semantic_confidence_tierConfidence tier name
semantic_frameworkFramework name
semantic_framework_versionFramework version
is_entrypoint“true” if node is an entrypoint
semantic_boundariesJSON array of boundary types
owasp_categoryOWASP category if applicable
cwe_idCWE identifier if applicable

Language Adapter Support

The following language-specific adapters are available:

LanguageAdapterSupported Frameworks
PythonPythonSemanticAdapterDjango, Flask, FastAPI, Celery, Click
JavaJavaSemanticAdapterSpring Boot, Quarkus, Micronaut, Kafka Streams
Node.jsNodeSemanticAdapterExpress, NestJS, Fastify, Koa
.NETDotNetSemanticAdapterASP.NET Core, Worker Service, Console
GoGoSemanticAdapternet/http, Gin, Echo, Cobra, gRPC

Configuration

Semantic analysis is configured via the Scanner:EntryTrace:Semantic configuration section:

Scanner:
  EntryTrace:
    Semantic:
      Enabled: true
      ThreatConfidenceThreshold: 0.3
      MaxThreatVectors: 50
      IncludeLowConfidenceCapabilities: false
      EnabledLanguages: []  # Empty = all languages
OptionDefaultDescription
EnabledtrueEnable semantic analysis
ThreatConfidenceThreshold0.3Minimum confidence for threat vectors
MaxThreatVectors50Maximum threats per entrypoint
IncludeLowConfidenceCapabilitiesfalseInclude low-confidence capabilities
EnabledLanguages[]Languages to analyze (empty = all)

Determinism Guarantees

All semantic analysis outputs are deterministic:

  1. Entrypoint identity - SHA-256 over language, working directory, ENTRYPOINT, and CMD; image digest is deliberately excluded so the same logical entrypoint retains its identity across image versions.
  2. Capability ordering - Flags are ordered by value (bitmask position)
  3. Threat vector ordering - Ordered by ThreatVectorType enum value
  4. Data boundary ordering - Ordered by (Type, Direction) tuple
  5. Evidence ordering - Alphabetically sorted within each element
  6. JSON serialization - Uses camelCase naming, consistent formatting

This enables reliable diffing of semantic analysis results across scan runs.


CLI Usage

Semantic analysis can be enabled via the CLI --semantic flag:

stella scan --semantic docker.io/library/python:3.12

Output includes semantic summary when enabled:

Semantic Analysis:
  Intent: WebServer
  Framework: flask (v3.0.0)
  Capabilities: NetworkListen, DatabaseSql, FileRead
  Threat Vectors: 2 (SqlInjection, Ssrf)
  Risk Score: 0.72
  Confidence: High (0.85)

References