
    >/i                         S SK r S SKJr  S SKJr  \R
                  " S5      \R                  " S5      S 5       5       r\R
                  " S5      \R                  " S5      S 5       5       rg)	    N)issue)test_propertiesCallB508c           	      8   U R                   S:X  a  U R                  SS5      (       d  U R                  SS5      (       a[  [        R                  " [        R                  [        R
                  [        R                  R                  SU R                  S5      S9$ gg)	a  **B508: Checking for insecure SNMP versions**

This test is for checking for the usage of insecure SNMP version like
  v1, v2c

Please update your code to use more secure versions of SNMP.

:Example:

.. code-block:: none

    >> Issue: [B508:snmp_insecure_version_check] The use of SNMPv1 and
       SNMPv2 is insecure. You should use SNMPv3 if able.
       Severity: Medium Confidence: High
       CWE: CWE-319 (https://cwe.mitre.org/data/definitions/319.html)
       Location: examples/snmp.py:4:4
       More Info: https://bandit.readthedocs.io/en/latest/plugins/b508_snmp_insecure_version_check.html
    3   # SHOULD FAIL
    4   a = CommunityData('public', mpModel=0)
    5   # SHOULD FAIL

.. seealso::

 - http://snmplabs.com/pysnmp/examples/hlapi/asyncore/sync/manager/cmdgen/snmp-versions.html
 - https://cwe.mitre.org/data/definitions/319.html

.. versionadded:: 1.7.2

.. versionchanged:: 1.7.3
    CWE information added

zpysnmp.hlapi.CommunityDatampModelr      zHThe use of SNMPv1 and SNMPv2 is insecure. You should use SNMPv3 if able.CommunityDataseverity
confidencecwetextlinenoN)
call_function_name_qualcheck_call_arg_valuebanditIssueMEDIUMHIGHr   CweCLEARTEXT_TRANSMISSIONget_lineno_for_call_argcontexts    \/home/james-whalen/.local/lib/python3.13/site-packages/bandit/plugins/snmp_security_check.pysnmp_insecure_version_checkr   
   s    H &&*FF''q
 
)))Q77<<!;;II44166G  8	 G    B509c           	          U R                   S:X  al  U R                  S:  a[  [        R                  " [        R                  [        R
                  [        R                  R                  SU R                  S5      S9$ gg)aT  **B509: Checking for weak cryptography**

This test is for checking for the usage of insecure SNMP cryptography:
  v3 using noAuthNoPriv.

Please update your code to use more secure versions of SNMP. For example:

Instead of:
  `CommunityData('public', mpModel=0)`

Use (Defaults to usmHMACMD5AuthProtocol and usmDESPrivProtocol
  `UsmUserData("securityName", "authName", "privName")`

:Example:

.. code-block:: none

    >> Issue: [B509:snmp_crypto_check] You should not use SNMPv3 without encryption. noAuthNoPriv & authNoPriv is insecure
       Severity: Medium CWE: CWE-319 (https://cwe.mitre.org/data/definitions/319.html) Confidence: High
       Location: examples/snmp.py:6:11
       More Info: https://bandit.readthedocs.io/en/latest/plugins/b509_snmp_crypto_check.html
    5   # SHOULD FAIL
    6   insecure = UsmUserData("securityName")
    7   # SHOULD FAIL

.. seealso::

 - http://snmplabs.com/pysnmp/examples/hlapi/asyncore/sync/manager/cmdgen/snmp-versions.html
 - https://cwe.mitre.org/data/definitions/319.html

.. versionadded:: 1.7.2

.. versionchanged:: 1.7.3
    CWE information added

zpysnmp.hlapi.UsmUserData   zSYou should not use SNMPv3 without encryption. noAuthNoPriv & authNoPriv is insecureUsmUserDatar   N)
r   call_args_countr   r   r   r   r   r   r   r   r   s    r   snmp_crypto_checkr$   =   sl    P &&*DD""Q&<<!;;II44866}E  ' Er   )	r   bandit.corer   r   testcheckstest_idr   r$    r   r   <module>r*      sm   
   / Vf.  .b Vf/  /r   