Skip to content

Commit

Permalink
Merge branch 'prowler-4.0-dev' into cloudtrail-threat-detection
Browse files Browse the repository at this point in the history
  • Loading branch information
sergargar authored Mar 27, 2024
2 parents e101368 + c03f959 commit 9fd2c56
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions prowler/lib/check/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import sys
import traceback
from pkgutil import walk_packages
from resource import setrlimit
from types import ModuleType
from typing import Any

Expand Down Expand Up @@ -448,11 +449,13 @@ def execute_checks(
from resource import RLIMIT_NOFILE, getrlimit

# Check ulimit for the maximum system open files
soft, _ = getrlimit(RLIMIT_NOFILE)
soft, hard = getrlimit(RLIMIT_NOFILE)
if soft < 4096:
logger.warning(
f"Your session file descriptors limit ({soft} open files) is below 4096. We recommend to increase it to avoid errors. Solve it running this command `ulimit -n 4096`. For more info visit https://docs.prowler.cloud/en/latest/troubleshooting/"
logger.info(
f"Your session file descriptors limit ({soft} open files) is below 4096. Updating file descriptors session limit to 4096 during execution only."
)
# Set the soft ulimit to 4096
setrlimit(RLIMIT_NOFILE, (4096, hard))
except Exception as error:
logger.error("Unable to retrieve ulimit default settings")
logger.error(
Expand Down

0 comments on commit 9fd2c56

Please sign in to comment.