Advertisement
Guest User

Keystone Bandit Profile

a guest
Mar 24th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.61 KB | None | 0 0
  1. # optional: after how many files to update progress
  2. #show_progress_every: 100
  3.  
  4. # optional: plugins directory name
  5. #plugins_dir: 'plugins'
  6.  
  7. # optional: plugins discovery name pattern
  8. plugin_name_pattern: '*.py'
  9.  
  10. # optional: terminal escape sequences to display colors
  11. #output_colors:
  12. # DEFAULT: '\033[0m'
  13. # HEADER: '\033[95m'
  14. # INFO: '\033[94m'
  15. # WARN: '\033[93m'
  16. # ERROR: '\033[91m'
  17.  
  18. # optional: log format string
  19. #log_format: "[%(module)s]\t%(levelname)s\t%(message)s"
  20.  
  21. # globs of files which should be analyzed
  22. include:
  23. - '*.py'
  24. - '*.pyw'
  25.  
  26. # a list of strings, which if found in the path will cause files to be excluded
  27. # for example /tests/ - to remove all all files in tests directory
  28. exclude_dirs:
  29. - '/tests/'
  30. - '/doc/'
  31.  
  32. profiles:
  33. keystone_conservative:
  34. include:
  35. - blacklist_functions
  36. - blacklist_imports
  37. - request_with_no_cert_validation
  38. - exec_used
  39. - set_bad_file_permissions
  40. - subprocess_popen_with_shell_equals_true
  41. - linux_commands_wildcard_injection
  42. - ssl_with_bad_version
  43.  
  44.  
  45. keystone_verbose:
  46. include:
  47. - blacklist_functions
  48. - blacklist_imports
  49. - request_with_no_cert_validation
  50. - exec_used
  51. - set_bad_file_permissions
  52. - hardcoded_tmp_directory
  53. - subprocess_popen_with_shell_equals_true
  54. - any_other_function_with_shell_equals_true
  55. - linux_commands_wildcard_injection
  56. - ssl_with_bad_version
  57. - ssl_with_bad_defaults
  58.  
  59. blacklist_functions:
  60. bad_name_sets:
  61. - pickle:
  62. qualnames: [pickle.loads, pickle.load, pickle.Unpickler,
  63. cPickle.loads, cPickle.load, cPickle.Unpickler]
  64. message: "Pickle library appears to be in use, possible security issue."
  65. - marshal:
  66. qualnames: [marshal.load, marshal.loads]
  67. message: "Deserialization with the marshal module is possibly dangerous."
  68. - md5:
  69. qualnames: [hashlib.md5]
  70. message: "Use of insecure MD5 hash function."
  71. - mktemp_q:
  72. qualnames: [tempfile.mktemp]
  73. message: "Use of insecure and deprecated function (mktemp)."
  74. - eval:
  75. qualnames: [eval]
  76. message: "Use of possibly insecure function - consider using safer ast.literal_eval."
  77. - mark_safe:
  78. names: [mark_safe]
  79. message: "Use of mark_safe() may expose cross-site scripting vulnerabilities and should be reviewed."
  80. - httpsconnection:
  81. qualnames: [httplib.HTTPSConnection]
  82. message: "Use of HTTPSConnection does not provide security, see https://wiki.openstack.org/wiki/OSSN/OSSN-0033"
  83. - yaml_load:
  84. qualnames: [yaml.load]
  85. message: "Use of unsafe yaml load. Allows instantiation of arbitrary objects. Consider yaml.safe_load()."
  86. - urllib_urlopen:
  87. qualnames: [urllib.urlopen, urllib.urlretrieve, urllib.URLopener, urllib.FancyURLopener, urllib2.urlopen, urllib2.Request]
  88. message: "Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected."
  89.  
  90. shell_injection:
  91. # Start a process using the subprocess module, or one of its wrappers.
  92. subprocess: [subprocess.Popen, subprocess.call, subprocess.check_call,
  93. subprocess.check_output, utils.execute, utils.execute_with_timeout]
  94. # Start a process with a function vulnerable to shell injection.
  95. shell: [os.system, os.popen, os.popen2, os.popen3, os.popen4,
  96. popen2.popen2, popen2.popen3, popen2.popen4, popen2.Popen3,
  97. popen2.Popen4, commands.getoutput, commands.getstatusoutput]
  98. # Start a process with a function that is not vulnerable to shell injection.
  99. no_shell: [os.execl, os.execle, os.execlp, os.execlpe, os.execv,os.execve,
  100. os.execvp, os.execvpe, os.spawnl, os.spawnle, os.spawnlp,
  101. os.spawnlpe, os.spawnv, os.spawnve, os.spawnvp, os.spawnvpe,
  102. os.startfile]
  103.  
  104. blacklist_imports:
  105. bad_import_sets:
  106. - telnet:
  107. imports: [telnetlib]
  108. level: ERROR
  109. message: "Telnet is considered insecure. Use SSH or some other encrypted protocol."
  110.  
  111. password_config_option_not_marked_secret:
  112. function_names:
  113. - oslo.config.cfg.StrOpt
  114. - oslo_config.cfg.StrOpt
  115.  
  116. ssl_with_bad_version:
  117. bad_protocol_versions:
  118. - 'PROTOCOL_SSLv2'
  119. - 'SSLv2_METHOD'
  120. - 'SSLv23_METHOD'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement