Commit Graph

1245 Commits

Author SHA1 Message Date
Czar Echavez
f2d7a2fc16 #2257: added way to ensure nodes are on at start + more test to make sure nodes are on when added via config 2024-02-26 14:34:34 +00:00
Czar Echavez
d738a23709 #2257: list of db payloads 2024-02-26 11:35:17 +00:00
Czar Echavez
634f634097 #2257: fix text and make examples in node configs more specific 2024-02-26 09:47:12 +00:00
Czar Echavez
e964b8a3ea #2257: more in depth changelog 2024-02-26 08:58:03 +00:00
Czar Echavez
1d5c153752 #2257: changelog update 2024-02-26 08:49:11 +00:00
Czar Echavez
07373d941e #2257: Downgrade version of sphinx - 7.2.0 drops support for Python 3.8 2024-02-26 08:44:08 +00:00
Czar Echavez
fb148dc4fb #2257: applications and services docs 2024-02-23 16:49:01 +00:00
Czar Echavez
ef61fe219c Merge remote-tracking branch 'origin/dev' into feature/2257-router-routes-cannot-be-represented-in-config-file 2024-02-23 08:56:35 +00:00
Czar Echavez
5836ea68e3 #2257: rearrange software pages + creating a list of applications and services which is hopefully a single point that should be referred to 2024-02-23 08:55:32 +00:00
Czar Echavez
98fb28cbbc #2257: setting up application and service docs 2024-02-21 18:19:16 +00:00
Czar Echavez
deb7a3aa9d #2257: massive docs addition for config file 2024-02-21 14:49:59 +00:00
Marek Wolan
8f85555709 Merged PR 278: Enable the red agent to vary its start node
## Summary
- Made the data manipulation red agent be able to choose between the two clients to start operating on
- changed the attacker name in the config to 'data_manipulation_attacker' to because it is no longer tied to any client
- Updated the documentation notebook accordingly.
- Fixed a bug where the database client made a new connection every time it sent a SQL query (it tries to reuse its most recent one instead)
- Fixed a bug where link loads were not being cleared between episodes (?)

**warning** - the green agents are not working properly after reset right now, but I'm gonna fix this in the next ticket where I refactor episode reset.

## Test process
- unit tests pass
- UC2 notebook passes with both clients. (currently this doesn't work after an episode reset, but the very next thing I'm gonna work on is refactoring the reset, so I don't want to waste time fixing this.)

## Checklist
- [x] PR is linked to a **work item**
- [x] **acceptance criteria** of linked ticket are met
- [x] performed **self-review** of the code
- [x] written **tests** for any new functionality added with this PR
- [ ] updated the **documentation** if this PR changes or adds functionality
- [ ] written/updated **design docs** if this PR implements new functionality
- [x] updated the **change log**
- [x] ran **pre-commit** checks for code style
- [n] attended to any **TO-DOs** left in the code

Related work items: #2232
2024-02-20 20:22:20 +00:00
Marek Wolan
88f8e9cb42 Add todo comment. 2024-02-20 12:09:32 +00:00
Marek Wolan
f7c1da3118 Update MARL config. 2024-02-20 12:06:30 +00:00
Marek Wolan
76db5dbaa2 Update changelog 2024-02-20 12:05:02 +00:00
Marek Wolan
4a3c66bdc6 Clear notebook code cells. 2024-02-20 12:04:07 +00:00
Marek Wolan
701781b23e Clear link load in new timestep 2024-02-20 11:05:09 +00:00
Marek Wolan
945db1341b Make database client try to use most recent connection instead of generating new one 2024-02-20 11:04:53 +00:00
Czar Echavez
2e2d83c3e9 #2257: update sphinx version + cleaning up some errors + splitting configuration page into multiple pages 2024-02-16 16:14:36 +00:00
Czar Echavez
e390d8385c #2257: acl tests 2024-02-15 16:29:36 +00:00
Czar Echavez
48d7f9f85a Merge remote-tracking branch 'origin/dev' into feature/2257-router-routes-cannot-be-represented-in-config-file 2024-02-15 15:45:44 +00:00
Czar Echavez
b739823318 #2257: add firewall via config + fix router hop ip address + shuffling around tests 2024-02-15 15:45:18 +00:00
Czar Echavez
23a56ca59f Merged PR 270: #2258: DoSBot cannot be added via configuration file
## Summary
- Added ability to set DoSBot in nodes via config file
- Fixed missing configuration items in other services/applications
- Created a variable which contains the list of applications and services
- Moved `DatabaseClient` from list of services to list of applications

## Test process
Created a configuration file where a node has all services and applications installed, this is then used by an integration test which loads the configuration file. The test checks to make sure that the configuration file is correctly read and the Service and Application objects are properly created

## Checklist
- [X] PR is linked to a **work item**
- [ ] **acceptance criteria** of linked ticket are met
- [X] performed **self-review** of the code
- [X] written **tests** for any new functionality added with this PR
- [ ] updated the **documentation** if this PR changes or adds functionality
- [ ] written/updated **design docs** if this PR implements new functionality
- [ ] updated the **change log**
- [ ] ran **pre-commit** checks for code style
- [ ] attended to any **TO-DOs** left in the code

Related work items: #2258
2024-02-15 09:36:08 +00:00
Nick Todd
0af2eef89c Merged PR 274: Add INSERT query functionality into database service.
## Summary
Add support for SQL INSERT query in database_service.py.

## Test process
Updated test_database_on_node.py to test for database INSERTions.

## Checklist
- [X] PR is linked to a **work item**
- [X] **acceptance criteria** of linked ticket are met
- [X] performed **self-review** of the code
- [X] written **tests** for any new functionality added with this PR
- [X] updated the **documentation** if this PR changes or adds functionality
- [ ] written/updated **design docs** if this PR implements new functionality
- [X] updated the **change log**
- [X] ran **pre-commit** checks for code style
- [ ] attended to any **TO-DOs** left in the code

Related work items: #2306
2024-02-14 16:51:25 +00:00
Nick Todd
8520f22e22 2306: Updated documentation 2024-02-14 13:35:08 +00:00
Nick Todd
4a38672fea 2306: Handle INSERT query 2024-02-14 13:18:20 +00:00
Nick Todd
07a934ab66 2306: Update tests to verify INSERT query. 2024-02-14 12:00:08 +00:00
Czar Echavez
ab7c7b9c06 Merge remote-tracking branch 'origin/dev' into feature/2257-router-routes-cannot-be-represented-in-config-file 2024-02-13 17:37:34 +00:00
Czar Echavez
98a4fbecb5 Merge remote-tracking branch 'origin/dev' into feature/2258-dosbot-cannot-be-added-via-configuration-file 2024-02-13 16:04:02 +00:00
Christopher McCarthy
9835b31dc5 Merged PR 272: #2205 - Firewall Node
## Description:

This pull request introduces the Firewall class and extends the ACLRule functionality within PrimAITE to provide comprehensive network traffic management and security capabilities. These enhancements enable detailed control over data flow through network simulations, mimicking real-world firewall operations and ACL configurations. The updates focus on the addition of a Firewall node that extends the Router class functionalities and the enhancement of ACLRule to support IP ranges through wildcard masking, thus offering granular traffic filtering based on IP addresses, protocols, ports, and more.

## Key Features:

**Firewall Class:** A new class that extends the Router class, incorporating firewall-specific logic for inspecting, directing, and filtering traffic between the internal, external, and DMZ (De-Militarized Zone) network interfaces. The Firewall class supports configuring network interfaces and applying Access Control Lists (ACLs) for inbound and outbound traffic control.

**Enhanced ACLRule:** The ACLRule class has been updated to support IP ranges using wildcard masking. This allows for more flexible rule definitions, enabling users to specify broad network ranges or individual IP addresses in ACL rules.

**Comprehensive ACL Configuration:** Six distinct ACLs (internal inbound, internal outbound, DMZ inbound, DMZ outbound, external inbound, and external outbound) provide meticulous control over traffic flow, ensuring robust network security. Examples included in the documentation illustrate how to configure ACLs for common scenarios, such as blocking external threats, permitting specific services, and restricting access to sensitive internal resources.

**Intuitive Interface and ACL Management:** Simplified methods for configuring firewall interfaces and ACL rules enhance usability. The Firewall class offers intuitive functions for rule management, including adding, removing, and listing ACL rules.

**Detailed Documentation and Examples:** Accompanying the code updates, comprehensive documentation and example configurations are provided, detailing the use and configuration of the Firewall node and ACL rules within PrimAITE simulations.

## Impact:

The introduction of the Firewall class and the enhancement of ACLRule significantly broaden PrimAITE's capabilities for simulating realistic network security scenarios. Users can now accurately model the behavior of firewalls in their network simulations, applying complex ACLs to control traffic flow and enforce security policies. This update enables more detailed network security analyses, teaching, and experimentation within the PrimAITE environment.

## Test process
Extensive unit tests have been added to cover the new functionality, ensuring reliability and correctness. Tests include scenarios for firewall configuration, ACL rule application, traffic filtering based on various criteria, and interaction between different network zones.

## Checklist
- [X] PR is linked to ...
2024-02-13 13:56:56 +00:00
Czar Echavez
b277034e8b #2257: temporarily commit changes - added startup and shut down durations to node config + adding routes 2024-02-13 13:02:24 +00:00
Chris McCarthy
7b64d99a63 #2205 - Final suggestions from PR 2024-02-13 12:56:41 +00:00
Czar Echavez
f4369a4fff Merge remote-tracking branch 'origin/dev' into feature/2257-router-routes-cannot-be-represented-in-config-file 2024-02-13 10:50:45 +00:00
Chris McCarthy
426c0a6682 2205 - Slimmed down the capability of the wireless router for now 2024-02-13 10:18:06 +00:00
Nick Todd
a6f3c458d5 Merged PR 273: 2297: Convert NTP Client and Server to UDP
## Summary
Replaced references to TCP with UDP in NTP client and server code. Updated docs.

## Test process
Re-ran and passed existing tests.

## Checklist
- [X] PR is linked to a **work item**
- [X] **acceptance criteria** of linked ticket are met
- [X] performed **self-review** of the code
- [ ] written **tests** for any new functionality added with this PR
- [X] updated the **documentation** if this PR changes or adds functionality
- [ ] written/updated **design docs** if this PR implements new functionality
- [ ] updated the **change log**
- [X] ran **pre-commit** checks for code style
- [ ] attended to any **TO-DOs** left in the code

2297: Convert NTP Client and Server to UDP

Related work items: #2297
2024-02-13 09:43:09 +00:00
Czar Echavez
2c743005cd #2257: moved config tests into its own directory + added dmz_network.yaml to use in tests 2024-02-12 18:58:10 +00:00
Nick Todd
4c66d2b252 2297: Change missed reference TCP to UDP. 2024-02-12 17:24:28 +00:00
Nick Todd
697e53def8 2297: Doc update. 2024-02-12 17:12:59 +00:00
Nick Todd
fa08e53b15 2297: Convert NTP Client and Server to UDP 2024-02-12 17:01:53 +00:00
Chris McCarthy
add09a0280 #2205 - Tidied up interface creation and applied some suggestions from PR 2024-02-12 14:08:55 +00:00
Chris McCarthy
cfd64333e2 #2205 - Added wireless router tests and documentation. Refactored some code based on PR suggestions. 2024-02-12 12:31:08 +00:00
Czar Echavez
7beacfd95f #2258: missing some configuration items + added more tests 2024-02-12 11:41:55 +00:00
Czar Echavez
da92d74236 #2258: remove unnecessary ntp server check 2024-02-12 09:01:30 +00:00
Czar Echavez
66a3e8d02c Merge remote-tracking branch 'origin/dev' into feature/2258-dosbot-cannot-be-added-via-configuration-file 2024-02-12 08:57:47 +00:00
Chris McCarthy
9df7ceed3d #2205 - feat: Implement AirSpace and WirelessRouter for Enhanced Network Simulations
This commit introduces the AirSpace and WirelessRouter classes, expanding the PrimAITE's capabilities to simulate wireless networking environments. The AirSpace class manages wireless communications, ensuring seamless transmission across different frequencies. Meanwhile, the WirelessRouter class integrates both wired and wireless networking functionalities.
2024-02-10 23:44:08 +00:00
Chris McCarthy
a8c1e2b9d9 #2205 - Fixed ACLRule.is_permitted function by returning a bool that indicates whether the rule was matched or not to allow the AccessControlList to know whether to pay attention to the rule or not when it's iterating over them. 2024-02-10 21:32:13 +00:00
Chris McCarthy
58af58810d #2205 - Introduced a Firewall class for enhanced network security and control, extending Router functionalities. Updated ACLRule to support IP ranges via wildcard masking for refined traffic filtering. Includes documentation updates. 2024-02-09 23:29:06 +00:00
Christopher McCarthy
a960741f66 Merged PR 269: Refactor Network Infrastructure: Introduce ARP & ICMP Services and Network Interface Hierarchy
## Summary

This pull request encompasses a series of significant refactoring and enhancements aimed at improving the network simulation framework's architecture and functionality. Central to these changes is the introduction of ARP and ICMP as standalone services, the creation of a structured hierarchy for network interfaces, and a comprehensive overhaul of the testing suite to align with these new developments.

### Key Changes:

ARP and ICMP as Services: Transitioned ARP into a dedicated service, laying the groundwork for more sophisticated network interaction simulations. This shift involved substantial refactoring but has resulted in the successful integration of ARP requests within the network service architecture. Following this, ICMP was also encapsulated as a service, utilizing the session manager for packet transmission, thereby enhancing modularity and interaction within the network.

Network Interface Hierarchy: Introduced a hierarchy for network interfaces, differentiating between wired (NIC, SwitchPort) and wireless (WirelessNIC, WirelessAccessPoint) interfaces. This structure is further enriched with the Layer3Interface abstract base class, facilitating IP-based communications across both wired and wireless mediums.

PCAPs (Packet Capture) are now logged separately for inbound and outbound frames.

Test Suite Overhaul: Undertook a significant refactor of the testing suite, shifting to utilize the newly introduced Node subclasses (Computer, Server, Router, Switch) and the Network() class for node management and connection setup. This effort ensures that tests more accurately reflect the intended usage patterns and configurations within the simulation framework.

IPV4Address Validation and Conversion: Added a new IPV4Address type with pre-validation and auto-conversion capabilities, streamlining the handling of IPv4 addresses throughout the framework.

### Commit Highlights:

1. Commenced by integrating ARP as a service, facing initial challenges but achieving a functional ARP request capability as a milestone (Initial crack at getting ARP into a Service).
1. Progressed to fully integrate ARP service and link it with ICMP operations, marking a significant advancement in service-based network interactions (Lots more progress).
1. Began the process of encapsulating ICMP within the service model, necessitating further adjustments and test fixes (Initial work has been done on moving ICMP into services).
1. Completed the ICMP service integration, enhancing PCAP logging for inbound and outbound frames, and began addressing test suite discrepancies (ICMP now working as a service).
1. Implemented a broad refactor of the base network model to introduce a clear network interface hierarchy and started troubleshooting routing tests affected by ARP integration issues (Big refactor of base).

### Conclusion:

These changes collectively represent a leap forward in the framework's architecture, laying a robust foundation for future enhancements and ...
2024-02-09 12:50:58 +00:00
Czar Echavez
d1c3f891bf #2258: moving applications to application types - more tests 2024-02-09 11:41:06 +00:00
Chris McCarthy
6b3829dc48 #2248 - Removed redundant Union from single type params 2024-02-09 11:37:47 +00:00