Graph theory can be exploited to improve cybersecurity. Within networks there are a vast amount of different interactions between users, computers, servers, applications, IP addresses and other transactions. The relationships formed between these entities can be useful in understanding potential security threats. However, traditional methods for monitoring may only analyse individual interactions or devices within the network, meaning it may be difficult to detect suspicious relationships across the whole network.
With graph theory, relationships between different entities in digital environments can be studied to understand suspicious patterns. This means that unusual activities can be found to investigate fraud, coordinated threats and understand how suspicious activity occurs across digital systems. Analyzing relationships in this way can provide a greater understanding of the activity occurring in networks, improving the ability to identify security threats in a timely manner.
Graph Theory in Cybersecurity
Graph theory explores relationships between objects. Graphs consist of nodes (vertices) and edges (relationships). In general contexts, nodes may represent things such as locations, people and organisations, and edges may represent relationships between these, such as roads, friendships and business relationships. Within cybersecurity, nodes can represent digital entities and edges can represent interactions between these.
Nodes may be computers, user accounts, IP addresses, servers, applications and financial transactions. Edges may represent logging in, file transfers, communications and transactions. Graphs allow relationships in activities to be understood, and therefore unusual relationships between entities in large datasets of monitoring information can be identified.

Types of Nodes in Cybersecurity Graphs
Depending on what information is being analysed, graphs can be made up of many different nodes. Within a corporate network, nodes may include user accounts, company computers, cloud applications, internal servers and external IP addresses. If a user logs into an in-house application using a particular computer, the relationship between these three entities can be recorded in a graph. If two servers communicate with each other, this can also be represented by an edge.
In some graphs, additional information is included such as when relationships occurred, the value of transactions, where log-ins occurred, device features and the frequency of communications. This provides more detailed analysis of relationships between entities within a network. It is therefore possible to provide a flexible representation of complex digital environments. By analysing relationships within graphs, security teams can understand the security properties of these environments.
Key Graph Concepts in Cybersecurity
Certain graph theory concepts can be very useful in identifying threats in digital environments. Degree centrality determines the number of relationships an entity has within a graph. This can be used to identify devices, user accounts or servers which have interacted with many other entities. Betweenness centrality identifies how often an entity appears on the shortest path between other entities. This can be used to identify key nodes in the network. Community detection finds groups of closely related nodes. These groups may represent departments, expected communication groups or suspicious activity.
Path analysis allows investigation of the relationships between entities within a graph. This means that security teams can understand how events and relationships occur within different parts of a network. These concepts allow security teams to understand complex information within networks, identify unusual patterns and give priority to certain relationships. However, just because an entity has many relationships or an unusual relationship exists, it does not necessarily mean the entity is malicious. Analysts should take into account normal operation within the organisation and investigate surrounding evidence.
Improving Cybersecurity Monitoring
In traditional cybersecurity monitoring solutions, suspicious activity may be detected through rules, alerts, signatures or individual events. However, when multiple devices, user accounts and activities occur in a coordinated way to form a threat, but individually seem to be innocent, it can be difficult to detect using traditional methods. Using graphs in cybersecurity allows related information to be linked together. Rather than analysing individual log-ins, communications or transactions, relationships between events can be investigated.
For example, multiple user accounts may be accessing an unusual external service from different devices, which also communicates with a previously suspicious server. Investigating individual alerts may not have shown how significant these activities are, however graph analysis can highlight the common links between these activities. This allows analysts to understand patterns of suspicious activity in a broader sense, making it easier to investigate suspicious relationships.
Combining Information from Multiple Sources
When investigating suspicious activity in cyber security, information may be gathered from multiple sources. This may include firewall activity, endpoint protection, identity management solutions, authentication, cloud computing and network monitoring. If this information is investigated separately, it may be difficult to identify links between related events. Using graphs allows information from these sources to be combined based on common entities such as IP addresses, user accounts, device identifiers and times.
If an unusual login was identified in identity management, it can be linked to network activity in the firewall and information from the device in endpoint security. This provides a more detailed view of activity. By using graph based analysis, security professionals can move beyond individual alerts, to understand relationships contributing to suspicious activity.
Detecting Fraud
One of the most useful uses of graph theory in cyber security is detecting fraud in different systems. This may include banking, e-commerce, insurance and online payment systems. Within fraudulent activity, relationships between multiple accounts, devices, people, transactions and payment methods are often present. In traditional fraud detection systems, transactions may be investigated based on factors such as payment value, location, previous account activity and frequency of spending. While this can be useful, it may not detect coordinated activity between multiple seemingly unrelated accounts.
Using graph theory in fraud detection allows customers, accounts, devices, payment method, addresses and transactions to be linked to discover suspicious relationships. If multiple new accounts are using a similar device, or have similar contact details and transacting with a common set of recipients, even if individual transactions seem normal, it is likely that these accounts are involved in co-ordinated fraudulent activity and may require further investigation.
Identifying Suspicious Financial Relationships
Within financial institutions, graph analysis can be used to understand unusual relationships in money transfers between accounts. In this graph, nodes may represent bank accounts, and edges may represent money transfers. Additional information can be added to indicate the value, time and frequency of transfers. This graph can be used to identify groups of accounts that frequently have unusual money transfers between each other, or have common links with previously identified suspicious accounts. For example, multiple accounts may be receiving money from various sources before sending money to a common recipient, indicating a suspicious relationship pattern.
Graph analysis can also be used to identify accounts that have common devices, phone numbers, email addresses or payment details. While this does not necessarily prove fraudulent activity, it can provide useful evidence for analysts to determine if transactions need further investigation. Graph analysis is therefore very useful in detecting organised activity in financial systems that may be difficult to detect in individual transactions.

Identifying Co-ordinated Account Activity
Graph theory is used within online platforms to identify suspicious account creation, abnormal referral patterns and co-ordinated user activity. If multiple accounts are involved in fraudulent activity, they may be using common devices, or similar account details and interaction patterns. By creating a graph of these accounts and their relationships, clusters of users that appear to be working co-ordinately can be identified.
A cluster may be a number of accounts repeatedly interacting with the same products, making similar claims, or performing unusual promotional activity. By using community detection, clusters of highly related users can be identified. By analysing the relationships between users, it can be understood how entities are connected between these groups of users. Graph theory is particularly useful in situations where suspicious accounts have been specifically created to look independent. Rather than focussing on individual user activity, graph analysis looks at a wider picture of user relationships.
Detecting Botnets
Botnets refer to groups of compromised devices connected to the internet which can be controlled by an un-authorised user. These devices may include computers, Routers, servers and IoT devices. Botnets are commonly used to perform DDoS attacks, send spam and other malicious activity. However, it can be difficult to detect these networks due to compromised devices being located in different places and interacting with different external services.
To aid in identification of these threats, graph theory can be used to create connections between devices, IP addresses, domains and communication activity. By analysing patterns of communication, common infrastructure and unusual clusters of devices, suspicious activity can be identified. If multiple devices display similar relationships with suspicious external destinations, they may be part of co-ordinated suspicious network activity and require further investigation.

Unusual Communication Patterns
By using graphs, unusual relationships in botnet activity can be identified. If multiple devices are communicating with the same unknown external destination in a regular interval, or display unusual similarity in communications, it may indicate suspicious activity. A graph can be created to show the relationship between devices based on the common external destinations that they are communicating with. This can allow patterns to be identified that may be difficult to find in individual network logs. Degree analysis can be performed to identify devices with an unusually large number of connections.
Community detection can identify groups of devices with similar communication patterns. A temporal graph can be used to understand how relationships and activity change over time. This can help to identify whether suspicious devices are beginning to link to more systems, or if they display co-ordinated communication. Using these patterns allows security teams to investigate potential botnets in a more efficient manner.
Malware Analysis
Malware analysis is performed to understand the nature, properties and potential impact of malicious software. Graph theory can be used to understand these properties by linking malware to other entities. These may include other files, processes, domains, IP addresses and devices. During malware analysis, it may be useful to understand what files are being accessed by the suspicious programme, what processes it is interacting with, and what external services are associated with the malware.
These relationships can be shown in a graph to provide a clearer insight into the nature of the suspicious software. If two different malware samples display similar relationships to the same suspicious infrastructure, or have common connections to related files and external domains, similarities between threats can be identified. Analysts can therefore investigate if these threats are part of a larger malware campaign.

Understanding Malware Interactions
By Applying Graph Theory to malware analysis, relationships between suspicious software and other entities within the infected environment can be understood. In a process graph, applications, processes, files and network communications may be presented as interconnected entities. By analysing these relationships, it can be understood what activities are associated with the suspicious programme, and if other systems display similar suspicious activity. Relationships between files can indicate connections between suspicious applications and related entities.
Communication graphs can be produced to identify external infrastructure associated with multiple malware samples. These relationships can provide valuable context which may not be seen when analysing individual files. By analysing graphs, malware samples can be categorised based on similar activity. Rather than categorising malware based purely on the name of the file, samples can be grouped based on similar activity. This makes it easier for security teams to investigate related threats and gain a fuller understanding of suspicious software activity.
Improving Threat Intelligence
Threat intelligence involves gathering, analysing and distributing information. This may include suspicious IP addresses, malicious domains, malware indicators, compromised user accounts, known vulnerabilities and previously identified threat groups. However, threat intelligence can be improved by understanding relationships between different indicators. By Applying Graph Theory, relationships between information can be identified.
If a suspicious domain is linked to an IP address, and the IP address is connected to a server that has previously been involved in investigated incidents, a graph can be created. This graph can allow analysts to find further indicators related to the original finding. By identifying relationships between different indicators, investigations can be performed in a more informed manner as the wider context surrounding threats can be analysed.
Understanding Indirect Relationships Between Indicators
A useful feature of using graphs within threat intelligence is the ability to identify indirect relationships between indicators. While two suspicious domains may not appear to be related, they may be using the same infrastructure, or related malware samples. Similarly, while two different security incidents may appear unrelated as they involve different IP addresses, they may have other common properties, for example they may be hosted in the same environment, or be associated with previously identified suspicious accounts.
By traversing through the graph, relationships between indicators can be identified which may not have otherwise been noticed. Therefore graph analysis is very useful in large volumes of information from different organisations and security platforms. Grouping related indicators together allows for investigation of potential relationships between different incidents. A wider context can be gained for emerging threats, meaning more informed decisions can be made regarding security risks.
Network Intrusion Detection
Intrusion detection within networks aims to detect unauthorised access, suspicious communications and activity which may be an attempt to compromise systems. Traditional intrusion detection systems may rely on rules, attack signatures and behavioural indicators to analyse network traffic. However, in more advanced cases, multiple related activities may be taking place which make it difficult to identify suspicious activity from individual alerts. Graph theory can be used to improve intrusion detection by creating relationships between devices, users, services and communications in networks.
This allows security teams to understand how different systems are communicating and identify abnormal relationships. For example, if a workstation typically communicates with only a few internal servers, but suddenly starts communicating with multiple unknown systems, the activity may be suspicious. When coupled with user account activity and other network activity, graph analysis can allow security teams to understand if this activity may be a security risk.
Unusual Relationships in Network Activity
Using graphs within intrusion detection allows an understanding of typical relationships within the organisation. Analysts can understand which devices are typically communicating, which services employees are regularly interacting with and how information is typically passed through networks. If unexpected new relationships occur, or expected relationships change unexpectedly, the activity can be highlighted for investigation. For example, if an employee’s workstation is communicating with a server outside of the usual environment, it may be unusual, especially if it has also had unexpected log-ins, or suspicious activity from an application.
Graph analysis can also identify unusual routes between parts of the network, and highlight devices becoming important in connecting previously separate groups of devices. While these changes may have a legitimate reason in business, understanding surrounding relationships can allow security teams to determine if changes in network activity are expected, or potentially suspicious.
How Graph Based Security Analysis Can Identify Hidden Threats
When performing security monitoring, information may be treated as individual data points. If suspicious log in activity, an unknown IP and unusual file transfers occur, it may be difficult to determine if there is a link between them, as they may be unrelated. However, these activities may be related via the same user account(device or external service). By using graph theory, relationships between these different data points can be identified.
This is very useful for threats involving multiple systems, or occurring over long periods of time. Rather than only detecting problems based on a single suspicious event, multiple related activities can be investigated and it can be determined if they form meaningful patterns. Identifying these patterns in this way will lead to a higher quality investigation. Security teams can therefore detect suspicious activity that may be missed using traditional methods.
Indirect Relationships
Within large digital environments, two suspicious entities may not be directly related, but may be indirectly related via having common devices, user accounts, servers or services. By using graph analysis, these indirect relationships can be identified so that investigators can understand how seemingly unrelated activities may be related. For example, two suspicious log-ins may be associated with different IP addresses, but may be related due to using a common device which has previously been involved in security investigations.
Without analysing the relationship between these data points, this relationship may be overlooked. Graph analysis of this data provides a wider view of how entities are linked. Not all indirect relationships indicate malicious activity, however analysts can gain more context for potential risks, and determine which incidents may require more attention.
Challenges of Graph Theory in Cybersecurity
Despite providing many benefits, graph Based Security Analysis can be challenging to implement. In large organisations, large amounts of information may be recorded from network activity, user authentication, application activity and financial transactions. This can be very demanding in terms of storage space, computational power and analytical tools. As networks grow, the number of nodes and relationships may increase significantly, making it difficult to investigate all relationships in real time.
Security teams must therefore implement effective methods for managing graph data. This should include identifying important relationships, and removing irrelevant information. If poorly designed graphs are implemented, incomplete, duplicate or incorrect data can be recorded, impacting investigation. To implement graph analysis effectively, correct data must be collected, the graph should be appropriately modelled and regular upkeep should be performed to ensure the relationships within reflect accurately.
Quality of Data, Privacy Issues and False Positives
Correct data is very important in graph analysis. If devices, user accounts and communications cannot be accurately related within the organisation, misleading relationships may be identified. Privacy issues may also be considered. If user accounts, customer transactions and personal data are analysed, appropriate permissions must be put in place to ensure security monitoring complies with relevant data privacy requirements.
Graph analysis can also result in false positives. If legitimate activity displays suspicious relationship patterns, it may be highlighted as a potential security issue. For example, a company server may communicate with hundreds of devices as it provides an essential service for business, however this may simply be because of the importance of the service, rather than being a security risk. Therefore, when making important decisions, security professionals must consider the wider context of findings, company security policies and manual investigation.
Using Graph Analysis with Other Security Tools
It can be challenging to implement graph analysis alongside existing security tools. Many organisations will have security information and event management tools, endpoint protection, firewalls, intrusion detection systems, and monitoring systems in the cloud. In order to use graph analysis alongside these tools, there must be clear communication. Inconsistencies in data format, terminology, and identifiers between different tools can make it difficult to accurately link data from different systems.
Skilled personnel with knowledge of graph modelling, network security and linking data in networks may be required. However, graph analysis can be used to supplement existing security tools. If well integrated, graph analysis can improve investigation by giving a deeper level of analysis, helping analysts spot abnormal patterns and improve the overall effectiveness of monitoring. This means that investigations can be made easier by seeing how alerts relate to each other.
Future Uses of Graph Theory in Cybersecurity
As more interconnectivity occurs in businesses, and more data is generated, graph theory will become increasingly important in cybersecurity. The increase in cloud computing, IoT devices, remote working environments and interconnectivity of business applications increases the amount of relationships to be monitored. Therefore, understanding how different devices/accounts interact with each other becomes very important.
Graph analysis can help in this instance by displaying complex relationships in an easily analysable format. With improvements to analysis tools, graph-based security tools may be able to analyse anomalies in network communities, link previously unrelated alerts, and spot changes in digital environments which may be suspicious. As a result, organizations may be able to gain greater insight into security threats, and efficiently deal with new threats.
Combining with AI and Machine Learning
Graph based cybersecurity can be improved by combining AI and Machine Learning. Algorithms can be applied to graphs to identify strange relationships, categorise suspicious activity in networks, and identify patterns related to previously investigated threats. Graph Neural Networks in particular can be trained based on the features of individual nodes, and relationships between nodes. Within cyber security, this can mean that suspicious devices, abnormal relationships between accounts, or potentially fraudulent networks of transactions can be identified.
AI can allow analysts to prioritise alerts based on the importance of linked entities and the wider context of the alert. However, quality data, suitable training and human oversight is required. Findings from automated graph analysis should not be taken as definite, but as clues into potential investigations. Particularly if decisions are being made regarding security in ways that may impact users, staff and key business functions.
Conclusion
Graph theory allows cybersecurity professionals to gain insights from complex data relationships. By creating a graph, where nodes represent users, devices, IP addresses, transactions, applications and communications, patterns can be identified which would be difficult to find using standard monitoring techniques. Graph analysis has many applications in cyber security, such as identifying fraud, botnets, malware, threat intelligence and network intrusion. It helps identify common relationships, abnormal communities within networks, patterns of communication, and relationships between unrelated security events.
Despite challenges relating to data quality, scalability, privacy and false positives, graph theory can be very useful to combine with other cybersecurity tools and investigations by professionals. As networks within businesses grow, identifying relationships between parts of these networks will become increasingly important to identify suspicious activity, investigate new threats and protect systems and information in businesses.



