ML-Based Security Event Detection in Code
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Inadequate security logging in programming code hinders the ability to reconstruct security breaches and maintain effective software security, as programmers often fail to include logging statements for security events.
Innovation Solution
A computer-implemented method using a trained machine learning model to analyze programming code, generate tokens, and determine whether the code contains security events, thereby automatically adding security logging statements where necessary.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If programmers manually review and add logging statements to code, then security logging coverage can be improved, but this approach is time-consuming and often fails to achieve comprehensive coverage
Solution Approach 1:
The patent replaces manual mechanical code review with an automated machine learning-based analysis system. The ML model automatically scans code, identifies security events, and generates logging statements without human intervention, thereby eliminating time loss while improving logging coverage reliability.
Solution Approach 2:
The system enables code to self-identify security events and self-generate appropriate logging statements through automated analysis. The ML model processes code independently, detecting security-relevant operations and automatically creating logging infrastructure without requiring programmer action.
2Reliability
If comprehensive security logging is implemented manually, then security event detection capability improves, but code complexity and development effort increase
Solution Approach 1:
The patent extracts the complexity of security logging implementation from the main codebase by using an external ML analysis system. The ML model handles the complex task of identifying security events and generating logging statements separately, leaving the main code clean and simple while still achieving comprehensive security monitoring.
Solution Approach 2:
The ML-based analysis system acts as an intermediary between the code and security logging requirements. Instead of directly complicating the code with logging statements, the intermediary automatically analyzes and generates appropriate logging infrastructure, simplifying the overall system while improving detection capability.
3Reliability
If security logging statements are added to all code, then complete security audit trail is achieved, but code maintainability and readability decrease
Solution Approach 1:
The patent applies logging statements selectively based on local code characteristics. The ML model analyzes each code segment and adds logging only where security events occur, rather than uniformly throughout the codebase. This localized approach maintains complete audit trails while preserving code readability and maintainability in non-security-critical sections.
Solution Approach 2:
Instead of adding logging statements to all code by default, the system inverts the approach by using ML to identify only the specific locations where logging is necessary. This inversion reduces unnecessary logging overhead while ensuring complete coverage of security-relevant operations, thereby maintaining code quality.
Data Source
AI summary
A trained machine learning model can determine whether a portion of programming code contains a security event. The determination can be included in a security assessment. The category of security event can also be determined. During training, observed portions of programming code labeled according to whether they contain a security event and the category of security event can be tokenized. Vectors can be generated from the tokens. The machine learning model can generate a new vector for an incoming portion of programming code and compare against combined vectors for the observed portions of programming code. A security assessment can indicate whether the incoming portion of programming code contains a security event, the category of the event, or both. For training purposes, security logging statements can be removed from training code.


