Commit Graph

598 Commits

Author SHA1 Message Date
Marek Wolan
2a715d8d0a backport 3.2 changes to core 2024-08-01 11:08:41 +01:00
Archer.Bowen
fd57986512 #2757 fixed dev mode cli double -level alternative issue 2024-07-17 11:48:29 +01:00
Marek Wolan
104d033053 Merge remote-tracking branch 'origin/dev' into fix-slow-tests 2024-07-12 11:29:46 +01:00
Marek Wolan
199cd0d9df fix test problems and slowness 2024-07-12 11:23:41 +01:00
Christopher McCarthy
2f649a302c Merged PR 458: Carry over airspace hotfixes from internal
## Summary
Carried over hit fixes from internal that backtracked on the complex channel width stuff for now and focussed on getting a stable data rate baked in for each frequency.  Implemented overriding of frequency max capacities on the airspace. updated documentation to reflect the changes in airspace.py.

## Test process
- Original tests still work
- Tested reading the frequency capacity overrides from config file
- Tested that setting the frequency override to 0.0 blocks the channel

## 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

Related work items: #2745
2024-07-12 10:17:25 +00:00
Chris McCarthy
cde632066c #2745 implemented overriding of frequency max capacities on the airspace. updated documentation to reflect the changes in airspace.py. 2024-07-11 21:11:27 +01:00
Marek Wolan
e759ae5990 2623 fix issues with tests and revert request show method 2024-07-11 17:44:31 +01:00
Marek Wolan
3af22ac2ed Merge remote-tracking branch 'origin/dev' into feature/2623-action-masking 2024-07-11 15:50:42 +01:00
Chris McCarthy
cf563149ec #2745 carried over changes from internal that backtracked on the complex channel width stuff for now and focussed on getting a stable data rate baked in for each frequency 2024-07-11 15:07:58 +01:00
Czar Echavez
a527b8798e Merged PR 455: Add folder and file request permissions validators
## Summary
Implemented the last of the request validators from https://dev.azure.com/ma-dev-uk/PrimAITE/_wiki/wikis/PrimAITE.wiki/703/Action-Masking

files and folders validators

## Test process
integration tests for files and folders
added unit tests for previous validators as well

## 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
- [ ] updated the **change log**
- [X] ran **pre-commit** checks for code style
- [ ] attended to any **TO-DOs** left in the code

Related work items: #2740
2024-07-11 13:59:44 +00:00
Czar Echavez
1d466d6807 #2740: unit tests + a minor fix to nic test 2024-07-11 12:19:27 +01:00
Archer.Bowen
b8c6238610 #2740 Fixed Nmap Test Failure. 2024-07-11 11:55:03 +01:00
Czar Echavez
aa425a5284 #2740: fix tests affected by request permissions 2024-07-10 14:40:25 +01:00
Marek Wolan
0c58c3969a 2623 - finish testing action mask 2024-07-10 13:46:30 +01:00
Archer.Bowen
feb9763f62 Merge https://dev.azure.com/ma-dev-uk/PrimAITE/_git/PrimAITE into feature/2716-Red-Agent-Logging 2024-07-10 13:40:54 +01:00
Archer.Bowen
239f5b86c0 #2716 Agent logging now sits outside of the simulation output log directory, updated dev-mode CLI to include agent logging and added additional tests. 2024-07-10 13:36:37 +01:00
Czar Echavez
caa6a4809c #2740: tests + implement file request validators 2024-07-10 13:14:22 +01:00
Marek Wolan
7201b7b8e0 2623 Add e2e tests for action masking 2024-07-10 11:01:42 +01:00
Archer.Bowen
48645d2e72 #2716 Initial Implementation + Initial Tests and updated changelog and sphinx documentation. 2024-07-09 16:46:31 +01:00
Czar Echavez
20b9b61be5 #2740: added ability to merge validators + validators for folders 2024-07-09 16:44:02 +01:00
Christopher McCarthy
b45f6bbd40 Merged PR 447: Bandwidth load / capacity checks before transmission
## Summary

This pull request introduces significant enhancements to the AirSpace class within our network simulation software, aimed at improving the realism, configurability, and accuracy of wireless network simulations. These changes include the addition of new enums and attributes, enhancements to the configuration schema, and improvements in bandwidth management and transmission logic.

**Additions**

-   **Enums and Attributes:**

-   **AirSpaceEnvironmentType Enum**: Defines various environmental settings that affect wireless signal propagation and interference.
-   **ChannelWidth Enum**: Specifies available channel width options for wireless interfaces.
-   **Channel Width Attribute**: Added to WirelessNetworkInterface for dynamic adjustments based on the operational environment.
-   **airspace_key Attribute**: A tuple identifying the frequency and channel width combination for bandwidth management.
-   **airspace_environment_type Attribute**: Sets the overall environmental context of the airspace, influencing all contained devices.

-   **Functional Enhancements:**

-   **SNR and Capacity Calculation Functions**: New functions estimate_snr and calculate_total_channel_capacity have been implemented to compute signal-to-noise ratios and channel capacities dynamically.
-   **show_bandwidth_load Function**: Provides a visual representation of the current bandwidth load across different channels.
-   **Dynamic Speed Setting**: The speed attribute of WirelessInterface is now adjusted dynamically based on frequency, channel width, and environment.

-   **Configuration and Testing:**

-   **Configuration Schema Update**: The simulation.network config file schema now supports setting the airspace_environment_type.

**Changes**

-   **Interface and Performance Adjustments:**

-   **NetworkInterface Speed Type**: Changed from int to float for more precise speed definitions.
-   **Transmission Feasibility Check**: Updated the _can_transmit function in Link to better handle current load and bandwidth capacities.
-   **WirelessRouter Configurations**: The configure_wireless_access_point function now takes channel_width as an additional parameter.
-   **Grouping Adjustments**: WirelessNetworkInterfaces are now categorized by both AirSpaceFrequency and ChannelWidth.

-   **Transmission Logic Overhaul:**

-   **Interface Adjustments**: Modifying an interface's settings now necessitates its temporary removal from the airspace, followed by a recalculation of its data rate and reintegration under new settings.
-   **Blocking Overloads**: Strengthened the logic in AirSpace to prevent transmissions that would surpass the available capacity.

**Fixes**

-   **Transmission Permission Logic**: Fixed the can_transmit_frame function to accurately enforce transmission limits based on current network load and available bandwidth.

**Conclusion**

These updates significantly enhance the fidelity and flexibility of our network simulation tool, enabling more accurate m...
2024-07-09 10:47:56 +00:00
Czar Echavez
a3f74087fa #2688: refactor test classes 2024-07-08 15:26:30 +01:00
Czar Echavez
829a6371de #2688: tests 2024-07-08 14:39:37 +01:00
Chris McCarthy
4410e05e3e #2967 - Updated the DB filesize so that it doesn't fill the 100mbit link. moved the can transmit checks to the network interface to enable frame dropped syslog. narrowed the scope of the NODE_NMAP_PORT_SCAN action in nmap_port_scan_red_agent_config.yaml to select ports and protocols as the link was filling up on the full box scan. 2024-07-05 16:27:03 +01:00
Czar Echavez
2a0695d0d1 #2688: apply the request validators + fixing the fix duration test + refactor test class names 2024-07-05 15:06:17 +01:00
Chris McCarthy
c6b1d35215 #2967 - Enhance AirSpace simulation with dynamic environment and bandwidth/channel management
This commit introduces several key enhancements to the AirSpace class, improving the realism and configurability of the wireless network. Major additions include the AirSpaceEnvironmentType and ChannelWidth enums, dynamic adjustment of interface speeds based on environmental settings, and comprehensive bandwidth management features. Additionally, the software now supports configuration of channel widths via the config file, incorporates accurate SNR and capacity calculations, and enforces bandwidth limits more effectively across wireless interfaces. Updated tests ensure that the new functionalities integrate seamlessly with existing systems.
2024-07-04 20:45:42 +01:00
Czar Echavez
797afc99ab Merge remote-tracking branch 'origin/dev' into feature/2725-add-software-fix-duration-config 2024-07-03 10:37:02 +01:00
Marek Wolan
bd23ee2083 Merged PR 444: Refactor application install
## Summary
* Remove the ip address parameter from application install
* Make it possible to install any application that exists
* Add new configuration actions for applications
* Add an application registry to match names to application classes

## Test process
* several new tests
* notebooks still running

## 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
- [ ] updated the **change log**
- [X] ran **pre-commit** checks for code style
- [X] attended to any **TO-DOs** left in the code

Related work items: #2438, #2705
2024-07-02 15:57:59 +00:00
Czar Echavez
6a72f6af42 #2725: add fix duration to application and service configuration 2024-07-02 15:52:18 +01:00
Marek Wolan
b27ac52d9e #2700 add E2E tests for application configure actions 2024-07-02 11:10:19 +01:00
Marek Wolan
33b9c5f6b3 Merge branch 'feature/2701-refactor-install-action' into feature/2700-application-configure-actions 2024-07-02 10:41:17 +01:00
Marek Wolan
dc2c64b2f6 #2701 - Remove ip address option from node application install 2024-07-01 16:23:10 +01:00
Czar Echavez
9c568b0ff3 Merged PR 439: #2641: Added a check for software health state in db service + tests
## Summary
Added a check in the database service process_sql method that checks if the Database Service is in a GOOD state (mainly so that the database service being in a fixed state returns an error)

## Test process
https://dev.azure.com/ma-dev-uk/PrimAITE/_git/PrimAITE/pullrequest/439?_a=files&path=/tests/integration_tests/system/test_database_on_node.py

https://dev.azure.com/ma-dev-uk/PrimAITE/_git/PrimAITE/pullrequest/439?_a=files&path=/tests/integration_tests/system/test_web_client_server_and_database.py

## 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
- [ ] updated the **change log**
- [X] ran **pre-commit** checks for code style
- [ ] attended to any **TO-DOs** left in the code

#2641: Added a check for software health state in db service + tests

Related work items: #2641
2024-07-01 15:22:22 +00:00
Marek Wolan
f2db8b0fb5 Merge remote-tracking branch 'origin/feature/2438-application-install-action-refactor' into feature/2700-application-configure-actions 2024-07-01 15:26:19 +01:00
Marek Wolan
bf8ec60833 #2700 Add configure dosbot action 2024-07-01 15:25:20 +01:00
Marek Wolan
ab73ac20e8 #2700 add ransomware configure action 2024-07-01 14:41:41 +01:00
Charlie Crane
96f62a3229 Merged PR 436: 2656 - Implement Optional Negative Reward
## Summary
This PR implements an "ActionPenalty" Reward class, that can be used for penalising an agent when it carries out an action other than DONOTHING.

The value for this can be configured within the scenario YAML file.

## Test process
I've written unit tests to check that the action penalty is correctly calculated and applied, another to check that the config is read correctly and loads into PrimaiteGymEnv correctly.

## 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
- [ ] updated the **change log**
- [X] ran **pre-commit** checks for code style
- [ ] attended to any **TO-DOs** left in the code

Related work items: #2656
2024-07-01 13:25:05 +00:00
Marek Wolan
2dd7546f3d 2705 Fix application tests by correctly renaming fixture 2024-07-01 13:25:16 +01:00
Marek Wolan
655bc04a42 #2705 Minor comment and name changes to applications 2024-07-01 13:21:08 +01:00
Marek Wolan
c34cb6d7ce #2700 Add DatabaseConfigure action 2024-07-01 11:31:27 +01:00
Czar Echavez
3ac97f8c3f #2641: Added a check for software health state in db service + tests 2024-06-28 13:07:57 +01:00
Marek Wolan
f796babf93 #2705 - Move application registry into application module instead of hardcoding in game module 2024-06-28 11:57:54 +01:00
Marek Wolan
7a680678aa #2656 - Make action penalty more configurable 2024-06-27 12:01:32 +01:00
Charlie Crane
7a833afe2d #2656 - Unit tests for new ActionPenalty reward component, testing yaml and some minor changes to the implementation. Need to update Documentation to detail how this is added 2024-06-26 12:20:28 +01:00
Marek Wolan
28dabad66b #2682 Backport changes to core PrimAITE 2024-06-25 11:04:52 +01:00
Chris McCarthy
636ec0cdd4 #26661 - Added tests for testing arp doesn't work but also doesn't crash the network if attempting to resolve a broadcast or network address 2024-06-19 11:31:13 +01:00
Charlie Crane
923d2629ca Merged PR 418: Update Pre-Commit to check for valid copyright
## Summary
Updates Pre-commit with the a check to ensure valid copyright headers

## Test process
*How have you tested this (if applicable)?*

## Checklist
- [X] PR is linked to a **work item**
- [ ] **acceptance criteria** of linked ticket are met
- [ ] performed **self-review** of the code
- [ ] 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: #2646
2024-06-13 18:54:48 +00:00
Czar Echavez
101fa3ebdb #2658: change key of observation to match what is in CAOS document 2024-06-13 16:29:02 +01:00
Marek Wolan
fad8d936e6 Merge remote-tracking branch 'origin/dev' into feature/2646_Update-pre-commit-to-check-for-valid-copyright 2024-06-13 12:52:09 +01:00
Czar Echavez
539577ddc3 #2658: added monitored traffic into config + default obs space 2024-06-13 11:48:13 +01:00