I'm learning ELK stack and want to make first Dashboard in Kibana. Theme of dashboard is…
- User
I'm learning ELK stack and want to make first Dashboard in Kibana. Theme of dashboard is logon events (success and fails). What event IDs of Windows Events and Sysmon should I use to make filters? Give recommendations and other possible sources (elk indexes) maybe. Explain your choose
- Assistant
Creating a dashboard in Kibana to track logon events is a great way to monitor and analyze login activities, helping to identify unauthorized access attempts and other potential security issues. Let's go through the Event IDs and appropriate filters you can use for this purpose, as well as recommendations for additional sources and indexes.
Windows Event IDs
To monitor logon events, you should focus on specific Windows Event IDs that correspond to logon successes and failures:
-
Successful Logon Events:
- Event ID 4624: This event signifies a successful logon. It includes information such as the logon type (network, interactive, etc.), user account name, and domain.
-
Failed Logon Events:
- Event ID 4625: This event indicates a failed logon attempt. Important details such as the reason for the failure, user account involved, and the originating IP address can be found in this event.
Sysmon Event IDs
Sysmon (System Monitor), part of the Sysinternals suite, provides detailed information about system activities.
- Logon Events:
- Sysmon Event ID 10: This event is logged by Sysmon to capture information about process creation, which can be an indirect indicator of logon activity if specific processes correspond to logon scripts or user-initiated actions.
Recommendations for Additional Sources
In addition to Windows and Sysmon events, you may want to include the following sources in your dashboard for a more comprehensive view of logon activities:
-
Security Information and Event Management (SIEM):
- Collecting and correlating data from other security tools like firewalls, intrusion detection systems (IDS), and antivirus software can provide additional context for logon events.
-
Active Directory Logs:
- Policies regarding user accounts, group memberships, and other directory services activity can be pivotal in understanding logon behavior.
-
Network Logs:
- Network traffic logs can help identify unusual logon-related activity over the network, such as logon attempts from unexpected IP addresses.
ELK Indexes
When creating your dashboard, you’ll primarily be working with indexes that store your event data. Usual indexes could be:
- winlogbeat-*: If you use Winlogbeat to ship Windows Event logs to Elasticsearch.
- sysmon-*: If you have dedicated indexes for Sysmon logs.
- network-*: For network logs.
- siem-*: For SIEM-related logs.
You might need to customize this based on your specific environment and how you have configured your Beats or log shippers.
Filters and Visualization
-
Filters:
- For successful logon events: Filter on
event.id:4624. - For failed logon events: Filter on
event.id:4625. - For Sysmon logon activities (if applicable): Filter on
sysmon.event_id:10.
- For successful logon events: Filter on
-
Visualizations:
- Bar Chart: To show the number of successful vs. failed logon attempts over time.
- Pie Chart: For a quick snapshot of the proportion of successful to failed logon attempts.
- Data Table: Show detailed logon/authentication attempts with fields like
user.name,host.name,source.ip. - Geo Map: If you have source IPs, you can map logon attempts geographically.
Dashboard Layout
- Summary Section:
- Total logon attempts, Successful logons, Failed logons.
- Trends and Patterns:
- Time-series graphs for successful and failed logons.
- Geographical Distribution:
- Geolocation map for logon attempts if IPs are available.
- Detailed Logs:
- Tables or lists providing detailed information on logon events.
Conclusion
Using the right Event IDs and combining different log sources can give you a powerful insight into logon activities within your environment. By setting up relevant filters and visualizations in Kibana, you can create an informative and actionable dashboard that helps you monitor and respond to logon incidents effectively. Don’t forget to continuously review and refine your dashboard as your needs evolve and more data sources become available.
-
- User
Give more ideas to use Sysmon for monitor and obtain data about Windows Logon activity (event ID's, another fields like Image, client, etc...)
- Assistant
Sysmon, part of the Sysinternals suite, provides a wealth of information about system activities, which can be instrumental in monitoring Windows logon activities. While Sysmon does not explicitly log logon events (like Windows Security Event Log does with Event IDs 4624 and 4625), it provides valuable context and supplementary data that can help in understanding and correlating logon activities with other system events.
Here are several ways to use Sysmon to monitor and obtain data about Windows logon activity:
Key Sysmon Event IDs and Fields
-
Process Creation (Event ID 1)
- Fields:
Image,CommandLine,User,ParentImage,ParentCommandLine - Use Case: Monitor key processes such as
winlogon.exeorexplorer.exe, which are typically spawned during a logon event. This can help correlate with logon activities logged in the Windows Security Event Log.
- Fields:
-
File Creation Time (Event ID 2)
- Fields:
TargetFilename,CreationUtcTime - Use Case: Identify when critical system files related to logon have been created or modified.
- Fields:
-
Network Connections (Event ID 3)
- Fields:
DestinationIp,DestinationPort,SourceIp,SourcePort,Protocol,Image,User - Use Case: Track network connections made by processes that execute during a logon session. This is especially useful for detecting remote logon attempts or abnormal connections.
- Fields:
-
Service State Change (Event ID 4)
- Fields:
ServiceName,ServiceType,StartType,Image - Use Case: Monitor services that change state during a logon session, such as when a user-initiated service starts.
- Fields:
-
Process Termination (Event ID 5)
- Fields:
Image,User - Use Case: Track the termination of processes related to user logon sessions to understand the lifecycle of user activities.
- Fields:
-
Driver Load (Event ID 6)
- Fields:
ImageLoaded,Signature,Signed - Use Case: Monitor drivers loaded at the time of logon which can be indicative of potentially malicious activities (e.g., rootkits).
- Fields:
-
Image Load (Event ID 7)
- Fields:
ImageLoaded,Image,Signature,Signed,Hashes - Use Case: Detect DLLs loaded into crucial processes like
winlogon.exe,explorer.exe, etc., during a user session.
- Fields:
-
CreateRemoteThread (Event ID 8)
- Fields:
TargetImage,StartAddress,StartModule - Use Case: Identify instances of process injection which might occur during logon, pointing to potential malware or credential dumping activities.
- Fields:
-
Raw Access Read (Event ID 9)
- Fields:
Device,Image - Use Case: Certain malware or forensic tools that read raw disk sectors might trigger this event during or post-logon.
- Fields:
-
Process Access (Event ID 10)
- Fields:
SourceImage,TargetImage,GrantedAccess - Use Case: Monitor when one process accesses another, typically used in activities such as credential harvesting.
- Fields:
-
File Creation (Event ID 11)
- Fields:
TargetFilename,Image,User - Use Case: Track files created by processes that are typically run during logon.
- Fields:
Correlating Event Data
-
User Session Monitoring:
- By correlating
Userfield values from various Sysmon events with Windows Security Event Log (IDs 4624 and 4625), you can map out all activities performed by a user during a logon session.
- By correlating
-
Suspicious Activity Detection:
- Monitor
CommandLinevalues for suspicious commands that might be executed during a logon session (e.g., creation of scheduled tasks, execution of scripts like PowerShell).
- Monitor
-
Unusual Parent/Child Process Relationships:
- Use
ParentImageandParentCommandLinefields to detect abnormal parent-child process relationships indicating potentially malicious activity.
- Use
Building Visualizations & Dashboard
-
Process Activity Timeline:
- Create a timeline of process creation and termination events (
Event ID 1andEvent ID 5) to visualize which processes start and end during user sessions.
- Create a timeline of process creation and termination events (
-
Network Connections Chart:
- Use
Event ID 3to plot network connections made by user processes, highlighting unusual external connections.
- Use
-
Service State Changes:
- Monitor service start and state change logs (
Event ID 4), focusing on those invoked during logon sessions.
- Monitor service start and state change logs (
-
File and Image Loads:
- Highlight suspicious or unfamiliar files and images loaded during logon using
Event ID 7.
- Highlight suspicious or unfamiliar files and images loaded during logon using
-
Process Injection Detection:
- Use a combination of
Event IDs 8and10to detect injection attempts in critical logon processes.
- Use a combination of
By leveraging Sysmon alongside traditional Windows Event Logs, you can gain a comprehensive understanding of activities surrounding user logons, enhancing your ability to detect and respond to anomalous or malicious behavior. Setting up an ELK-based monitoring system to aggregate and analyze this data will provide a robust solution for tracking logon events and associated activities.
-
- User
What index logstash-netflow-* can help to monitor Windows Logon activity? Give ideas (filters for ELK, event id's, addresses and etc..)
- Assistant
NetFlow data is highly useful in network monitoring and analysis as it provides detailed information about IP traffic flows. While NetFlow data by itself may not directly show Windows logon events, it can provide contextual information that helps in identifying and correlating logon activity, especially when users log in remotely.
Below are several ideas and filters for monitoring network activity related to Windows logon events using the
logstash-netflow-*index in an ELK stack.Understanding Network Behavior Associated with Logons
-
Remote Desktop Protocol (RDP) Activity:
- Ports: RDP typically operates over TCP port 3389.
- Filter Example:
destination_port:3389 - Use Case: Detect inbound RDP connections which might indicate remote logon sessions.
-
Virtual Private Network (VPN) Connections:
- VPNs often use various ports and protocols depending on the implementation (e.g., OpenVPN, IPSec).
- Filter Example:
destination_port:1194(commonly used by OpenVPN). Overall, look for VPN-specific traffic. - Use Case: Monitor for VPN connections that might facilitate remote user logons.
-
Windows Logon Scripts/Domain Authentication:
- Ports: Pay attention to common ports used for domain authentication and logon scripts (e.g., Kerberos on TCP/UDP port 88, LDAP on TCP/UDP port 389).
- Filter Example:
destination_port:88 OR destination_port:389 - Use Case: Track traffic to domain controllers which is indicative of domain logon attempts.
Filter Example in Kibana
To filter for network traffic associated with logon activity, you can use KQL (Kibana Query Language) or Lucene queries. Here are some query examples:
-
Monitor RDP Connections:
destination_port:3389 AND (event.action:allowed OR event.action:accept)- Use Case: Showing all allowed RDP connection attempts.
-
VPN Traffic Monitoring:
destination_port:1194 AND (event.action:allowed OR event.action:accept) -
Domain Logon-related Traffic:
(destination_port:88 OR destination_port:389) AND (event.action:allowed OR event.action:accept)
Visualization Ideas for the Kibana Dashboard
-
RDP Logon Attempts:
- Visualization: Line chart or bar chart.
- X-Axis: Timestamp (time-field).
- Y-Axis: Count of events.
- Filters Applied:
destination_port:3389.
-
VPN User Logons:
- Visualization: Pie chart or line chart.
- Split Slices: By destination IP (VPN server IP addresses).
- Filters Applied:
destination_port:1194.
-
Domain Authentication Traffic:
- Visualization: Data table or heat map.
- Columns: Source IP, destination IP, destination port.
- Filters Applied:
destination_port:88 OR destination_port:389.
-
Geolocation of Logon Attempts:
- Visualization: Coordinate map.
- Geo Field: source.geo.location or destination.geo.location.
- Filters Applied: For RDP or VPN traffic as mentioned above.
Aggregating NetFlow Data with Event Logs
Integrating NetFlow monitoring with Windows Event Logs (such as from Winlogbeat) enhances the context. Correlate the logon events (Event ID 4624 for success, 4625 for failure) with NetFlow data:
-
Filter by Event ID:
- Kibana Query:
event_id:4624 OR event_id:4625 - Use Case: Pair successful/failed logon logs with NetFlow data showing the originating IP address.
- Kibana Query:
-
Visualize Correlated Data:
- Create a Line Chart:
- Overlay NetFlow data with Event log data.
- X-Axis: Timestamp.
- Y-Axis: Count of logon events and network flows.
- Filters:
( event_id:4624 OR event_id:4625 ) OR ( destination_port:3389 OR destination_port:1194 OR destination_port:88 OR destination_port:389 )
- Create a Line Chart:
Dashboard Layout Example
- Overview Section:
- Metrics: Total logons (successful and failed), total RDP attempts, total VPN connections.
- Logon Attempt Trends:
- Charts: Time-series for RDP, VPN, and domain authentication traffic.
- Geographical Distribution:
- Maps: Originating IPs for RDP and VPN connections.
- Detailed Logs:
- Tables: Detailed rows showing correlated data from NetFlow and Windows Event Logs.
Using the above queries, filters, and visualizations, you can build an effective Kibana dashboard that combines NetFlow and other log data to monitor Windows logon activity comprehensively. This multi-faceted approach enhances your ability to detect and respond to unusual or unauthorized logon attempts.
-