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.
Properties
| Property | Type | Mode | Description | Required |
|---|---|---|---|---|
| contextId | uuid | stored | Unique identifier for this access context | Required |
| sessionId | string | stored | Associated user session | Required |
| userId | uuid | stored | User making the access request | Required |
| timestamp | DateTime | stored | When the access context was captured | Required |
| ipAddress | string | stored | Source IP address | Required |
| ipReputation | string | stored | IP reputation score and category Example: | Optional |
| location | string | stored | Geographic location data Example: | Optional |
| deviceId | string | stored | Unique device identifier | Optional |
| deviceInfo | string | stored | JSON device characteristics Example: | Optional |
| deviceTrustLevel | integer | stored | Device trust score (0-100) | Optional |
| authenticationMethod | string | stored | How user authenticated Example: | Optional |
| authenticationStrength | string | enum | Strength of authentication Values: | Required |
| mfaVerified | boolean | stored | Whether MFA was completed | Optional |
| networkType | string | enum | Type of network connection Values: | Required |
| networkSecurity | string | stored | Network security assessment Example: | Optional |
| timeOfDay | string | stored | Time category Example: | Optional |
| dayOfWeek | string | stored | Day of the week Example: | Optional |
| timezone | string | stored | User's timezone Example: | Optional |
| behaviorAnalysis | string | stored | JSON behavioral indicators Example: | Optional |
| riskScore | integer | stored | Calculated risk score (0-100) | Optional |
| riskFactors | string | stored | JSON array of identified risks Example: | Optional |
| threatIntelligence | string | stored | External threat data Example: | Optional |
| requestPath | string | stored | Application path or API endpoint Example: | Optional |
| requestMethod | string | stored | HTTP method or operation type Example: | Optional |
| userAgent | string | stored | Browser/application user agent | Optional |
| referrer | string | stored | HTTP referrer if applicable | Optional |
| businessContext | string | stored | Business situation data Example: | Optional |
| environmentType | string | enum | System environment Values: | Required |
| emergencyAccess | boolean | stored | Whether emergency access was requested | Optional |
| parentContextId | uuid | stored | Previous context in session chain | Optional |
| metadata | object | 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
}
}