Commit Graph

1085 Commits

Author SHA1 Message Date
Marek Wolan
294c8b982f Add convenience method for router acl 2024-01-08 13:28:55 +00:00
Marek Wolan
27f70204ed Fix minor issues in actions 2024-01-08 13:28:34 +00:00
Marek Wolan
2f97dcb6f9 Merge remote-tracking branch 'origin/dev' into feature/2137-refactor-request-api 2024-01-08 10:39:24 +00:00
Marek Wolan
81734e7ad3 Merged PR 241: Add service patch and fix apply timestep issues.
## Summary
Replaces Action ID 13 in UC2 with SERVICE.PATCH.
Fixes issue where apply_timestep was not happening at all
Fixes issue where file actions were not correctly being forwarded

## Test process
All pytests passing including a new one for service patch.

## 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: #2143
2024-01-05 09:58:16 +00:00
Marek Wolan
7d81b1cb07 Merged PR 242: Change software describe state keys
## Summary
Tiny change to change the names of the keys in `software.describe_state()`
Also fixed the observation to use the visible health state instead of the actual health state (and therefore the blue agent will actually have to scan to learn the health state)

## Test process
Unit 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
- [ ] 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

Change software describe state keys

Related work items: #2160
2024-01-04 14:50:37 +00:00
Marek Wolan
ec7723732b Merge remote-tracking branch 'origin/dev' into feature/2137-refactor-request-api 2024-01-04 14:40:20 +00:00
Marek Wolan
bc367222a8 Change software describe state keys 2024-01-04 12:55:46 +00:00
Marek Wolan
528e3b22a9 Add integration tests 2024-01-04 12:47:35 +00:00
Marek Wolan
25c8ec2ec9 Add skeleton for action integration and unit tests 2024-01-03 18:19:10 +00:00
Marek Wolan
48f1d13fd8 Minor refactor and add comment 2024-01-03 16:23:44 +00:00
Marek Wolan
3adf1f9f6a bump version 2024-01-03 14:49:40 +00:00
Marek Wolan
2aa7c18ad3 Merge remote-tracking branch 'origin/dev' into bugfix/2143-node-service-patch-main 2024-01-03 14:43:46 +00:00
Marek Wolan
2135bdcd10 Add unit test 2023-12-21 16:08:09 +00:00
Marek Wolan
fa585168de update marl config with service patch bugfix 2023-12-21 15:10:23 +00:00
Marek Wolan
96f8435c5e Add service patch and fix other bugs 2023-12-21 15:07:41 +00:00
Marek Wolan
e33f74e3f2 bump version to 3.0.0b3dev 2023-12-21 09:28:14 +00:00
Marek Wolan
a1dcfa291b Update test configs with new action spec 2023-12-21 09:25:54 +00:00
Marek Wolan
a798d262b8 use names instead of uuids for requests 2023-12-18 14:03:47 +00:00
Marek Wolan
ffeb04d6ed Merged PR 235: Refactor describe_state to use name/hostname instead of UUID as primary key
## Summary
- Refactor Simulator state to use service/application name instead of UUID, and node hostname instead of UUID.
- Refactor observations to read the hostname/name instead of UUID.
- Refactor rewards as well.
- Refactor configs to specify name instead of reference that will be translated to UUID.

## Test process
Existing unit tests pass. Inspected the printout from running 'describe_state' on arcd_uc2_network' to verify that names are used to report state.

## Checklist
- [x] PR is linked to a **work item**
- [x] **acceptance criteria** of linked ticket are met
- [x] performed **self-review** of the code
- [na] written **tests** for any new functionality added with this PR
- [na] updated the **documentation** if this PR changes or adds functionality
- [x] written/updated **design docs** if this PR implements new functionality
- [na] 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: #2131
2023-12-15 16:02:29 +00:00
Nick Todd
360a86188c Merged PR 233: NTP server and client
## Summary
The NTP Server and Client are created as two separate classes NTPServer and NTPClient which define the methods used to send and receive time data. A set of classes used in the sending and receiving of requests and data is in ntp.py. A single file, test_ntp_client_server.py is used to run the unit tests.
The changes have no impact on other parts of the codebase.

## Test process
Created simple two node network representing NTP server and client. Created NTP server and client objects and client requests and receives date/time from server.

## Checklist
- [Y] PR is linked to a **work item**
- [Y] **acceptance criteria** of linked ticket are met
- [Y] performed **self-review** of the code
- [Y] 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
- [N] attended to any **TO-DOs** left in the code

Related work items: #2041, #2042
2023-12-15 14:26:17 +00:00
Marek Wolan
7a1abb1ef8 Minor fixes based on code review 2023-12-15 13:09:50 +00:00
Marek Wolan
495d847a71 Use service and app name for node software requests 2023-12-15 13:04:18 +00:00
Nick Todd
2d892d4a5a 2041: Tidy up test comments 2023-12-15 10:52:46 +00:00
Nick Todd
0cfd525ab8 2041: change comparison operator in test 2023-12-15 10:14:35 +00:00
Marek Wolan
a16028d10c Merge remote-tracking branch 'origin/feature/2131-refactor-describe-state' into feature/2137-refactor-request-api 2023-12-15 10:10:39 +00:00
Nick Todd
fab39b1506 Merge branch 'dev' into feature/2041_2042-Add-NTP-Services 2023-12-15 09:50:19 +00:00
Marek Wolan
6a80f4cc77 Make game layer work with new state api 2023-12-14 14:04:43 +00:00
Marek Wolan
1ec7df1170 Change describe_state to use names instead of uuids 2023-12-14 11:19:32 +00:00
Czar Echavez
0aeaeaa60f Merged PR 234: #2059: Denial of Service Bot
## Summary
- Moved DataManipulationBot into red applications - these are applications, not services
- moved the connection handling from Service base class to the IOSoftware base class
  - Applications and Services can track the connections they make
  - increased default max sessions to 100
  - made sure the services/applications that are dependent on connections use the IOSoftware connections
- DoSBot follows some sort of kill chain, although at the moment it just:
  - runs a port scan with a 10% success chance (by default)
  - runs a DoS attack that fills a service's max sessions

## Test process
unit test in https://dev.azure.com/ma-dev-uk/PrimAITE/_git/PrimAITE/pullrequest/234?path=/tests/unit_tests/_primaite/_simulator/_system/_applications/_red_applications/test_dos_bot.py&_a=files

integration test in https://dev.azure.com/ma-dev-uk/PrimAITE/_git/PrimAITE/pullrequest/234?path=/tests/integration_tests/system/red_applications/test_dos_bot_and_server.py&_a=files

## 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: #2059
2023-12-14 10:16:34 +00:00
Czar Echavez
592e1a3610 #2059: apply suggestions from PR + adding another test that checks for dos affecting green agent 2023-12-13 11:56:25 +00:00
Nick Todd
f7b5c8ae2f 2041: Remove NTPRequest class (review comment) 2023-12-13 10:34:52 +00:00
Czar Echavez
f0be77c79b #2059: configure missing configurable items 2023-12-12 17:20:31 +00:00
Nick Todd
e620771c8d 2041: Remove IP address from NTP client (review comment) 2023-12-12 17:08:11 +00:00
Czar Echavez
4f79d2ad36 #2059: moved connection handling from Service to IOSoftware + changes that now utilise connections from IOSoftware + dos bot attacking now works + tests 2023-12-12 17:01:03 +00:00
Czar Echavez
1b124035a1 Merge remote-tracking branch 'origin/dev' into feature/2059-denial-of-service-bot-post-beta-2 2023-12-11 08:57:59 +00:00
Czar Echavez
cd5ed48b00 #2059: implementing the service connections limit 2023-12-08 17:07:57 +00:00
Czar Echavez
094e89fff1 #2059: Renamed Red service to red application and moved the datamanipulation bot to the red application folder 2023-12-08 14:54:29 +00:00
Nick Todd
c3015b7f0e Merge branch 'dev' into feature/2041_2042-Add-NTP-Services 2023-12-07 14:55:01 +00:00
Nick Todd
44ada941e6 2041: Reinstate test for ntp_server failure 2023-12-07 14:22:27 +00:00
Marek Wolan
e93fb85672 Merged PR 232: Allow cancelling jobs
## Summary
Fix the azure build pipeline job conditions to correctly stop the job if we cancel the build.

Related work items: #2103
2023-12-07 13:49:08 +00:00
Marek Wolan
385a4997ce New parameter for publishing code coverage 2023-12-07 10:35:50 +00:00
Nick Todd
50a6e17fab 2041: Make NTP work with TCP transport layer 2023-12-06 16:42:28 +00:00
Nick Todd
12ede2329b 2041: Add network config and pytest fixture 2023-12-06 16:41:10 +00:00
Marek Wolan
75f732dacf bump version to 3.0.0b2 2023-12-04 13:08:13 +00:00
Marek Wolan
30b0f12a8d Allow cancelling jobs 2023-12-04 11:34:17 +00:00
Nick Todd
39694fcec2 Merge branch 'dev' into feature/2041_2042-Add-NTP-Services 2023-12-04 11:23:35 +00:00
Christopher McCarthy
4cc2674745 Merged PR 229: Step metadata json output
## Summary
- Added step metadata json file dumps to the environments. Fixed serialization issues in the Switch and ACLRule classes.

## Test process
Nothing outside of a manual inspection for now.

## 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: #2085
2023-12-04 10:47:09 +00:00
Marek Wolan
01b9e661ce Clean up print statements. 2023-12-04 10:45:33 +00:00
Marek Wolan
a5c4f7797d Make saving step metadata optional 2023-12-04 10:42:20 +00:00
Marek Wolan
8ea9db2d34 Merge remote-tracking branch 'origin/dev' into feature/2085-dump_describe_state 2023-12-04 10:38:41 +00:00