2675 Commits

Author SHA1 Message Date
Nick Todd
0cf8e20e6d #2913: Update reward classes to work with pydantic. 2024-10-21 17:11:11 +01:00
Nick Todd
bbcbb26f5e #2913: Fix ActionPenalty. 2024-10-21 14:43:51 +01:00
Charlie Crane
a5c7565f0e #2912 - eod commit. Gutted ActionManager and corrected some identifiers. 2024-10-18 16:28:15 +01:00
Charlie Crane
83d3120b04 #2912 - Additional actions added to config.py, refactor of HostNIC 2024-10-18 14:52:50 +01:00
Charlie Crane
1b1f3e4f71 #2912 - Updates to remaining action refactoring 2024-10-18 12:07:53 +01:00
Charlie Crane
a90aec2bcd #2912 - End of day commit 2024-10-17 16:59:44 +01:00
Nick Todd
419a86114d #2913: Now with ConfigSchemas. 2024-10-17 16:35:13 +01:00
Nick Todd
fe6a8e6e97 #2913: Initial commit of new AbstractReward class. 2024-10-17 13:24:57 +01:00
Charlie Crane
cd30e2d084 #2912 - Mid-day commit. Actions moving across from actions.py to game.agent.actions 2024-10-17 12:22:30 +01:00
Marek Wolan
861cfe2c0a #2912 - scaffold of action changes 2024-10-11 15:00:26 +01:00
Marek Wolan
6844bd692a bump version to 4.0.0a1 2024-10-11 13:02:44 +01:00
Marek Wolan
9626cfc990 Merge remote-tracking branch 'origin/release/3.3.0' into 4.0.0a1 2024-10-11 12:42:32 +01:00
Marek Wolan
43ec85a669 #2755 - refix some air space frequency issues 2024-10-11 09:52:16 +01:00
Marek Wolan
8419fd751a Merged PR 561: Make it possible to add sets of nodes to the network
## Summary
* Changed the office LAN convenience function to a class with a registry. Now, plugin can register custom node adders.
* Added ability to define `node_sets` in the config that map to `NetworkNodeAdder` subclasses
* Made airspacefrequency into a DTO class again to make management simpler.
* Moved the node registry out of `HostNode` and `NetworkNode` into `Node`
* Changed game.py to check the hardcoded node types before the node registry (this will change once I add ConfigSchema to all node subclasses)
* Made `show` method of the network container show all nodes, including ones registered at runtime.

## Test process
* Existing tests passed.
* Added unit tests for node adders

## 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
2024-10-09 14:56:57 +00:00
Marek Wolan
611b34e29f remove outdated comment 2024-10-09 14:16:23 +01:00
Marek Wolan
a42398ac09 Fix typos and improve validation 2024-10-09 14:15:53 +01:00
Marek Wolan
56a17c3fea Update typos and comments according to PR comments 2024-10-08 13:40:40 +01:00
Marek Wolan
39c190e5f4 add documentation for node seta and update changelog 2024-10-04 12:46:29 +01:00
Marek Wolan
07c4860059 Add more tests for office lan creation 2024-10-04 11:36:48 +01:00
Marek Wolan
b4cc1b4379 Add tests for office lan creation 2024-10-04 11:07:49 +01:00
Marek Wolan
b5b7fc6a8d Give node types their own identifiers and make the network show method use them 2024-10-04 09:20:07 +01:00
Marek Wolan
5fde945fac rename identifier back to type 2024-10-02 14:24:59 +01:00
Marek Wolan
a838cc6ce1 Convert office lan adder to a class and make it extendable 2024-10-02 13:56:39 +01:00
Charlie Crane
8209424e97 Merged PR 560: #2900 - Terminal last response
## Summary
This PR introduces the `last_response` attribute within Terminal, similar to that seen within the C2 suite. The aim of this is to resolve the bug seen when using Terminal, in that when sending remote commands to execute, the RequestResponse does not indicate whether the command was successfully actioned, just that it was sent.

## Test process
New test to check that `last_response` contains the correct ReqestResponse following remote command execution

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

#2900 - Changes to terminal to include a last_response attribute, for use in obtaining RequestResponse from remote command executions

Related work items: #2900
2024-10-01 11:26:32 +00:00
Charlie Crane
fcfea3474f #2900 - typo in test_ftp_client and expanded test_terminal_last_response_updates to include a failure scenario 2024-10-01 11:41:42 +01:00
Charlie Crane
1e1d152481 #2900 - Updates to Terminal-Processing jupyter notebook to include a mention of last_response 2024-10-01 11:02:23 +01:00
Charlie Crane
3dafad71b3 #2900 - New test to show that last_response updates as expected. Changelog updated. 2024-10-01 10:45:03 +01:00
Charlie Crane
ac921749a7 #2900 - Changes to terminal to include a last_response attribute, for use in obtaining RequestResponse from remote command executions 2024-09-30 17:38:24 +01:00
Czar Echavez
33c020e671 Merged PR 557: #2897: How to guide on dev mode
## Summary
Added a how to guide which shows the example of the primaite dev-mode commands being run and how to effectively use the commands

## Test process
n/a the notebook is a test itself

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

#2897: How to guide on dev mode

Related work items: #2897
2024-09-30 10:10:13 +00:00
Marek Wolan
2bd6c69343 Merged PR 549: Align main and dev histories
Related work items: #1847, #2438, #2457, #2472, #2502, #2536, #2552, #2560, #2561, #2563, #2570, #2588, #2606, #2610, #2618, #2620, #2623, #2625, #2626, #2628, #2637, #2639, #2641, #2646, #2656, #2658, #2659, #2660, #2661, #2681, #2682, #2686, #2688, #2689, #2697, #2700, #2701, #2702, #2705, #2716, #2718, #2720, #2721, #2725, #2734, #2736, #2739, #2740, #2745, #2747, #2748, #2757, #2768, #2769, #2772, #2779, #2781, #2799, #2826, #2837, #2844
2024-09-30 09:32:50 +00:00
Marek Wolan
d26fcf01a2 Merged PR 558: Make software manager show method always show all software.
DataFusionService didn't show in software list, because it uses the port_protocol_mapping as the source of truth for installed software instead of the software list itself.

This fixes that :)

Related work items: #2899
2024-09-30 08:16:46 +00:00
Marek Wolan
221e09ba51 Turn AirSpaceFrequency to a schema instead of a dict for validation 2024-09-27 15:06:19 +01:00
Marek Wolan
5282cb0294 #2899 - Make software manager always show() all software 2024-09-27 10:56:48 +01:00
Czar Echavez
17fe5cb043 #2897: How to guide on dev mode 2024-09-27 10:47:38 +01:00
Marek Wolan
521580ea12 Merged PR 555: Refactor Ports and Airspace to be extensible
## Summary
* Ports are no longer enums, they are now plain integers
* Ports are no longer validated against a list of pre-defined ports, any integer from 0-65535 can be used now.
* Port enum was replaced with a convenience port lookup. For example any expression in the form `Port.HTTP` was replaced with `PORT_LOOKUP["HTTP"]` which resolves to the integer 80.
* Some tests were adjusted to use the new syntax for ports
* Backwards compatibility for YAML configs has been retained by adding pydantic validators to automatically convert named ports to integer counterparts, however defining action/observation spaces in code now requires users to specify ports as integers instead of port enum objects. For instance, monitored_ports in the ACL observation space will now look like this: `[53, 80]` instead of `[Port.DNS, Port.HTTP]`
* Plugins can extend the port lookup, however it is not necessary because it's possible to use integer literals.
* Airspace has been treated similarly, except airspace frequencies have multiple attributes, namely max_data_rate_bps. Therefore, the lookup for named Frequencies resolves to a dictionary of freq_hz (float), and max_data_rate_bps (float)
* Airspace logic has been adjusted accordingly to use the new dictionary for tracking bandwidth limits
* A new method for registering new airspace frequencies has been added. Plugins that add new frequencies can call `register_default_frequency`, after which any new airspace will have access to that frequency.

* For consistency, `IPProtocol` was also changed to be a lookup instead of an enum. It is not extendable by plugins as so far we have not needed to model additional protocols in our plugin.

These changes were necessary as it's not possible to extend enums in python, therefore plugins would not have been able to add new ports. There is an added benefit that this is a stepping stone towards support communication on dynamic and ephemeral ports.

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

## 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
- [ ] 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
2024-09-27 09:19:17 +00:00
Marek Wolan
c74d5ac227 Fix changelog typo and remove repitition in ACL show method 2024-09-27 09:28:26 +01:00
Marek Wolan
203ec5ec85 Add tests for port and protocol validation and update changelog 2024-09-26 16:00:59 +01:00
Marek Wolan
f2b6d68b14 Fix Port scan 2024-09-26 15:35:50 +01:00
Czar Echavez
e7c30d5c8b Merged PR 548: #2445: added the ability to pass the game options thresholds to observations...
## Summary
Added ability to pass the game options thresholds into observation classes

This will allow for NICObservation, FileObservation (and FolderObservation) and ApplicationObservation to be able to get the thresholds for the training session. i.e. Allows for the thresholds for NMNE, file access and application executions to be configurable for training.

## Test process
https://dev.azure.com/ma-dev-uk/PrimAITE/_git/PrimAITE/pullrequest/548?_a=files&path=/tests/integration_tests/configuration_file_parsing/test_game_options_config.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

#2445: added the ability to pass the game options thresholds to observations so that relevant observation items can retrieve the thresholds from config

Related work items: #2445
2024-09-26 08:46:36 +00:00
Czar Echavez
603c68acf9 #2445: grammar in changelog 2024-09-26 08:51:30 +01:00
Marek Wolan
50e2234a69 Remove commented out code 2024-09-25 16:51:58 +01:00
Marek Wolan
c3eb093144 remove temporary notebook 2024-09-25 16:50:01 +01:00
Marek Wolan
f1b911bc65 Change port and protocol to annotated validators 2024-09-25 16:28:22 +01:00
Czar Echavez
b9df2bd6a8 #2445: apply PR suggestions 2024-09-25 10:50:26 +01:00
Czar Echavez
171dd83f2f Merge remote-tracking branch 'origin/dev' into feature/2445-make-observation-thresholds-configurable 2024-09-25 09:04:18 +01:00
Archer Bowen
b0363a6b48 Merged PR 534: #2840 NODE_SEND_LOCAL_COMMAND
## Summary
Enables agents to use a new CAOS action ``NODE_SEND_LOCAL_COMMAND``.

## Test process

Added a new unit test as well as tested manually via sandbox notebooks.

## 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
- [X] 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: #2840
2024-09-24 10:47:08 +00:00
Archer Bowen
e29815305d #2840 Addressing PR comments. 2024-09-24 11:06:38 +01:00
Archer Bowen
88cbb783bc #2840 Fixed sphinx user guide formatting issues. 2024-09-20 13:54:13 +01:00
Archer Bowen
710a4d0e55 Merge remote-tracking branch 'origin/dev' into feature/2840_LOCAL_TERMINAL_COMMAND 2024-09-20 12:38:22 +01:00
Marek Wolan
695891f55c Add port and protocol custom validators 2024-09-20 11:21:28 +01:00