Package: nasim
Status: Stable release. No extra development is planned, but still being maintained (bug fixes, etc).Network Attack SimulatorNetwork Attack Simulator (NASim) is a simulated computer network complete with vulnerabilities, scans and exploits designed to be used as a testing environment for AI agents and planning techniques applied to network penetration testing.InstallationThe easiest way to install the latest version of NASim hosted on PyPi is via pip:$ pip install nasimTo install dependencies for running the DQN test agent (this is needed to run the demo) run:$ pip install nasim[dqn]To get the latest bleeding edge version and install in development mode see theInstall docsDemoTo see NASim in action, you can run the provided demo to interact with an environment directly or see a pre-trained AI agent in action.To run thetinybenchmark scenario demo in interactive mode run:$ python -m nasim.demo tinyThis will then run an interactive console where the user can see the current state and choose the next action to take. The goal of the scenario is tocompromiseevery host with a non-zero value.Seeherefor the full list of scenarios.To run thetinybenchmark scenario demo using the pre-trained AI agent, first ensure the DQN dependencies are installed (seeInstallationsection above), then run:$ python -m nasim.demo tiny -aiNote:Currently you can only run the AI demo for thetinyscenario.DocumentationThe documentation is available at:https://networkattacksimulator.readthedocs.io/Using with gymnasiumNASim implements theGymnasiumenvironment interface and so can be used with any algorithm that is developed for that interface.SeeStarting NASim using gymnasium.AuthorsJonathon Schwartz-Jonathon.schwartz@anu.edu.auLicenseMIT© 2020, Jonathon SchwartzWhat’s new2023-05-14 (v 0.12.0) (MINOR release)RenamedNASimEnv.get_minimum_actions -> NASimEnv.get_minumum_hopsto better reflect what it does (thanks @rzvnbr for the suggestion).2023-03-13 (v 0.11.0) (MINOR release)Migrated togymnasium (formerly Open AI gym)fromOpen AI gym (thanks @rzvnbr for the suggestion).Fixed bug with action string representation (thanks @rzvnbr for the bug report)Added “sim to real considerations” explanation document to the docs (thanks @Tudyx for the suggestion)2023-02-27 (v 0.10.1) (MICRO release)Fixed bug for host based actions (thanks @nguyen-thanh20 for the bug report)2022-07-30 (v 0.10.0) (MINOR release)Fixed typos (thanks @francescoluciano)Updates to be compatible with latest version of OpenAI gym API (v0.25) (seeOpen AI gym API docsfor details), notable changes includeUpdated naming convention when initializing environments using thegym.makeAPI (seegym load docsfor details.)Updated reset function to match new gym API (shouldn’t break any implementations using old API)Updated step function to match new gym API. It now returns two bools, the first specifies if terminal/goal state has been reached and the other specifies if the episode is terminated due to the scenario step limit (if any exists) has been reached. This change may break implementations and you may need to specify (or not) when initializing the gym environment usinggym.make(env_id, new_step_api=True)2022-05-19 (v 0.9.1) (MICRO release)Fixed a few bugs and added some tests (thanks @simonsays1980 for the bug reports)2021-12-20 (v 0.9.0) (MINOR release)The value of a host is now observed when any level of access is gained on a host. This makes it so that agents can learn to decide whether to invest time in gaining root access on a host or not, depending on the host’s value (thanks @jaromiru for the proposal).Initial observation of reachable hosts now contains the host’s address (thanks @jaromiru).Added some support for custom address space bounds in when using scenario generator (thanks @jaromiru for the suggestion).2021-3-15 (v 0.8.0) (MINOR release)Added option of specifying a ‘value’ for each host when defining a custom network using the .YAML format (thanks @Joe-zsc for the suggestion).Added the ‘small-honeypot’ scenario to included scenarios.2020-12-24 (v 0.7.5) (MICRO release)Added ‘undefined error’ to observation to fix issue with initial and later observations being indistinguishable.2020-12-17 (v 0.7.4) (MICRO release)Fixed issues with incorrect observation of host ‘value’ and ‘discovery_value’. Now, when in partially observable mode, the agent will correctly only observe these values on the step that they are recieved.Some other minor code formatting fixes2020-09-23 (v 0.7.3) (MICRO release)Fixed issue with scenario YAML files not being included with PyPi packageAdded final policy visualisation option to DQN and Q-Learning agents2020-09-20 (v 0.7.2) (MICRO release)Fixed bug with ‘re-registering’ Gym environments when reloading modulesAdded example implementations of Tabular Q-Learning:agents/ql_agent.pyandagents/ql_replay.pyAddedAgentssection to docs, along with other minor doc updates2020-09-20 (v 0.7.1) (MICRO release)Added some scripts for running random benchmarks and describing benchmark scenariosAdded some more docs (including for creating custom scenarios) and updated other docs2020-09-20 (v 0.7.0) (MINOR release)Implemented host based firewallsAdded priviledge escalationAdded a demo script, including a pre-trained agent for the ‘tiny’ scenarioFix to upper bound calculation (factored in reward for discovering a host)2020-08-02 (v 0.6.0) (MINOR release)Implemented compatibility with gym.make()Updated docs for loading and interactive with NASimEnvAdded extra functions to nasim.scenarios to make it easier to load scenarios seperately to a NASimEnvFixed bug to do with class attributes and creating different scenarios in same python sessionFixed up bruteforce agent and tests2020-07-31 (v 0.5.0) (MINOR release)First official release on PyPiCleaned up dependencies, setup.py, etc and some small fixes