Module Import alias Import alias Import alias ImportFrom alias identifier Assign NameStore Call NameLoad ListLoad Str Str Str Str Str Str Str FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword BinOpMod Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr If Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr body For NameStore AttributeLoad AttributeLoad NameLoad attr attr body If BoolOpAnd Call NameLoad NameLoad AttributeLoad NameLoad attr CompareIn AttributeLoad NameLoad attr NameLoad body Return Call NameLoad AttributeLoad NameLoad attr orelse If BoolOpAnd Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr CompareIn AttributeLoad NameLoad attr NameLoad body Assign NameStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr If BoolOpAnd Call NameLoad NameLoad AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Return Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr orelse If Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore AttributeLoad NameLoad attr If BoolOpAnd Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr CompareIn AttributeLoad AttributeLoad NameLoad attr attr NameLoad body If Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num AttributeLoad NameLoad attr body Return Call NameLoad AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr decorator_list Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam defaults body Expr Str For NameStore AttributeLoad AttributeLoad NameLoad attr attr body If BoolOpAnd Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr CompareIn AttributeLoad NameLoad attr NameLoad body Return Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr decorator_list Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore BinOpMult ListLoad NameLoad BinOpSub Call NameLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Call NameLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Expr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr For TupleStore NameStore NameStore Call NameLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad body If Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore IfExp CompareGt AttributeLoad AttributeLoad NameLoad attr attr Num AttributeLoad NameLoad attr AttributeLoad NameLoad attr If BoolOpAnd Call NameLoad NameLoad AttributeLoad NameLoad attr CompareIn NameLoad NameLoad body Return Call NameLoad AttributeLoad NameLoad attr decorator_list Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str
N/A N/A ast N/A sys N/A bandit bandit.core test_properties test N/A candidates N/A set N/A password pass passwd pwd secret token secrete _report N/A N/A value N/A N/A N/A N/A N/A bandit Issue severity N/A bandit LOW confidence N/A bandit MEDIUM text N/A Possible hardcoded password: '%s' value N/A hardcoded_password_string N/A N/A context N/A N/A N/A **B105: Test for use of hard-coded password strings**

    The use of hard-coded passwords increases the possibility of password
    guessing tremendously. This plugin test looks for all string literals and
    checks the following conditions:

    - assigned to a variable that looks like a password
    - assigned to a dict key that looks like a password
    - used in a comparison with a variable that looks like a password

    Variables are considered to look like a password if they have match any one
    of:

    - "password"
    - "pass"
    - "passwd"
    - "pwd"
    - "secret"
    - "token"
    - "secrete"

    Note: this can be noisy and may generate false positives.

    **Config Options:**

    None

    :Example:

    .. code-block:: none

        >> Issue: Possible hardcoded password '(root)'
           Severity: Low   Confidence: Low
           Location: ./examples/hardcoded-passwords.py:5
        4 def someFunction2(password):
        5     if password == "root":
        6         print("OK, logged in")

    .. seealso::

        - https://www.owasp.org/index.php/Use_of_hard-coded_password

    .. versionadded:: 0.9.0

     N/A node N/A context node N/A N/A isinstance N/A node parent N/A ast Assign N/A N/A targ N/A N/A node parent targets N/A N/A N/A N/A isinstance targ N/A ast Name N/A N/A targ id candidates N/A N/A N/A _report N/A node s N/A N/A N/A N/A isinstance N/A node parent N/A ast Index N/A N/A node s candidates N/A N/A assign N/A N/A N/A node parent parent parent N/A N/A N/A isinstance assign N/A ast Assign N/A isinstance N/A assign value N/A ast Str N/A N/A N/A _report N/A N/A assign value s N/A N/A N/A isinstance N/A node parent N/A ast Compare N/A N/A comp N/A node parent N/A N/A N/A isinstance N/A comp left N/A ast Name N/A N/A N/A comp left id candidates N/A N/A N/A isinstance N/A N/A comp comparators N/A 0 N/A ast Str N/A N/A N/A _report N/A N/A N/A comp comparators N/A 0 s N/A N/A N/A test checks Str N/A N/A test test_id B105 hardcoded_password_funcarg N/A N/A context N/A N/A N/A **B106: Test for use of hard-coded password function arguments**

    The use of hard-coded passwords increases the possibility of password
    guessing tremendously. This plugin test looks for all function calls being
    passed a keyword argument that is a string literal. It checks that the
    assigned local variable does not look like a password.

    Variables are considered to look like a password if they have match any one
    of:

    - "password"
    - "pass"
    - "passwd"
    - "pwd"
    - "secret"
    - "token"
    - "secrete"

    Note: this can be noisy and may generate false positives.

    **Config Options:**

    None

    :Example:

    .. code-block:: none

        >> Issue: [B106:hardcoded_password_funcarg] Possible hardcoded
        password: 'blerg'
           Severity: Low   Confidence: Medium
           Location: ./examples/hardcoded-passwords.py:16
        15
        16    doLogin(password="blerg")

    .. seealso::

        - https://www.owasp.org/index.php/Use_of_hard-coded_password

    .. versionadded:: 0.9.0

     N/A kw N/A N/A context node keywords N/A N/A N/A N/A isinstance N/A kw value N/A ast Str N/A N/A kw arg candidates N/A N/A N/A _report N/A N/A kw value s N/A N/A N/A test checks Call N/A N/A test test_id B106 hardcoded_password_default N/A N/A context N/A N/A N/A **B107: Test for use of hard-coded password argument defaults**

    The use of hard-coded passwords increases the possibility of password
    guessing tremendously. This plugin test looks for all function definitions
    that specify a default string literal for some argument. It checks that
    the argument does not look like a password.

    Variables are considered to look like a password if they have match any one
    of:

    - "password"
    - "pass"
    - "passwd"
    - "pwd"
    - "secret"
    - "token"
    - "secrete"

    Note: this can be noisy and may generate false positives.

    **Config Options:**

    None

    :Example:

    .. code-block:: none

        >> Issue: [B107:hardcoded_password_default] Possible hardcoded
        password: 'Admin'
           Severity: Low   Confidence: Medium
           Location: ./examples/hardcoded-passwords.py:1

        1    def someFunction(user, password="Admin"):
        2      print("Hi " + user)

    .. seealso::

        - https://www.owasp.org/index.php/Use_of_hard-coded_password

    .. versionadded:: 0.9.0

     N/A defs N/A N/A None N/A N/A len N/A N/A N/A context node args args N/A len N/A N/A N/A context node args defaults N/A N/A N/A defs extend N/A N/A N/A context node args defaults N/A N/A key val N/A zip N/A N/A N/A context node args args defs N/A N/A N/A isinstance key N/A ast Name N/A N/A check N/A N/A N/A N/A sys version_info major 2 N/A key arg N/A key id N/A N/A N/A isinstance val N/A ast Str N/A check candidates N/A N/A N/A _report N/A val s N/A N/A N/A test checks FunctionDef N/A N/A test test_id B107