Skip to content
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

Minor vulnerabilities in python linter action #4633

Closed
Rebits opened this issue Oct 20, 2023 · 3 comments
Closed

Minor vulnerabilities in python linter action #4633

Rebits opened this issue Oct 20, 2023 · 3 comments
Labels

Comments

@Rebits
Copy link
Member

Rebits commented Oct 20, 2023

Description

Regarding https://github.com/wazuh/wazuh-jenkins/issues/6364 it has been detected minor vulnerabilities in python linter script.

Test python flaws
{
    "new_flaws": [
        {
            "code": " \n import subprocess\n import random\n",
            "filename": "./deployability/modules/workflow_engine/task.py",
            "issue_confidence": "HIGH",
            "issue_severity": "LOW",
            "issue_text": "Consider possible security implications associated with subprocess module.",
            "line_number": 5,
            "line_range": [
                5
            ],
            "more_info": "https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b404-import-subprocess",
            "test_id": "B404",
            "test_name": "blacklist"
        },
        {
            "code": "         try:\n             result = subprocess.run(\n                 [self.task_parameters['path']] + task_args,\n                 check=True,\n                 capture_output=True,\n                 text=True,\n             )\n",
            "filename": "./deployability/modules/workflow_engine/task.py",
            "issue_confidence": "HIGH",
            "issue_severity": "LOW",
            "issue_text": "subprocess call - check for execution of untrusted input.",
            "line_number": 59,
            "line_range": [
                59,
                63
            ],
            "more_info": "https://bandit.readthedocs.io/en/latest/plugins/b603_subprocess_without_shell_equals_true.html",
            "test_id": "B603",
            "test_name": "subprocess_without_shell_equals_true"
        },
        {
            "code": "         time_interval = self.task_parameters.get('time-seconds', [1, 5])\n         sleep_time = random.uniform(time_interval[0], time_interval[1])\n \n",
            "filename": "./deployability/modules/workflow_engine/task.py",
            "issue_confidence": "HIGH",
            "issue_severity": "LOW",
            "issue_text": "Standard pseudo-random generators are not suitable for security/cryptographic purposes.",
            "line_number": 91,
            "line_range": [
                91
            ],
            "more_info": "https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b311-random",
            "test_id": "B311",
            "test_name": "blacklist"
        },
        {
            "code": "     # assure there must be at least one character from each group\n     random_pass = random_pass + ''.join([random.choice(chars) for chars in [string.ascii_lowercase, string.digits, string.ascii_uppercase, SPECIAL_CHARS]])\n     random_pass = ''.join(random.sample(random_pass,len(random_pass)))\n",
            "filename": "./provisioning/roles/wazuh/ansible-wazuh-manager/files/create_user.py",
            "issue_confidence": "HIGH",
            "issue_severity": "LOW",
            "issue_text": "Standard pseudo-random generators are not suitable for security/cryptographic purposes.",
            "line_number": 55,
            "line_range": [
                55
            ],
            "more_info": "https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b311-random",
            "test_id": "B311",
            "test_name": "blacklist"
        }
    ]
}


@pro-akim
Copy link
Member

pro-akim commented Nov 17, 2023

Update

Added: Standard pseudo-random generators are not suitable for security/cryptographic purposes in Weekly 46

@pro-akim
Copy link
Member

Update

New findings were added in the Weekly ## 11 scan

@juliamagan
Copy link
Member

With all the migration of the repository, the dependencies are already being updated. Also, once the entire migration is complete in 4.10.0, security scans will be re-enabled to check this.

@juliamagan juliamagan closed this as not planned Won't fix, can't repro, duplicate, stale Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants