-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
environment_generation.py not working properly #23
Comments
Temporarily fixed by replacing
with
|
@jaromiru I cannot repro. Could you confirm which version of ~/CyberBattleSim_public$ pip freeze | grep bool
boolean.py==3.8 Repro: from cyberbattle.simulation.environment_generation import create_random_environment
import cyberbattle.simulation.commandcontrol as commandcontrol
env = create_random_environment('test', 10)
c2 = commandcontrol.CommandControl(env)
c2.print_all_attacks() Output:
|
That's weird. I have
Not an empty DataFrame. Are you sure the import |
Yes the import is loading from my source directory: > print(commandcontrol.__file__)
/home/azureuser/CyberBattleSim_public/cyberbattle/simulation/commandcontrol.py I am also using Python version 3.8.9, not sure if this matters. I'll keep trying to get a repro. |
The problem is definitely within the boolean library. import boolean
ALGEBRA = boolean.BooleanAlgebra()
ALGEBRA.parse('1&~1').simplify() # OK
ALGEBRA.TRUE.dual = type(ALGEBRA.FALSE)
ALGEBRA.FALSE.dual = type(ALGEBRA.TRUE)
ALGEBRA.parse('1&~1').simplify() # Exception $ pip freeze | grep boolean
boolean.py==3.8
$ python -V
Python 3.8.10 |
I could repro but I had to first fix another bug in e287436#diff-d01efcd79fb6d8316931c9a4f8a9578bc9908c4c69f2c613e606db2ebff3944f |
@jaromiru The main branch of the boolean.py package has an alternative fix for this bug. It's not yet released on PyPI though: |
@jaromiru I have just verified that the fix in branch
I'll send a PR with a fix soon. |
Ouch, my bad. Forgot to mention that :-D I'll get to test it on Monday. |
Environment instantiated with
create_random_environment()
fromenvironment_generation.py
is not working properly.Minimal code:
Exception:
I have traced the error to this
potential_linux_vulns
:The precondition is translated into
AND(FALSE, NOT(FALSE))
which fails to be simplified with theboolean
library.The used workaround in
actions.py
(from bastikr/boolean.py#82) does not help:The text was updated successfully, but these errors were encountered: