Skip to content

Commit 27c06cf

Browse files
committed
Cryptojacker: Use PercentLimited for cpu and memory util options
1 parent 6704a24 commit 27c06cf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

monkey/agent_plugins/payloads/cryptojacker/src/cryptojacker_options.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
from pydantic import Field, conint
1+
from pydantic import Field
22

33
from common.base_models import InfectionMonkeyBaseModel
4+
from common.types import PercentLimited
45

56

67
class CryptojackerOptions(InfectionMonkeyBaseModel):
@@ -11,12 +12,12 @@ class CryptojackerOptions(InfectionMonkeyBaseModel):
1112
default=300, # 5 minutes
1213
ge=0,
1314
)
14-
cpu_utilization: conint(ge=0, le=100) = Field( # type: ignore[valid-type]
15+
cpu_utilization: PercentLimited = Field( # type: ignore[valid-type]
1516
title="CPU utilization",
1617
description="The percentage of CPU to use on a machine",
1718
default=80,
1819
)
19-
memory_utilization: conint(ge=0, le=100) = Field( # type: ignore[valid-type]
20+
memory_utilization: PercentLimited = Field( # type: ignore[valid-type]
2021
title="Memory utilization",
2122
description="The percentage of memory to use on a machine",
2223
default=20,

0 commit comments

Comments
 (0)