Security Configuration

Configuration properties for the Contexa security engine, including Zero Trust, HCAD detection, and SecurityPlane agent settings.

Zero Trust Properties

Properties under security.zerotrust, bound to SecurityZeroTrustProperties. These settings control the Zero Trust decision mode, core thresholds, hot-path handling, cache windows, and request-tracking behavior. HCAD is configured separately under the hcad prefix.

See the full property reference on the main Configuration page.

Related: Zero Trust Flow

HCAD Properties

Properties under the hcad prefix, bound to HcadProperties. Configures the Hierarchical Context-Aware Detection (HCAD) filter pipeline and baseline learning.

Property Type Default Description
hcad
.enabled boolean true Enable or disable the HCAD filter pipeline.
.filter-order int 100 HCAD filter order in the servlet filter chain.
hcad.resource
.sensitive-patterns List<String> [] URL patterns for sensitive resources requiring enhanced analysis.
hcad.analysis
.max-age-ms long 3600000 Maximum age (ms) for cached analysis results.
hcad.threshold
.base double 0.7 Base anomaly detection threshold.
.min double 0.3 Minimum threshold after adaptive adjustment.
.max double 0.95 Maximum threshold after adaptive adjustment.
.adjustment-rate double 0.01 Rate of threshold adaptation per feedback cycle.
.sensitivity double 1.0 Global sensitivity multiplier for detection.
.warn double 0.7 Warning threshold before block action.
hcad.cache
.max-size int 100000 Maximum number of cached analysis entries.
.ttl-ms long 300000 Cache entry time-to-live in milliseconds.
.clear-on-startup boolean false Clear all cache entries on application startup.
.local.ttl-minutes int 10 Local cache TTL in minutes.
hcad.baseline
.min-confidence double 0.3 Minimum confidence for baseline data.
.update-alpha double 0.1 Exponential moving average alpha for baseline updates.
.learning.enabled boolean true Enable baseline learning from live traffic.
.learning.alpha double 0.1 Online baseline adaptation learning rate.
.bootstrap.enabled boolean true Enable bootstrap mode for initial baseline building.
.bootstrap.initial-samples int 10 Number of initial samples required before enforcement.
.bootstrap.max-anomaly-score double 0.85 Maximum anomaly score during bootstrap phase.
.statistical.enabled boolean true Enable statistical baseline analysis.
.statistical.min-samples int 20 Minimum samples for statistical analysis.
.statistical.z-score-threshold double 3.0 Z-score threshold for outlier detection.
.redis.ttl-days int 30 Redis baseline data TTL in days.
hcad.feedback
.learning-rate double 0.1 Feedback loop learning rate for threshold adjustment.
.retrain-threshold double 0.7 Accuracy threshold triggering model retrain.
.window-size int 1000 Sliding window size for feedback collection.
hcad.orchestrator
.enabled boolean true Enable the HCAD orchestrator for coordinated analysis.
.feedback-interval int 300 Feedback processing interval in seconds.
.sync-batch-size int 50 Batch size for baseline synchronization.
hcad.vector
.embedding-dimension int 384 Embedding vector dimension for behavioral analysis.
.similarity-threshold double 0.85 Similarity threshold for behavioral pattern matching.
.scenario-detection-enabled boolean true Enable scenario-based anomaly detection via vectors.
hcad.session
.cookie-name String JSESSIONID Session cookie name for HCAD tracking.
.header-name String X-Session-Id Header name for session ID in stateless mode.
hcad.signal
.chi-square-threshold double 14.07 Chi-square threshold for signal anomaly detection.
.history-size int 100 Number of historical signals to retain.
.geoip.provider String api GeoIP provider: api or local.
hcad.adaptive
.adjustment-rate double 0.1 Adaptive threshold adjustment rate.
.cusum.threshold double 5.0 CUSUM change-point detection threshold.
.cusum.slack double 0.5 CUSUM slack parameter for drift tolerance.
.baseline.window int 100 Adaptive baseline window size.
hcad.geoip
.enabled boolean false Enable GeoIP-based location analysis.
.db-path String data/GeoLite2-City.mmdb Path to MaxMind GeoLite2 database file.
hcad.redis
.key-prefix String hcad:baseline:v2: Redis key prefix for HCAD baseline data.

Additional HCAD Fields in Current OSS Code

PropertyDefaultDescription
hcad.baseline.statistical.update-interval10Refresh interval for the statistical baseline.
hcad.feedback.baseline.update-threshold0.95Threshold for writing feedback into the learned baseline.
hcad.orchestrator.performance-trackingtrueEnable orchestrator performance tracking.
hcad.vector.cache-ttl-hours24TTL for cached behavioral embeddings.
hcad.vector.max-cached-embeddings1000Maximum cached embedding entries.
hcad.signal.covariance.min-samples30Minimum samples for covariance analysis.
hcad.signal.geoip.api-urlhttps://ipapi.co/{ip}/json/Remote GeoIP API template.
hcad.signal.timing.bucket-count7Timing bucket count.
hcad.signal.timing.interval.history-size100Timing interval history size.
hcad.sampling.random.floor0.01Minimum random sampling rate.
hcad.sampling.random.ceiling0.03Maximum random sampling rate.
hcad.sampling.composite.identifier.enabledtrueEnable composite identifier sampling.
hcad.similarity.hot-path-threshold0.7Similarity threshold used by hot-path decisions.
hcad.adaptive.min.trust.score0.7Minimum trust score used by adaptive controls.
hcad.pre-trigger.enabledtrueEnable pre-trigger heuristics before full analysis.
hcad.pre-trigger.cooldown-seconds15Cooldown for repeated pre-triggers.
hcad.pre-trigger.in-flight-ttl-seconds15TTL for in-flight pre-trigger markers.
hcad.pre-trigger.negative-cache-seconds3Negative cache lifetime.
hcad.pre-trigger.redline-score70Redline score threshold.
hcad.pre-trigger.high-risk-score50High-risk score threshold.
hcad.pre-trigger.medium-risk-score30Medium-risk score threshold.
hcad.pre-trigger.low-baseline-confidence-threshold0.35Low baseline confidence threshold.
hcad.pre-trigger.failed-login-burst-threshold3Failed-login burst threshold.
hcad.pre-trigger.request-burst-threshold12Request burst threshold.
hcad.pre-trigger.rapid-request-interval-ms1000Rapid-request interval window.

Example Configuration

YAML
hcad:
  enabled: true
  filter-order: 100
  resource:
    sensitive-patterns:
      - /admin/api/security-test/sensitive/**
      - /admin/api/security-test/critical/**
  threshold:
    base: 0.7
    sensitivity: 1.0
  baseline:
    learning:
      enabled: true
      alpha: 0.1
    bootstrap:
      enabled: true
      initial-samples: 10
  geoip:
    enabled: false
    db-path: data/GeoLite2-City.mmdb

Security Plane Properties

Properties under security.plane, bound to SecurityPlaneProperties. The class configures the distributed security-plane agent, Kafka topics, Redis relay settings, monitoring batches, deduplication windows, and the LLM executor pool used by asynchronous security analysis.

Property Type Default Description
security.plane.agent
.nameStringSecurityPlaneAgent-1Agent instance name
.auto-startbooleantrueAuto-starts the agent on boot
.organization-idStringdefault-orgOrganization identifier for distributed deployments
.execution-modeStringASYNCAgent execution mode
.auto-approve-low-riskbooleanfalseAutomatically approves low-risk decisions when enabled
.event-timeout-mslong30000Per-event processing timeout
.max-deferred-retriesint3Deferred retry limit for agent processing
security.plane.kafka
.bootstrap-serversStringlocalhost:9092Kafka bootstrap servers
.group-idStringsecurity-plane-consumerKafka consumer group id
.topics.security-eventsStringsecurity-eventsSecurity event topic
.topics.threat-indicatorsStringthreat-indicatorsThreat indicator topic
.topics.network-eventsStringnetwork-eventsNetwork event topic
.topics.auth-eventsStringauth-eventsAuthentication event topic
security.plane.monitor
.queue-sizeint10000Event queue capacity
.batch-sizeint8Monitoring batch size
.flush-interval-mslong500Batch flush interval
.correlation-window-minutesint10Correlation window size
.dedup-window-minutesint5Deduplication time window
security.plane.notifier
.batch-sizeint10Notification batch size
.async-enabledbooleantrueEnable async notification dispatch
.critical-thresholddouble0.8Critical alert threshold
security.plane.redis
.batch-sizeint50Redis publish batch size
.cache.ttl-minutesint60Redis relay cache TTL
.channel.security-eventsStringsecurity:eventsRedis security event channel
.channel.threat-alertsStringsecurity:threatsRedis threat alert channel
security.plane.llm-executor
.core-pool-sizeint2Core thread pool size for LLM analysis
.max-pool-sizeint2Maximum thread pool size for LLM analysis
.queue-capacityint50Queue capacity for pending LLM work
security.plane.deduplication
.enabledbooleantrueDeduplication toggle
.window-minutesint5Deduplication window size
.cache-sizeint10000Deduplication cache size
YAML
security:
  plane:
    agent:
      name: SecurityPlaneAgent-1
      auto-start: true
      organization-id: default-org
      execution-mode: ASYNC
      auto-approve-low-risk: false
      event-timeout-ms: 30000
      max-deferred-retries: 3
    llm-executor:
      core-pool-size: 2
      max-pool-size: 2
      queue-capacity: 50
    deduplication:
      enabled: true
      window-minutes: 5
      cache-size: 10000

Related: Zero Trust Flow, SOAR Reference

Session Security Properties

Properties under security.session, bound to SecuritySessionProperties. The OSS class configures token creation, header and bearer token extraction, hijack notification wiring, cookie naming, and risk thresholds used by session anomaly evaluation.

Property Type Default Description
security.session.create.allowedbooleantrueAllows session/token creation
security.session.header.nameStringX-Auth-TokenHeader name for token transport
security.session.bearer.enabledbooleantrueEnables bearer token parsing
security.session.cookie.nameStringSESSIONCookie name used for session transport
security.session.hijack.channelStringsecurity:session:hijack:eventHijack event channel name
security.session.hijack.detection.enabledbooleantrueHijack detection toggle
security.session.threat.ip-change-riskdouble0.4Risk contribution for IP changes
security.session.threat.ua-change-riskdouble0.3Risk contribution for user-agent changes
security.session.threat.rapid-access-threshold-msint100Rapid-access threshold window
security.session.threat.rapid-access-riskdouble0.2Risk contribution for rapid access bursts
security.session.threat.thresholds.monitoringdouble0.5Monitoring threshold
security.session.threat.thresholds.grace-perioddouble0.7Grace-period threshold
security.session.threat.thresholds.invalidationdouble0.9Invalidation threshold

Related: State Management Reference