Commit Graph

1459 Commits

Author SHA1 Message Date
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
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
Chris McCarthy
1ac3e1c6b4 #2149 - 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. 2024-03-28 15:52:08 +00:00
Cristian-VM2
cfea38c5a7 #2405 refactor e2e test, fix uninstalled apps not being removed from the request manager 2024-03-28 15:34:47 +00:00
Cristian-VM2
1e1eea47f1 #2405 add e2e test for application install and uninstall, refactor input params 2024-03-28 14:08:08 +00:00
Cristian-VM2
f83d9cb1b0 #2405 refactor application_uninstall_action to re-use existing code in uninstall_application 2024-03-28 12:14:05 +00:00
Cristian-VM2
8612842b74 #2405 remove .lower from _read_application_type, rename _software_manager to _software_request_manager in base.py 2024-03-28 12:01:36 +00:00
Marek Wolan
350b988318 #2418 Fix broken property 2024-03-28 11:29:22 +00:00
Marek Wolan
09caa55c65 #2418 - Add printer and wireless router as node types in network show 2024-03-28 11:29:22 +00:00
Marek Wolan
c29c3971fa #2418 - add wildcard masks and from_config tests to routers 2024-03-28 11:29:22 +00:00
Marek Wolan
e21c59dff1 #2418 - Change test config 2024-03-28 11:29:22 +00:00
Marek Wolan
b12dee73ba #2418 Fix wireless router from config 2024-03-28 11:29:22 +00:00
Marek Wolan
4301f3fdba #2418 Add Printer and Wireless router to config parser 2024-03-28 11:29:22 +00:00
Cristian-VM2
9b6135524e #2504 update application_install_action docstring 2024-03-28 11:08:30 +00:00
Cristian-VM2
d5b5c7d47a #2405 simplify implementation 2024-03-28 11:02:26 +00:00
Cristian-VM2
cddb39e8e9 #2405 update docstrings 2024-03-28 10:43:57 +00:00
Marek Wolan
0d0b5bc7d9 fix previous commit 2024-03-27 22:11:37 +00:00
Marek Wolan
cae9f64b93 New observations 2024-03-27 22:11:02 +00:00
Cristian-VM2
8bb7f8a177 #2405 add application install and remove actions 2024-03-27 17:07:12 +00:00
Marek Wolan
3d996f05bd Merged PR 318: #2418 Add Printer and Wireless router to config parser
## Summary
Add ability to parse printers and wireless routers from yaml config.

## Test process
Existing unit tests pass. Added a printer to one of the test yamls. Adding a wireless router as well now.

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

Related work items: #2418
2024-03-27 13:35:33 +00:00
Cristian Genes
de2e5d0b7d Merged PR 317: Add actions for application close, scan and fix. Rename software patch to fix
## Summary
Added actions for application close, scan and fix
Renamed software patch to software fix
Fixed and enabled `test_node_service_scan_integration`

## Test process
All tests passed locally

## 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: #2404
2024-03-27 09:21:12 +00:00
Marek Wolan
fbb4eba6b7 Draft new observation space config 2024-03-27 03:27:44 +00:00