Commit Graph

1219 Commits

Author SHA1 Message Date
Nick Todd
317fbdbb9c 2230: Version bump 2024-02-16 12:46:36 +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
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
Chris McCarthy
7b64d99a63 #2205 - Final suggestions from PR 2024-02-13 12:56:41 +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
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
Chris McCarthy
cceb6208e0 #2248 - Reset the auto save pcap and syslog to False 2024-02-09 11:09:44 +00:00
Chris McCarthy
2518a42604 #2248 - Dropped old router_arp.py module. Fixed the ICMP codes as per IANA (https://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml) 2024-02-09 11:03:48 +00:00
Chris McCarthy
bebfbd53be #2248 - MAde tests use new way of accessing network interfaces by their port number 2024-02-09 10:30:39 +00:00
Chris McCarthy
0acd9a2938 #2248 - Removed redundant code and added more documentation from PR suggestions 2024-02-09 10:27:22 +00:00
Chris McCarthy
a036160515 #2248 - Enhances the PrimAITE documentation, covering the Node, network interfaces, Session Manager, Software Manager, PCAP service, SysLog functionality, and network devices like Routers, Switches, Computers, and Switch Nodes. It details their roles, workflows, and integration within the simulation, focusing on frame processing, software management, and logging. The documentation also clarifies the frame reception process, including port checks and application-level dispatching, ensuring a thorough understanding of network operations within the simulation 2024-02-08 22:37:21 +00:00
Czar Echavez
0590f956e3 #2258: ntp client should not request if ntp server is not set 2024-02-08 16:21:08 +00:00
Chris McCarthy
5eed467271 #2248 - synced wth dev 2024-02-08 16:15:57 +00:00
Czar Echavez
e1237625a5 Merge remote-tracking branch 'origin/dev' into feature/2258-dosbot-cannot-be-added-via-configuration-file 2024-02-08 16:03:41 +00:00
Czar Echavez
b31a9943d7 #2258: testing individual application install 2024-02-08 16:02:37 +00:00
Chris McCarthy
114fb8c077 #2248 - synced wth dev 2024-02-08 15:27:02 +00:00
Marek Wolan
c3ea06aeec Merged PR 268: Make build fail if tests fail 2024-02-08 15:21:19 +00:00
Marek Wolan
1a2298ebfb Merged PR 267: Make web status rewards based on web browser instead of web server.
## Summary
- added a second green agent on client 1
- added browser history
- added a reward component based on the most recent return code in browser history
- modified the UC2 notebook to adhere to new reward.
- (also there were some issues in example_config from a previous merge that I failed to notice prior)

## Test process
New unit tests. Ran uc2 notebook to check that it produces results aligning with what is described in the markdown cells.

## 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
- [x] attended to any **TO-DOs** left in the code

Add second green agent and make rewards based on webbrowser

Related work items: #2247
2024-02-08 15:19:24 +00:00
Marek Wolan
9b350ddd6f Apply suggestions from code review. 2024-02-08 13:20:32 +00:00
Czar Echavez
1dcb9214af #2258: Added DoSBot to list of applications 2024-02-08 12:04:49 +00:00
Chris McCarthy
411f0a320f #2248 - Final run over all the docstrings after running pre-commit. All tests now working. Updated CHANGELOG.md. 2024-02-08 10:53:30 +00:00
Czar Echavez
a4b7878604 #2258: added NTPClient to system software + testing all installable software on client1 in config 2024-02-08 10:36:07 +00:00
Chris McCarthy
0c96fef3ec #2248 - All tests (bar the one config file test) now working. Still need to tidy up docstrings and some docs. Almost there 2024-02-07 23:05:34 +00:00
Chris McCarthy
5e25fefa14 #2248 - Further fixes. All router integration tests now passing. 2024-02-07 19:44:40 +00:00
Czar Echavez
f21ee857a7 #2258: setting up test that verifies game config parsing 2024-02-07 18:09:54 +00:00
Marek Wolan
b7ff520d55 make task fail if tests fail 2024-02-06 18:58:50 +00:00
Marek Wolan
c35c060448 Cosmetic changes based on PR feedback 2024-02-06 17:32:15 +00:00
Marek Wolan
e500eccaf7 Finish upgrading folder actions to work with names instead of uuids & get tests fixed 2024-02-06 16:58:08 +00:00
Marek Wolan
41bc932f52 Add reward test. 2024-02-06 15:05:44 +00:00
Marek Wolan
5b5b750d4d Add second green agent and make rewards based on webbrowser 2024-02-06 14:42:59 +00:00
Chris McCarthy
7bbfd564fb #2248 - Big refactor of base with all Network Interface subclasses created to allow for proper management of ports on devices as it was starting to get messy with the Router. Some routing tests still need fixing as ARP doesn't seem to be working properly 2024-02-05 08:44:10 +00:00