WebLogic Forensics
Investigate WebLogic environments for anomalies using logs, configuration, and traffic.
It is the process of investigating and analyzing WebLogic Server environments to identify, trace, and understand potential security breaches, performance issues, or system anomalies. It collects and examines server logs, configuration files, and network traffic to detect abnormal behaviour, unauthorized access, or malicious activity.
It also helps identify the root causes of incidents, ensure system integrity, and improve security by detecting vulnerabilities and unauthorized modifications in the WebLogic server infrastructure.
Prerequisites#
Note: The jstack command must be available on the target system. If jstack is unavailable, add it to the environment's variable, PATH.
1. Identify the Java used by WebLogic by executing the below command:
ps -ef|grep -i weblogic|grep java
2. Open the bashrc file using the below command:
vi ~/.bashrc
3. Add the following line to include the stack path till /bin:
export PATH=$PATH:<java_home_path/bin>
4. Save the file.
5. Execute the source command to update the bashrc file:
source ~/.bashrc
Deployment of WebLogic Forensics#
Currently, there are two forensic actions defined for the same "Threads" category of WebLogic as below:
- ThreadDump Jstack
- Thread Hogger Forensics
Since two actions cannot execute at the same time, "Thread Hogger Forensics" is set to 1 by default.
Enable ThreadDump Jstack#
1. Disable the "Thread Hogger Forensics" action by executing the below query in Percona:
update actions set status=1 where identifier='ThreadDump_Jstack';
update actions set status=0 where identifier='Thread Hogger Forensics';
2. Post updating the above change, restart the heal-redis-microservice and make sure that the Redis key is updated with the required status by checking the below key:
hgetall "/accounts/<account_identifier>/categories/AppserverThreads/forensics"
3. Once the status gets updated, forensic action will be enabled.
Forensic script execution#
To execute the script manually, check the usage by executing the below script:
bash weblogic_thread_hogger_forensic.sh --help
All the required script arguments will be taken from Control Center attributes for the WebLogic component.