Commit Graph

1160 Commits

Author SHA1 Message Date
Marek Wolan
261423bc78 Update changelog 2024-01-31 13:54:15 +00:00
Marek Wolan
83db5b1eb5 Fix node file delete action 2024-01-31 13:50:20 +00:00
Marek Wolan
41a7f83887 Add file scan test 2024-01-31 13:29:46 +00:00
Marek Wolan
d6a83fd1fb Update action tests to use name, not uuid 2024-01-31 11:55:38 +00:00
Marek Wolan
6aa6383fb7 Fix broken test configs 2024-01-31 11:44:56 +00:00
Marek Wolan
9f993dda57 Fix test config discrepancies 2024-01-31 10:48:40 +00:00
Marek Wolan
0dbaa66aa3 Merge remote-tracking branch 'origin/dev' into feature/2137-refactor-request-api 2024-01-31 10:05:09 +00:00
Marek Wolan
0c3304b1fd Merged PR 263: Several hotfixes
## Summary
Hotfixes from 3.0.0b4, b5, b6. These have all gone thru the PR process already we just need to sync dev back.

## Test process
Merge conflicts resolved and all automated tests pass.

## 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: #2161, #2173, #2174, #2175, #2176, #2179, #2208, #2218, #2219, #2220
2024-01-30 15:18:21 +00:00
Marek Wolan
def52f94e3 Add docstrings and update typos 2024-01-30 09:56:16 +00:00
Marek Wolan
bea72aa6a9 Fix ftp client connection list 2024-01-29 12:28:44 +00:00
Marek Wolan
555802baaa Merge remote-tracking branch 'origin/dev' into dev-v3.0.0b6 2024-01-29 10:26:28 +00:00
Marek Wolan
2ba05e7348 Fixed being unable to specify all addresses in acl rule 2024-01-25 15:17:09 +00:00
Marek Wolan
0056bfddee Bump version to 3.0.0b6 2024-01-25 14:59:24 +00:00
Marek Wolan
5a9eaeb185 Update the readme 2024-01-25 14:59:00 +00:00
Marek Wolan
a3a7d11ff7 Merged PR 261: Make sure notebook images get copied
Just made sure that notebook images get copied to user notebook directory.
2024-01-25 15:24:38 +00:00
Marek Wolan
51be271928 Merged PR 260: Beta 6 Fixes
Please run some of these changes locally. Read the notebook, check that it makes sense, and run the code cells to see if they produce the result you expect.

## Summary
Apologies that all these fixes are part of 1 massive PR instead of individual PRs. I thought it was going to be a quick job and it spiralled out of control.

Changes:
- Fixed a bug where ACL rules were not resetting on episode reset.
- Fixed a bug where blue agent's ACL actions were being applied against the wrong IP addresses
- Fixed a bug where deleted files and folders did not reset correctly on episode reset.
- Fixed a bug where service health status was using the actual health state instead of the visible health state
- Fixed a bug where the database file health status was using the incorrect value for negative rewards
- Fixed a bug preventing file actions from reaching their intended file
- Made database patch correctly take 2 timesteps instead of being immediate
- Made database patch only possible when the software is compromised or good, it's no longer possible when the software is OFF or RESETTING
- Temporarily disable the blue agent file delete action due to crashes. This issue is resolved in another branch that will be merged into dev soon.
- Fix a bug where ACLs were not showing up correctly in the observation space.
- Added a recap of agent actions to the `info` output of `step()`
- Added a notebook which explains UC2, demonstrates the attack, and shows off blue agent's action space, observation space, and reward function.

## Test process
New notebook verifies end-to-end UC2 functionality.

## Checklist
- [y] PR is linked to a **work item**
- [y] **acceptance criteria** of linked ticket are met
- [y] performed **self-review** of the code
- [~] written **tests** for any new functionality added with this PR
- [y] updated the **documentation** if this PR changes or adds functionality
- [n] written/updated **design docs** if this PR implements new functionality
- [y] updated the **change log**
- [y] ran **pre-commit** checks for code style
- [y] attended to any **TO-DOs** left in the code

Related work items: #2208, #2218, #2219, #2220
2024-01-25 15:15:48 +00:00
Marek Wolan
7f996ca16a Make sure notebook images get copied 2024-01-25 14:52:48 +00:00
Marek Wolan
4b98c1f630 Update uc2 notebook 2024-01-25 14:43:49 +00:00
Marek Wolan
73a75c497b Fix test 2024-01-25 13:13:50 +00:00
Marek Wolan
e7aac754a0 Update the changelog 2024-01-25 12:38:28 +00:00
Marek Wolan
99723b6578 Update notebook with more images. 2024-01-25 12:33:18 +00:00
Marek Wolan
28acb5dcae Populate step info in environment, and finish notebook 2024-01-25 12:04:09 +00:00
Marek Wolan
0a65f32adf Fix ACL observations 2024-01-25 09:27:08 +00:00
Marek Wolan
88c1d16f11 Fix Router acl not clearing 2024-01-23 14:34:05 +00:00
Marek Wolan
8e19e05f57 Fix acl actions for blue agent. 2024-01-21 17:29:19 +00:00
Marek Wolan
42d00e0440 Fix issue where file deleted flag wouldn't be reset 2024-01-21 16:33:51 +00:00
Marek Wolan
7d218c5201 bump version 2024-01-15 10:31:13 +00:00
Marek Wolan
edc9772d0a Fix typo in database restore 2024-01-15 10:10:30 +00:00
Marek Wolan
728f80cc21 Temporarily disable file delete action 2024-01-15 09:48:14 +00:00
Marek Wolan
e0033de7b6 Fix folder reset 2024-01-12 14:54:55 +00:00
Marek Wolan
842e59f596 Database patch 2024-01-11 15:40:37 +00:00
Marek Wolan
ed5591caf8 Minor fix 2024-01-11 14:49:36 +00:00
Marek Wolan
63b9bc5bc6 3.0.0b5 2024-01-11 11:13:43 +00:00
Marek Wolan
40ad446ff2 Merged PR 257: Fix reward data type
Related work items: #2179
2024-01-11 11:07:01 +00:00
Marek Wolan
4d1c0d268e Fix reward data type 2024-01-11 11:05:55 +00:00
Marek Wolan
b11e4c8ccd update changelog 2024-01-11 11:05:00 +00:00
Marek Wolan
f283afc04a Merged PR 256: Align the database backup and corruption processes with IYak
## Summary
**Changed:**
- Copying a file via FTP also copies its health status
- The database automatically attempts to make a backup on step 1
- make the db file a property that is fetched by name from the file system instead of a handle to a file (bruh)
- fixed ftp server re-sending requests back to the client
- fix issue where links with >100% bandwidth cause the observation space to crash
- fix issue where starting a node didn't start services. (not sure how that one passed tests previously)

**To align with Yak:**
- database service removed from uc2 observation space
- sql attack affects the file health status instead of the service
- when the web server fails to fetch data, it goes into compromised state until a successful data fetch

## Test process
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
- [ ] 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: #2176
2024-01-11 10:54:25 +00:00
Marek Wolan
d2a2472e5f Apply bugfix 2151 2024-01-11 10:49:32 +00:00
Marek Wolan
e57c240b9b Apply cosmetic changes based on review. 2024-01-11 09:55:09 +00:00
Marek Wolan
2d1041e7b3 Fix final bugs 2024-01-10 18:38:37 +00:00
Marek Wolan
1505d08721 Fix backup issues and align with Yak 2024-01-10 18:04:48 +00:00
Marek Wolan
b34f2a5c8c Merged PR 253: Make observations use software health state visible instead of actual.
We already merged this change into dev, I just replicated it for b5.

Related work items: #2161, #2174
2024-01-10 13:53:05 +00:00
Marek Wolan
3486347566 Merged PR 252: Align Software health state enum with CAOS
Related work items: #2175
2024-01-10 13:52:46 +00:00
Marek Wolan
9fce9ceea4 Merged PR 255: Fix issue where red agent acted too early
## Fixed:
- data manipulation red agent now considers episode reset when calculating next action time
- Moved attack logic out of data manipulation bot `run` method into dedicated `attack` method, because `run` is triggered by episode reset logic. This means the attack no longer always happens at step 1 of every episode.

## 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
- [na] updated the **documentation** if this PR changes or adds functionality
- [na] 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: #2173
2024-01-10 13:52:33 +00:00
Czar Echavez
62197fe72b Merged PR 254: #2151: remove changing of health_state_actual in actions and tests
## Summary
Removed the changing of health_state_actual from the actions - only few places where the health_state_actual is changed:
- compromised in specific scripted events
- set to good when started (if the state is still at UNUSED
- set to good after patching

## Test process
unit tests
https://dev.azure.com/ma-dev-uk/PrimAITE/_git/PrimAITE/pullrequest/254?_a=files&path=/tests/unit_tests/_primaite/_simulator/_system/_services/test_services.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

#2151: remove changing of health_state_actual in actions and tests

Related work items: #2151, #2166
2024-01-10 13:35:51 +00:00
Marek Wolan
9d06284edb Merge remote-tracking branch 'origin/dev-v3.0.0b5' into bugfix/2176-attack-observation-symptoms 2024-01-10 13:07:23 +00:00
Marek Wolan
66a42ebc69 Make database failure based on file status not service status 2024-01-10 13:06:48 +00:00
Czar Echavez
c985b8793d #2151 and #2166: added tests for application being unused + even more tests 2024-01-10 11:58:36 +00:00
Marek Wolan
b6e414bd70 Update changelog 2024-01-10 09:14:07 +00:00
Marek Wolan
b7cc940e9d Remove temporary print statements 2024-01-10 09:07:51 +00:00