MBA-715: Implement session management and NIST 800-53 IA-11 compliant re-authentication - #29
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
… re-authentication This commit implements standalone session management classes for the USPTO Patent Public Data project, creating the foundation for session lifecycle management that can integrate with future web frameworks (Part 1.1) and authentication systems (Part 1.2). Key features: - Session model with NIST IA-11 compliance fields for re-authentication tracking - SessionManager as main orchestrator for session lifecycle - SessionStore interface with InMemorySessionStore implementation - Re-authentication triggers for time-based expiration, privilege escalation, and security attribute changes - Cryptographically secure session ID generation using SecureRandom - AES/GCM encryption for sensitive session data - Session hijacking prevention with IP and User-Agent binding - Concurrent session management - Comprehensive test coverage for security-specific scenarios Package structure: - gov.uspto.session.model: Session, SessionState, ReauthReason - gov.uspto.session.management: SessionManager, SessionStore, SessionFactory, SessionValidator - gov.uspto.session.reauth: ReauthenticationPolicy, ReauthenticationTrigger, PrivilegeChangeDetector, SessionTimeoutManager - gov.uspto.session.security: SessionToken, SessionEncryption, SessionIdGenerator, SessionHijackingPrevention - gov.uspto.session.lifecycle: SessionCreationService, SessionTerminationService, SessionRenewalService, ConcurrentSessionManager Dependencies added: - BouncyCastle bcprov-jdk15on 1.70 for cryptographic operations Co-Authored-By: Jake Cosme <jake@cognition.ai>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MBA-715: Implement session management with NIST 800-53 IA-11 compliance
Summary
This PR implements standalone session management classes for the USPTO Patent Public Data project, creating the foundation for session lifecycle management that can integrate with future web frameworks (Part 1.1) and authentication systems (Part 1.2).
The implementation adds 20+ Java classes organized into four packages under
gov.uspto.session.*:Session Model & Management: Core
Sessionentity with NIST IA-11 compliance fields,SessionManagerorchestrator,SessionStoreinterface withInMemorySessionStoreimplementation,SessionFactory, andSessionValidator.Re-authentication:
ReauthenticationPolicyfor configurable policies,ReauthenticationTriggerfor event handling,PrivilegeChangeDetector(placeholder for Part 1.2), andSessionTimeoutManagerfor timeout-based re-auth.Security:
SessionIdGeneratorusing SecureRandom for cryptographically secure IDs,SessionEncryptionwith AES/GCM for sensitive data,SessionHijackingPreventionwith IP/User-Agent binding, andSessionTokenfor token representation.Lifecycle:
SessionCreationService,SessionTerminationService,SessionRenewalService, andConcurrentSessionManagerfor managing concurrent sessions per user.Added BouncyCastle 1.70 dependency for cryptographic operations.
Review & Testing Checklist for Human
SessionEncryption.javaAES/GCM implementation - check IV generation (12 bytes), tag length (128 bits), key handling, and that the encrypt/decrypt cycle is secureSessionIdGenerator.java- verify SecureRandom usage and that theisValidSessionIdFormatmethod correctly handles prefixed IDs with Base64 URL encoding (which uses_characters)SessionHijackingPrevention.java- the default uses /24 subnet comparison which may be too permissive or restrictive depending on use caseInMemorySessionStoreandConcurrentSessionManagerhandle concurrent access correctlyRecommended test plan: Run
mvn test -pl Common -Dtest="gov.uspto.session.**"to execute all 73 session management tests. Review test coverage for edge cases in encryption and session validation.Notes
PrivilegeChangeDetectorcontains placeholder methods that will need implementation when Part 1.2 is availableList.of()withCollections.singletonList()andOptional.isEmpty()with!Optional.isPresent()Link to Devin run: https://app.devin.ai/sessions/956471a358924eb59362bd288558e7fb
Requested by: Jake Cosme (jake@cognition.ai) / @jakexcosme