Граф коммитов

98 Коммитов

Автор SHA1 Сообщение Дата
Marc-Alexandre Côté 14504d74b0
Typo in logging message when blocking incoming connections. (#153)
The logging message should read "incoming" instead of "outgoing".
2024-10-07 18:48:15 -07:00
dependabot[bot] 8b92f59b6c
Bump notebook from 7.0.7 to 7.2.2 (#151)
Bumps [notebook](https://github.com/jupyter/notebook) from 7.0.7 to 7.2.2.
- [Release notes](https://github.com/jupyter/notebook/releases)
- [Changelog](https://github.com/jupyter/notebook/blob/@jupyter-notebook/tree@7.2.2/CHANGELOG.md)
- [Commits](https://github.com/jupyter/notebook/compare/@jupyter-notebook/tree@7.0.7...@jupyter-notebook/tree@7.2.2)

---
updated-dependencies:
- dependency-name: notebook
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-29 13:53:34 -07:00
dependabot[bot] 94dc0bd076
Bump jupyterlab from 4.0.11 to 4.2.5 (#150)
* Bump jupyterlab from 4.0.11 to 4.2.5

Bumps [jupyterlab](https://github.com/jupyterlab/jupyterlab) from 4.0.11 to 4.2.5.
- [Release notes](https://github.com/jupyterlab/jupyterlab/releases)
- [Changelog](https://github.com/jupyterlab/jupyterlab/blob/@jupyterlab/lsp@4.2.5/CHANGELOG.md)
- [Commits](https://github.com/jupyterlab/jupyterlab/compare/@jupyterlab/lsp@4.0.11...@jupyterlab/lsp@4.2.5)

---
updated-dependencies:
- dependency-name: jupyterlab
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update requirements.dev.txt

* Update requirements.dev.txt

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: William Blum <wiblum@microsoft.com>
2024-08-29 12:15:21 -07:00
Marc-Alexandre Côté 06f33ccc2e
Make .reset return StepInfo instead of empty dict. Change render.modes to render_mode according to Gymnasium warning (#148) 2024-08-13 14:38:51 -07:00
William Blum 1251f67f8f
Remove heavy ipynb notebooks from main branch (#147)
* chore: Update publish_benchmarks.sh script to create benchmark directory before copying files

Remove heavy notebooks

chore: Remove trailing-whitespace hook and update check-yaml hook configuration

* chore: Update notebook_benchmark parameters for different environments

Adjust the parameters for the notebook_benchmark script to run benchmarks on different environments. This includes changing the gymid, training_episode_count, eval_episode_count, maximum_total_credentials, and plots_dir values for each environment.

Co-authored-by: William Blum <william.blum@microsoft.com>

---------

Co-authored-by: William Blum <william.blum@microsoft.com>
2024-08-08 01:54:07 -07:00
William Blum a03833405c
doc (#146)
chore: Update benchmark script

Co-authored-by: William Blum <william.blum@microsoft.com>
2024-08-07 15:40:18 -07:00
William Blum 8f7078c814
Stable-baselines3 agent working - fix shapes of observation spaces (#144)
* Stable-baselines3 agent working - fix shapes of observation spaces

chore: Update stable-baselines3 agent with env_checker

chore: Update ports list with "Null" value


---------

Co-authored-by: William Blum <william.blum@microsoft.com>
2024-08-07 14:10:08 -07:00
William Blum 4eabac5e60
save notebook cumreward plots to disk (#145)
* notebook cumreward plot to disk

---------

Co-authored-by: William Blum <william.blum@microsoft.com>
2024-08-07 13:53:42 -07:00
William Blum 09622b869c
Migrate to gymnasium (#143)
---------

Co-authored-by: William Blum <william.blum@microsoft.com>
2024-08-06 22:42:10 -07:00
William Blum 399c327719
ruff format notebooks (#142)
* ruff format notebooks
---------

Co-authored-by: William Blum <william.blum@microsoft.com>
2024-08-06 22:08:33 -07:00
William Blum 19271738e2
type fixes (#140)
---------

Co-authored-by: William Blum <william.blum@microsoft.com>
2024-08-06 17:12:35 -07:00
William Blum bdff50afb9
Migrate from autopep8 to ruff (#141)
* Migrate to ruff formatter


---------

Co-authored-by: William Blum <william.blum@microsoft.com>
2024-08-06 16:57:10 -07:00
William Blum 5993016333
Feature type defined using dynamic type assertion to work around limitations of python's type system (#139)
(lack of type-based method overloading)

Co-authored-by: William Blum <william.blum@microsoft.com>
2024-08-06 11:14:21 -07:00
William Blum 55f8d00873
Upgrade pip packages and fix gym-related typing errors (#138)
* chore: Update dependencies and pyright fixes
- Remove trailing whitespace in notebook scripts
- Update dependencies: prompt-toolkit, pip, wheel, progressbar2
- Refactor CyberBattleEnv class to use np_random consistently
- Remove networkx from createstubs.sh
- Update dependencies: networkx, pytest, setuptools, pyright, plotly

---------

Co-authored-by: William Blum <william.blum@microsoft.com>
2024-08-06 01:23:24 -07:00
dependabot[bot] e573f1e0ab
Bump torch from 1.13.1 to 2.2.0 (#135)
* Bump torch from 1.13.1 to 2.2.0

Bumps [torch](https://github.com/pytorch/pytorch) from 1.13.1 to 2.2.0.
- [Release notes](https://github.com/pytorch/pytorch/releases)
- [Changelog](https://github.com/pytorch/pytorch/blob/main/RELEASE.md)
- [Commits](https://github.com/pytorch/pytorch/compare/v1.13.1...v2.2.0)

---
updated-dependencies:
- dependency-name: torch
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

* workaround for out of disk space on github actions runner


Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: William Blum <william.blum@microsoft.com>
2024-08-06 00:10:02 -07:00
Marc-Alexandre Côté 8dfe8fee20
Prepare repo for PyPi release. (#136)
* Fix typo in logging output.

* Add a missing dependency

* Prepare repo for Pypi release.

---------

Co-authored-by: William Blum <wiblum@microsoft.com>
2024-08-05 22:34:55 -07:00
William Blum baf4f6e9e4
gym 0.26 upgrade with new API contract - preparing for migration to gymnasium (#84)
* upgrade to gym 0.26 and fix new typing errors

* Update notebooks with gym 0.26

* end of line

---------

Co-authored-by: William Blum <william.blum@microsoft.com>
2024-08-05 15:47:51 -07:00
William Blum ed86a70995
chore: Remove unused py dependency (#137)
Co-authored-by: William Blum <william.blum@microsoft.com>
2024-08-05 15:35:04 -07:00
dependabot[bot] 3a7228828e
Bump setuptools from 65.5.1 to 70.0.0 (#134)
Bumps [setuptools](https://github.com/pypa/setuptools) from 65.5.1 to 70.0.0.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v65.5.1...v70.0.0)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-03 18:11:23 -07:00
dependabot[bot] d339f484f1
Bump zipp from 3.8.1 to 3.19.1 (#133)
Bumps [zipp](https://github.com/jaraco/zipp) from 3.8.1 to 3.19.1.
- [Release notes](https://github.com/jaraco/zipp/releases)
- [Changelog](https://github.com/jaraco/zipp/blob/main/NEWS.rst)
- [Commits](https://github.com/jaraco/zipp/compare/v3.8.1...v3.19.1)

---
updated-dependencies:
- dependency-name: zipp
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-03 18:11:15 -07:00
William Blum c562dfb0b0 lint fixes 2024-08-04 00:58:45 +00:00
dependabot[bot] 2ffa5bcda0
Bump jupyter-server from 2.7.3 to 2.11.2 (#121)
* Bump jupyter-server from 2.7.3 to 2.11.2

Bumps [jupyter-server](https://github.com/jupyter-server/jupyter_server) from 2.7.3 to 2.11.2.
- [Release notes](https://github.com/jupyter-server/jupyter_server/releases)
- [Changelog](https://github.com/jupyter-server/jupyter_server/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jupyter-server/jupyter_server/compare/v2.7.3...v2.11.2)

---
updated-dependencies:
- dependency-name: jupyter-server
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update requirements.dev.txt

* Update requirements.dev.txt

* Update requirements.dev.txt

* Update requirements.dev.txt

* Update requirements.dev.txt

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: William Blum <wiblum@microsoft.com>
2024-06-04 14:12:20 -07:00
William Blum fae7beb1a0
update notebooks (#116)
Co-authored-by: William Blum <william.blum@microsoft.com>
2024-06-04 12:54:38 -07:00
dependabot[bot] 0dccfe5567
Bump jinja2 from 3.1.3 to 3.1.4 (#131)
Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.3 to 3.1.4.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.1.3...3.1.4)

---
updated-dependencies:
- dependency-name: jinja2
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-28 12:45:56 -07:00
dependabot[bot] 554597f973
Bump black from 23.9.1 to 24.3.0 (#128)
Bumps [black](https://github.com/psf/black) from 23.9.1 to 24.3.0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/compare/23.9.1...24.3.0)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-28 12:45:48 -07:00
dependabot[bot] 7f4c70c56b
Bump pillow from 10.0.1 to 10.3.0 (#129)
Bumps [pillow](https://github.com/python-pillow/Pillow) from 10.0.1 to 10.3.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/10.0.1...10.3.0)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-28 12:45:40 -07:00
dependabot[bot] 083f791aef
Bump tqdm from 4.66.1 to 4.66.3 (#130)
Bumps [tqdm](https://github.com/tqdm/tqdm) from 4.66.1 to 4.66.3.
- [Release notes](https://github.com/tqdm/tqdm/releases)
- [Commits](https://github.com/tqdm/tqdm/compare/v4.66.1...v4.66.3)

---
updated-dependencies:
- dependency-name: tqdm
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-03 19:49:00 -07:00
dependabot[bot] d43eedaf62
Bump jupyter-lsp from 2.2.0 to 2.2.2 (#123)
Bumps [jupyter-lsp](https://github.com/jupyter-lsp/jupyterlab-lsp) from 2.2.0 to 2.2.2.
- [Release notes](https://github.com/jupyter-lsp/jupyterlab-lsp/releases)
- [Changelog](https://github.com/jupyter-lsp/jupyterlab-lsp/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jupyter-lsp/jupyterlab-lsp/commits)

---
updated-dependencies:
- dependency-name: jupyter-lsp
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-16 11:12:36 -07:00
dependabot[bot] 6e8dcc2789
Bump jupyterlab from 4.0.7 to 4.0.11 (#125)
Bumps [jupyterlab](https://github.com/jupyterlab/jupyterlab) from 4.0.7 to 4.0.11.
- [Release notes](https://github.com/jupyterlab/jupyterlab/releases)
- [Changelog](https://github.com/jupyterlab/jupyterlab/blob/@jupyterlab/lsp@4.0.11/CHANGELOG.md)
- [Commits](https://github.com/jupyterlab/jupyterlab/compare/@jupyterlab/lsp@4.0.7...@jupyterlab/lsp@4.0.11)

---
updated-dependencies:
- dependency-name: jupyterlab
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-16 11:12:27 -07:00
dependabot[bot] a74d3f2c9d
Bump notebook from 7.0.5 to 7.0.7 (#124)
Bumps [notebook](https://github.com/jupyter/notebook) from 7.0.5 to 7.0.7.
- [Release notes](https://github.com/jupyter/notebook/releases)
- [Changelog](https://github.com/jupyter/notebook/blob/@jupyter-notebook/tree@7.0.7/CHANGELOG.md)
- [Commits](https://github.com/jupyter/notebook/compare/@jupyter-notebook/app@7.0.5...@jupyter-notebook/tree@7.0.7)

---
updated-dependencies:
- dependency-name: notebook
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-16 11:12:16 -07:00
dependabot[bot] c2de9e42ce
Bump jinja2 from 3.1.2 to 3.1.3 (#122)
Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.1.2...3.1.3)

---
updated-dependencies:
- dependency-name: jinja2
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-16 11:12:04 -07:00
dependabot[bot] 1fbb22eadc
Bump markdown-it-py from 0.5.8 to 2.2.0 (#120)
* Bump markdown-it-py from 0.5.8 to 2.2.0

Bumps [markdown-it-py](https://github.com/executablebooks/markdown-it-py) from 0.5.8 to 2.2.0.
- [Release notes](https://github.com/executablebooks/markdown-it-py/releases)
- [Changelog](https://github.com/executablebooks/markdown-it-py/blob/master/CHANGELOG.md)
- [Commits](https://github.com/executablebooks/markdown-it-py/compare/v0.5.8...v2.2.0)

---
updated-dependencies:
- dependency-name: markdown-it-py
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update jupytext version to 1.15.2

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: William Blum <william.blum@microsoft.com>
2023-11-30 12:14:09 -08:00
William Blum 3d9a61a623
Update dependencies in requirements.dev.txt #118 (#119)
Co-authored-by: William Blum <william.blum@microsoft.com>
2023-11-30 08:46:54 -08:00
William Blum 31a39c103d
Fix bug where `time()` was referring to the wrong module and was returning the NULL time. #95 (#114)
Upgrade pyright

Co-authored-by: William Blum <william.blum@microsoft.com>
2023-10-13 16:37:21 -07:00
William Blum dc1b92e5e8
Fix python version to 3.9 #111 (#113)
Co-authored-by: William Blum <william.blum@microsoft.com>
2023-10-13 13:57:18 -07:00
William Blum f4b0db84d5
Doc update on conda (#108)
* Remove venv references in README.md

* Update README.md
2023-08-30 16:37:11 -07:00
William Blum 1591a1de14
Simplify setup with conda (#106)
Simplify setup with conda, address issue #104 and recurrent regressions caused by apt/python package changes

- Remove the custom bash script logic to install dependencies in favor of a single conda yaml file
- Docker build and CI yaml files updated to use the conda environment
- update Github Actions CI, and merge `push` and `pullrequest`  yamls for Github actions; remove ADO yaml
- fix jupyter root
- run_all.sh starts jupyter from the source root dir
- Add conda dependencies: ORCA, xvfb, plotly::plotly-orca==1.3.1, xorg-x11-server-xvfb-cos6-x86_64

---------

Co-authored-by: William Blum <william.blum@microsoft.com>
2023-08-30 15:49:53 -07:00
William Blum bb9f70116f
Mitigation for gym setup error - Fix #100 (#101)
See https://github.com/freqtrade/freqtrade/issues/8078
```
error in gym setup command: 'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specif
```

Co-authored-by: William Blum <william.blum@microsoft.com>
2023-02-20 10:21:31 -08:00
William Blum 384b2e60fb
Dependabot fixes (#98)
* Dependabot fixes (upgrade pytorch and setuptools)


Co-authored-by: William Blum <william.blum@microsoft.com>
2023-01-03 17:53:31 -08:00
William Blum 99b815e7a7
Fix #92 (#93)
Co-authored-by: William Blum <william.blum@microsoft.com>
2023-01-03 10:51:08 -08:00
William Blum 4fd228bccf
Support for stable-baseline3 RL algorithms (#86)
This PR implements changes to the CyberBattleEnv's observation and action space to be consumable by the gym RL algorithms from https://stable-baselines3.readthedocs.io/en/master/
Changes include:
- Observation fields can now be optionally padded to the shape
expected by their corresponding gym space. (Requires more memory but is
needed to train with stable-baseline agents)
- Add gym wrappers to flatten the Action and Observation spaces from CyberBattleSim
- Add option to CyberBattleEnv to allow invalid moves and return negative reward instead
- Flatten multi-dimensioned `MultiBinary` spaces
    * works with spaces.MultiBinary([list]) and spaces.MultiBinary(number)
    * working with `nodes_privilegelevel`
    * works with `leaked_credentials`
    * works with `credential_cache_matrix`
    * works with `discovered_nodes_properties`
- Add a `stable-baseline` test notebook
- Fix some python 3.8 warnings

Co-authored-by: William Blum <william.blum@microsoft.com>
2022-09-23 21:25:23 -07:00
William Blum 9b4d29418a
Upgrade to python 3.9 (#83)
* upgrade to python 3.9

* add latest nvidia apt keys

Co-authored-by: William Blum <william.blum@microsoft.com>
2022-09-22 13:07:21 -07:00
William Blum c289695c46
CI fixes, requires networkx upgrade to 2.8.6 (#85)
* regression: typing annotation breaks on python 3.8
* Cache key should depend on createstub script content
* mill all notebooks on PR merges
* remove extra file
* create stub directory if not exist
* fix runall.sh
* make `bounds` a public property
* upgrade to networkx 2.8.6 to fix breaking regression in when plotting graph

Co-authored-by: William Blum <william.blum@microsoft.com>
2022-09-21 12:42:22 -07:00
William Blum ae98ff56af
upgrade pyright, torch, numpy, matplotlib and gym (#82)
* upgrade torch, numpy, matplotlib, gym (0.21.0)
* upgrade pyright
* fix typing errors
* remove data-science-types stubs
* install missing ipykernel
* fix typing issue in running_mean

Co-authored-by: William Blum <william.blum@microsoft.com>
2022-09-20 11:27:33 -07:00
William Blum b823d06d69
Github action to mill notebooks (#80)
Co-authored-by: William Blum <william.blum@microsoft.com>
2022-09-11 09:26:53 -07:00
William Blum c5d26eefd5
Fix regresssion #68 where nodes were incorrectly interpreted as owned when calculating rewards (#79)
Regression was introduced in commit 2f6a045d41

Co-authored-by: William Blum <william.blum@microsoft.com>
2022-09-09 14:29:36 -07:00
William Blum e28ad781c6
Fix two bugs caught by pyright (#77)
- Make `FirewallConfiguration` dataclass and `FirewallRule` frozen dataclass
- Boolean value not properly returned by __mark_discovered_nodes
- discovered nodes values should not be added to the reward unless the nodes just got owned

Co-authored-by: William Blum <william.blum@microsoft.com>
2022-09-09 09:20:56 -07:00
William Blum e8493f0aa8
Upgrade to boolean.py 4.0 (#76)
Co-authored-by: William Blum <william.blum@microsoft.com>
2022-09-08 19:08:51 -07:00
William Blum 474794f4d4
Upgrade flake8 and pin version in CI (#75)
Co-authored-by: William Blum <william.blum@microsoft.com>
2022-09-08 19:02:10 -07:00
William Blum 2f6a045d41
Capturing a node via a remote exploit should reward the attacker with the node value #71 (#72)
Co-authored-by: William Blum <william.blum@microsoft.com>
2022-08-19 11:13:08 -07:00