AccessContext

Captures the complete environmental and situational context in which an access request occurs, providing crucial information for context-aware authorization decisions. This entity represents the 'circumstances' of access - not just who wants what, but when, where, how, and under what conditions. It includes technical context (IP address, device, browser), temporal context (time of day, day of week, timezone), geographic context (location, jurisdiction), behavioral context (access patterns, risk indicators), and business context (project phase, emergency status). Modern zero-trust architectures use this rich context to make dynamic authorization decisions - the same user might be granted access from the office during business hours but denied from an unknown location at midnight. The context enables adaptive security where access requirements change based on threat level, implements conditional access policies ('require MFA from untrusted networks'), and supports compliance requirements ('EU data only accessible from EU locations'). It captures session information, authentication strength, device trust level, and network security posture. The entity also tracks anomalies and risk signals that might indicate compromised credentials or insider threats. This contextual awareness transforms static permission checks into dynamic, risk-based access decisions that adapt to changing security landscapes and business needs.

31 properties
Schema

Properties

PropertyTypeModeDescriptionRequired
contextIduuid
stored

Unique identifier for this access context

Required
sessionIdstring
stored

Associated user session

Required
userIduuid
stored

User making the access request

Required
timestampDateTime
stored

When the access context was captured

Required
ipAddressstring
stored

Source IP address

Required
ipReputationstring
stored

IP reputation score and category

Example: "{\"score\":85,\"category\":\"corporate\",\"threat_level\":\"low\"}"

Optional
locationstring
stored

Geographic location data

Example: "{\"country\":\"US\",\"region\":\"California\",\"city\":\"San Francisco\",\"coordinates\":{\"lat\":37.7749,\"lng\":-122.4194}}"

Optional
deviceIdstring
stored

Unique device identifier

Optional
deviceInfostring
stored

JSON device characteristics

Example: "{\"type\":\"laptop\",\"os\":\"macOS 14.2\",\"browser\":\"Chrome 120\",\"managed\":true,\"compliant\":true}"

Optional
deviceTrustLevelinteger
stored

Device trust score (0-100)

Optional
authenticationMethodstring
stored

How user authenticated

Example: "mfa_biometric"

Optional
authenticationStrengthstring
enum

Strength of authentication

Values: none, weak, medium, strong, very_strong

Required
mfaVerifiedboolean
stored

Whether MFA was completed

Optional
networkTypestring
enum

Type of network connection

Values: corporate, vpn, public, home, mobile, unknown

Required
networkSecuritystring
stored

Network security assessment

Example: "{\"encrypted\":true,\"vpn\":true,\"firewall\":\"enabled\",\"proxy\":false}"

Optional
timeOfDaystring
stored

Time category

Example: "business_hours"

Optional
dayOfWeekstring
stored

Day of the week

Example: "monday"

Optional
timezonestring
stored

User's timezone

Example: "America/New_York"

Optional
behaviorAnalysisstring
stored

JSON behavioral indicators

Example: "{\"typical_location\":true,\"typical_time\":false,\"access_velocity\":\"normal\",\"pattern_match\":0.87}"

Optional
riskScoreinteger
stored

Calculated risk score (0-100)

Optional
riskFactorsstring
stored

JSON array of identified risks

Example: "[\"new_device\",\"unusual_time\",\"sensitive_operation\"]"

Optional
threatIntelligencestring
stored

External threat data

Example: "{\"ip_blocklist\":false,\"known_attacker\":false,\"threat_campaign\":null}"

Optional
requestPathstring
stored

Application path or API endpoint

Example: "/api/v1/financial/transactions"

Optional
requestMethodstring
stored

HTTP method or operation type

Example: "POST"

Optional
userAgentstring
stored

Browser/application user agent

Optional
referrerstring
stored

HTTP referrer if applicable

Optional
businessContextstring
stored

Business situation data

Example: "{\"project_phase\":\"production\",\"change_freeze\":false,\"audit_mode\":true}"

Optional
environmentTypestring
enum

System environment

Values: development, testing, staging, production

Required
emergencyAccessboolean
stored

Whether emergency access was requested

Optional
parentContextIduuid
stored

Previous context in session chain

Optional
metadataobject
stored

Additional context data

Optional

Examples

Example 1

{
  "@type": "AccessContext",
  "contextId": "ctx_abc123",
  "sessionId": "sess_xyz789",
  "userId": "user_john_doe",
  "timestamp": "2024-03-15T14:30:00Z",
  "ipAddress": "203.0.113.42",
  "ipReputation": "{\"score\":95,\"category\":\"corporate\",\"threat_level\":\"low\",\"asn\":\"AS12345\"}",
  "location": "{\"country\":\"US\",\"region\":\"California\",\"city\":\"San Francisco\",\"coordinates\":{\"lat\":37.7749,\"lng\":-122.4194},\"accuracy\":\"city\"}",
  "deviceId": "device_laptop_001",
  "deviceInfo": "{\"type\":\"laptop\",\"os\":\"Windows 11\",\"browser\":\"Edge 120\",\"managed\":true,\"compliant\":true,\"patch_level\":\"current\"}",
  "deviceTrustLevel": 90,
  "authenticationMethod": "passwordless_biometric",
  "authenticationStrength": "very_strong",
  "mfaVerified": true,
  "networkType": "corporate",
  "networkSecurity": "{\"encrypted\":true,\"vpn\":false,\"firewall\":\"enabled\",\"nac\":\"passed\"}",
  "timeOfDay": "business_hours",
  "dayOfWeek": "wednesday",
  "timezone": "America/Los_Angeles",
  "behaviorAnalysis": "{\"typical_location\":true,\"typical_time\":true,\"access_velocity\":\"normal\",\"pattern_match\":0.94,\"anomaly_score\":5}",
  "riskScore": 15,
  "riskFactors": "[]",
  "requestPath": "/api/v1/reports/financial",
  "requestMethod": "GET",
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
  "businessContext": "{\"quarter_end\":false,\"audit_period\":false,\"normal_operations\":true}",
  "environmentType": "production",
  "emergencyAccess": false,
  "metadata": {
    "session_age_minutes": 45,
    "requests_in_session": 23
  }
}

Example 2

{
  "@type": "AccessContext",
  "contextId": "ctx_risk_456",
  "sessionId": "sess_suspicious_001",
  "userId": "user_contractor",
  "timestamp": "2024-03-15T02:45:00Z",
  "ipAddress": "198.51.100.99",
  "ipReputation": "{\"score\":45,\"category\":\"vpn_exit\",\"threat_level\":\"medium\",\"anonymous_proxy\":true}",
  "location": "{\"country\":\"RO\",\"region\":\"Bucharest\",\"city\":\"Bucharest\",\"vpn_detected\":true}",
  "deviceId": null,
  "deviceInfo": "{\"type\":\"unknown\",\"os\":\"Linux\",\"browser\":\"Firefox 115\",\"managed\":false,\"compliant\":false}",
  "deviceTrustLevel": 20,
  "authenticationMethod": "password_only",
  "authenticationStrength": "weak",
  "mfaVerified": false,
  "networkType": "public",
  "networkSecurity": "{\"encrypted\":true,\"vpn\":true,\"firewall\":\"unknown\",\"tor_exit\":false}",
  "timeOfDay": "after_hours",
  "dayOfWeek": "saturday",
  "timezone": "Europe/Bucharest",
  "behaviorAnalysis": "{\"typical_location\":false,\"typical_time\":false,\"access_velocity\":\"high\",\"pattern_match\":0.23,\"anomaly_score\":78}",
  "riskScore": 85,
  "riskFactors": "[\"new_device\",\"unusual_location\",\"vpn_usage\",\"after_hours\",\"weak_auth\",\"high_velocity\"]",
  "threatIntelligence": "{\"ip_blocklist\":false,\"known_attacker\":false,\"suspicious_asn\":true}",
  "requestPath": "/api/v1/data/export",
  "requestMethod": "POST",
  "userAgent": "Mozilla/5.0 (X11; Linux x86_64) Firefox/115.0",
  "businessContext": "{\"contractor_active\":true,\"contract_expires\":\"2024-04-01\"}",
  "environmentType": "production",
  "emergencyAccess": false,
  "metadata": {
    "alert_triggered": true,
    "security_review_required": true
  }
}