Skip to content

Debugging

Debugging in Prowler make things easier! If you are developing Prowler, it's possible that you will encounter some situations where you have to inspect the code in depth to fix some unexpected issues during the execution.

VSCode

In VSCode you can run the code using the integrated debugger. Please, refer to this documentation for guidance about the debugger in VSCode. The following file is an example of the debugging configuration file that you can add to Virtual Studio Code.

This file should inside the .vscode folder and its name has to be launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug AWS Check",
            "type": "debugpy",
            "request": "launch",
            "program": "prowler.py",
            "args": [
                "aws",
                "--log-level",
                "ERROR",
                "-c",
                "<check_name>"
            ],
            "console": "integratedTerminal",
            "justMyCode": false
        },
        {
            "name": "Debug Azure Check",
            "type": "debugpy",
            "request": "launch",
            "program": "prowler.py",
            "args": [
                "azure",
                "--sp-env-auth",
                "--log-level",
                "ERROR",
                "-c",
                "<check_name>"
            ],
            "console": "integratedTerminal",
            "justMyCode": false
        },
        {
            "name": "Debug GCP Check",
            "type": "debugpy",
            "request": "launch",
            "program": "prowler.py",
            "args": [
                "gcp",
                "--log-level",
                "ERROR",
                "-c",
                "<check_name>"
            ],
            "console": "integratedTerminal",
            "justMyCode": false
        },
        {
            "name": "Debug K8s Check",
            "type": "debugpy",
            "request": "launch",
            "program": "prowler.py",
            "args": [
                "kubernetes",
                "--log-level",
                "ERROR",
                "-c",
                "<check_name>"
            ],
            "console": "integratedTerminal",
            "justMyCode": false
        }
    ]
}