Commit Graph

1479 Commits

Author SHA1 Message Date
Charlie Crane
3245c7e81e #2453 - Renaming Server hostname in create-simulation_demo and removing saved output 2024-04-09 14:48:49 +01:00
Charlie Crane
265f25b442 #2453 - One final typo correction found in network_simulator_demo.ipynb. Correcting switch.sys_log.show() to computer.sys_log.show() in Computer/Server Nodes section 2024-04-09 14:15:51 +01:00
Charlie Crane
8e6689d881 #2453 - Corrected flake8 linting errors ahead of creating PR, after finally managing to get it to run locally. This should now be ready for review 2024-04-09 13:56:21 +01:00
Charlie Crane
d02b12d1e5 #2453 Addressing some flake8 corrections 2024-04-09 13:45:27 +01:00
Charlie Crane
c13d3f191f #2453 - Correcting errors found from pipeline pre-commit checks 2024-04-09 13:34:57 +01:00
Charlie Crane
f8432bf53b #2453 - Example Notebooks Require Refactor
- create_simulation_demo and network_simulator_demo notebooks have been updated with correct import paths to reflect refactoring within condebase.
 - Corrected typo within create-simulation_demo: my_swtich -> my_switch
 - updates to ARP implementation. This is now a property in HostNode and NetworkNode, meaning router.arp.show() now works in network_simulator_demo notebook as intended.
2024-04-09 13:26:35 +01:00
Czar Echavez
bce32fb376 Merged PR 330: #2448: store last query response for db client
## Summary
Required to complete #2448
DB Client will store last query response - Data Fusion Service will use this to know the difference between no response and invalid response

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

#2448: store last query response for db client

Related work items: #2448
2024-04-04 13:30:55 +00:00
Czar Echavez
383cf051df #2448: store last query response for db client 2024-04-04 14:17:34 +01:00
Marek Wolan
5408611c73 Merged PR 329: Remove link refs and put nice naming convention instead
instead of UUID for link primary key in describe state, we are using something more like

router_1:eth-3<->switch_1:eth-8
**all configs need to change the observation space link schema as a result of this change**

It looks like there are a lot of changed files, but it's mostly just removing the `game` parameter from observations and removing 'ref' from config files.

:)

also we no longer need to specify `ref` for nodes, services, or applications. (**but existing configs will not break based on this change!**)

Related work items: #2450
2024-04-04 09:11:23 +00:00
Marek Wolan
3b4962830a #2450 remove unused ref maps in PrimaiteGame 2024-04-03 22:52:06 +01:00
Marek Wolan
698cb83e41 #2450 change link definition schema 2024-04-03 22:20:33 +01:00
Marek Wolan
526dcc7ffe #2450 remove the need to pass Game to observation objects 2024-04-03 22:16:54 +01:00
Marek Wolan
53de4bf7dd Update test assets to new link naming convention 2024-04-03 21:46:42 +01:00
Marek Wolan
e99d238568 #2450 remove link refs and put nice naming convention instead 2024-04-03 21:39:13 +01:00
Marek Wolan
c9a552b836 Merged PR 328: #2449 fix observation integration
small fix

Related work items: #2449
2024-04-03 20:32:32 +00:00
Marek Wolan
2cd9e58994 temp disable extra platforms for build pipeline 2024-04-03 20:18:23 +00:00
Marek Wolan
5f9af03cd9 Merge remote-tracking branch 'origin/dev' into bugfix/2449-observation-where 2024-04-03 20:00:19 +01:00
Marek Wolan
06fd15abaa Merged PR 325: #2446 Fix io config parsing order
Tiny small bugfix.

make sure IO settings are read before the game config in the environments. This is so that SIM_OUTPUT global variable is set before constructing game objects.

Related work items: #2446
2024-04-03 16:33:51 +00:00
Marek Wolan
a4caa3dfe4 #2449 fix observation integration 2024-04-03 15:58:01 +01:00
Czar Echavez
985628f2da Merged PR 324: #2437: fix the visible health status not being carried on after restoring bac...
## Summary
The file being backed up by the database service does not restore the last visible health status of the db file before being restored

## Test process
- Tests that the visible health status is carried forward when the file is corrupted and then restored
- Tests that the visible health status is carried forward when the file is corrupted, deleted and then restored

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

#2437: fix the visible health status not being carried on after restoring backup file

Related work items: #2437
2024-04-02 15:37:01 +00:00
Czar Echavez
989e7481f3 #2437: fix the visible health status not being carried on after restoring backup file 2024-04-02 15:10:48 +01:00
Marek Wolan
e3d3a94da2 Merged PR 321: CAOS 0.8 observations
## Summary
* Remove the usecase-specific and agent-specific observation classes, replacing with a more flexible system
* Add configuration schemas to every observation class
* Add router, firewall, port, and application observation
* Re-shape the dict structure of observations to make it adhere to CAOS 0.8
* Change existing configs to use the new structure
* make host observation separate

## Test process
existing and new unit tests as well as ad hoc notebooks

## Checklist
- [ ] 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: #2417
2024-04-02 14:00:27 +00:00
Christopher McCarthy
742f1be81b Merged PR 320: #2419- Created a Router-specific version of SessionManager
## Summary
Created a Router-specific version of `SessionManager` that looks at route table rather than default gateway when dst ip address isn't for a locally attached network. Carried these changes through to arp. Added test for this. Made some minor improvements to show functions in container and node that assist debugging.

## Test process
TDD approach: wrote the test, ran it and watched it fail. The implemented the fix and re-ran the test; it passes.

**Before fix:**
![image (2).png](https://dev.azure.com/ma-dev-uk/b50a61ee-86c4-48bc-9a0b-a67645ba12ee/_apis/git/repositories/2825053e-bd3b-45b2-8680-1281809eefa2/pullRequests/320/attachments/image%20%282%29.png)

**After fix:**
![image.png](https://dev.azure.com/ma-dev-uk/b50a61ee-86c4-48bc-9a0b-a67645ba12ee/_apis/git/repositories/2825053e-bd3b-45b2-8680-1281809eefa2/pullRequests/320/attachments/image.png)

## Checklist
- [ ] 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

#2419

Related work items: #2419
2024-04-02 12:58:21 +00:00
Chris McCarthy
bb937c1092 #2149 - docstring changes following PR suggestions. 2024-04-02 12:56:15 +01:00
Marek Wolan
82143a2a2e #2446 Fix io config parsing order 2024-04-02 00:31:06 +01:00
Marek Wolan
d2c7ae481c #2417 Add categorisation and updated new configs from merge 2024-04-01 22:03:28 +01:00
Marek Wolan
e4300faa1c Merge remote-tracking branch 'origin/dev' into feature/2417-observation-refactor 2024-04-01 19:21:40 +01:00
Marek Wolan
2513646205 #2417 fix last observation tests 2024-04-01 16:50:59 +01:00
Cristian Genes
1dd911b417 Merged PR 322: #2402 Add ACL actions for routers and firewalls
## Summary
Added ACL addrule and removerule for routers and firewalls

## Test process
New test created to cover all possibilities

## 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: #2402, #2415
2024-04-01 15:34:26 +00:00
Marek Wolan
709486d739 #2417 test firewall and router obs 2024-04-01 16:06:12 +01:00
Cristian-VM2
80c13adfdf #2402 add action maps on all yaml scenarios used for testing 2024-04-01 14:28:41 +00:00
Cristian-VM2
2096b619ec #2402 raise error if action map is not specified. update comment in firewall.py 2024-04-01 12:32:44 +00:00
Marek Wolan
0ba767d2a0 #2417 update observation tests and make old tests pass 2024-04-01 00:54:55 +01:00
Marek Wolan
0e0df1012f #2417 update observations init to autoimport all obs types 2024-03-31 23:39:24 +01:00
Marek Wolan
8da53db822 #2417 Finalise parsing of observation space 2024-03-31 23:20:48 +01:00
Marek Wolan
62ebca8c08 #2417 Remove references to old obs names and add link obs 2024-03-31 21:39:24 +01:00
Marek Wolan
15cb2e6970 #2417 Add NestedObservation 2024-03-31 17:31:10 +01:00
Cristian-VM2
2546f268eb #2402 refactor port actions to take same input params (hostname) as new acl actions for routers and firewalls 2024-03-31 11:59:31 +00:00
Cristian-VM2
2d1f38bcb7 #2402 fix test 2024-03-29 17:28:40 +00:00
Cristian-VM2
d1301002d3 #2402 run pre-commits 2024-03-29 17:07:08 +00:00
Cristian-VM2
8763a27cca Merge remote-tracking branch 'origin/dev' into feature/2402-add-acl-actions-for-routers-and-firewalls 2024-03-29 16:37:37 +00:00
Cristian-VM2
7299a12c64 #2402 add firewall acl actions 2024-03-29 16:30:39 +00:00
Marek Wolan
22e1dfea2f #2417 Move classes to correct files 2024-03-29 14:14:03 +00:00
Marek Wolan
9123aff592 #2417 Add hella docstrings 2024-03-29 13:15:31 +00:00
Marek Wolan
1751714d3d Tidy up node observation file 2024-03-29 12:21:52 +00:00
Marek Wolan
d8a66104f5 Fixed observations 2024-03-29 11:55:22 +00:00
Cristian-VM2
2eb900746b #2402 rename network_acl actions to router_acl and refactor how router_name is given 2024-03-29 11:34:43 +00:00
Marek Wolan
f88b4c0f97 #2417 more observations 2024-03-28 17:40:27 +00:00
Cristian Genes
d415ef9c3e Merged PR 319: Add application install and remove actions
## Summary
Add application install and remove (uninstall) actions

## Test process
Both actions are tested in the same (new) test

## 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: #2405
2024-03-28 16:37:01 +00:00
Cristian-VM2
2a5432fb0a Merge branch 'feature/2402-add-acl-actions-for-routers-and-firewalls' of ssh.dev.azure.com:v3/ma-dev-uk/PrimAITE/PrimAITE into feature/2402-add-acl-actions-for-routers-and-firewalls 2024-03-28 16:09:55 +00:00