Skip to content

Commit

Permalink
Update parameters documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
GGP1 committed Aug 23, 2023
1 parent 233edec commit 3b54a89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions tests/scans/code_analysis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ As said in the description, the test uses `Bandit` to look for possible Python f

These directories, repository and branch can be passed to the test as parameters so it is possible to run the test in any directory containing Python code inside the Wazuh organization.

Apart from this parameters, there are more that can be used to customize the test functionality. Note that the test will fail if we check different directories and/or repository as we don't have known_flaws files for non-default directories.
Apart from these parameters, there are more that can be used to customize the test functionality. Note that the test will fail if we check different directories and/or repository as we don't have known_flaws files for non-default directories.

- **--repo**: set the repository used. Default: `wazuh`
- **--branch**: set the repository branch. Default: `master`
- **--reference**: set the repository branch. Default: `master`
- **--check_directories**: set the directories to check, this must be a string with the directory name.
If more than one is indicated, they must be separated with comma. Default: `framework/,api/,wodles/`.
- **--exclude_directories**: set the directories to exclude, this must be a string with the directory name.
Expand Down
9 changes: 4 additions & 5 deletions tests/scans/dependencies/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@

## Description
It's a tool used to scan for vulnerabilities in a requirements.txt file.\
It can generate reports via console output or json file. Can be run with `pytest` and manage to handle remote files under github repositories. Requirements file can be specified with `repo`, `branch`, `requirements-path` parameters giving flexibility on file location.
It can generate reports via console output or json file. Can be run with `pytest` and manage to handle remote files under github repositories. Requirements file can be specified with `repo`, `reference`, `requirements-path` parameters giving flexibility on file location.
Output file in which the report will be generated can be specified with `report-path` parameter.

## How to use - Pytest
```
Parameters:
--repo: repository name. Default: 'wazuh'.
--branch: branch name of specified repository. Default: 'master'.
--commit: commit of specified repository. Default: None
--reference: branch name of specified repository. Default: 'master'.
--requirements-path: requirements file path. Default: 'framework/requirements.txt'.
--report-path: output file path. Default: 'dependencies/report_file.json'.
```
### Scanning wazuh-qa requirements file:
```
↪ ~/git/wazuh-qa/tests/scans ⊶ feature/1612-package-vuln-scanner ⨘ python3 -m pytest -vv -x --disable-warnings dependencies/ --repo wazuh-qa --branch master --requirements-path requirements.txt
↪ ~/git/wazuh-qa/tests/scans ⊶ feature/1612-package-vuln-scanner ⨘ python3 -m pytest -vv -x --disable-warnings dependencies/ --repo wazuh-qa --reference master --requirements-path requirements.txt
==================================================================================== test session starts =====================================================================================
platform linux -- Python 3.9.5, pytest-6.2.3, py-1.10.0, pluggy-0.13.1 -- /home/kondent/pythonEnv/qa-env/bin/python3
cachedir: .pytest_cache
Expand Down Expand Up @@ -75,7 +74,7 @@ FAILED dependencies/test_dependencies.py::test_python_dependencies_vuln_scan - A

### Scanning wazuh requirements file with a specific output path:
```
↪ ~/git/wazuh-qa/tests/scans ⊶ feature/1612-package-vuln-scanner ⨘ python3 -m pytest -vv -x --disable-warnings dependencies/ --repo wazuh --branch master --requirements-path framework/requirements.txt --report-path ~/Desktop/report_file.json
↪ ~/git/wazuh-qa/tests/scans ⊶ feature/1612-package-vuln-scanner ⨘ python3 -m pytest -vv -x --disable-warnings dependencies/ --repo wazuh --reference master --requirements-path framework/requirements.txt --report-path ~/Desktop/report_file.json
==================================================================================== test session starts =====================================================================================
platform linux -- Python 3.9.5, pytest-6.2.3, py-1.10.0, pluggy-0.13.1 -- /home/kondent/pythonEnv/qa-env/bin/python3
cachedir: .pytest_cache
Expand Down

0 comments on commit 3b54a89

Please sign in to comment.