Comments

kmoll created an issue. See original summary.

kmoll’s picture

StatusFileSize
new8.89 KB

Here is a patch for the initial implementation.

kmoll’s picture

StatusFileSize
new9.1 KB
new2.21 KB

I've made a few tweaks and fixed some errors.

kmoll’s picture

Status: Active » Needs review
kmoll’s picture

Issue tags: +Vienna2017
badjava’s picture

Check your command names for consistency as they should be in the format 'security-review:action'.

- security-review:security-review

kmoll’s picture

StatusFileSize
new8.36 KB
new1.81 KB

I've updated it to security:review, and removed the auto-generated function

kmoll’s picture

StatusFileSize
new8.17 KB
new939 bytes

I moved the drush command service definition to a drush.services.yml file to follow best practices.

malcomio’s picture

Status: Needs review » Needs work

I tested this patch against the current dev branch. It applies cleanly, and running drush secrev succeeds, but doesn't give any meaningful output.

drush secrev


security:review [--store] [--log] [--lastrun] [--check CHECK] [--skip SKIP] [--short] [--results] [--format FORMAT] [--fields FIELDS] [--field FIELD] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-d|--debug] [-y|--yes] [--no] [--remote-host REMOTE-HOST] [--remote-user REMOTE-USER] [-r|--root ROOT] [-l|--uri URI] [--simulate] [--pipe] [-D|--define DEFINE] [--notify [NOTIFY]] [--druplicon] [--xh-link XH-LINK] [--] <command>
malcomio’s picture

Status: Needs work » Needs review

Seems like my previous test had an unrelated environment problem - I fixed that, and the command gave sensible output:

 ------------------------------------------------------------------------ ---------
  Message                                                                  Status
 ------------------------------------------------------------------------ ---------
  Only safe extensions are allowed for uploaded files and images.          success
  Dangerous tags were not found in any submitted content (fields).         success
  Untrusted roles have been granted administrative or trusted Drupal       failed
  permissions.
  Errors are written to the screen.                                        failed
  PHP files in the Drupal files directory cannot be executed.              success
  Some files and directories in your install are writable by the server.   failed
  No sensitive temporary files were found.                                 success
  Untrusted users are not allowed to input dangerous HTML tags.            success
  Neither $base_url nor trusted_host_patterns is set.                      failed
  There are Views that do not provide any access checks.                   failed
 ------------------------------------------------------------------------ ---------
joestewart’s picture

StatusFileSize
new8.2 KB
new1.19 KB

"--check" and "--skip" should accept comma separated strings. Updated patch attached.

hey_germano’s picture

Patch applies to latest dev. I tested each option with Drush 9.4.0, and everything worked as expected.

moshe weitzman’s picture

This can be committed as is (please!). If it gets rerolled, consider adding the following minor details.

  1. Its customary to put option and usage description on a separate line from the annotation and name
  2. To indicate that a value is required for an option, set its default value to self::REQ.
  3. drush_set_error() should be replaxced by a plain old Exception
  4. DrushStyle/SymfonyStyle is available to format rows with red/yellow/green, for example.
greggles’s picture

StatusFileSize
new8.26 KB
new2.59 KB

I addressed items 1 and 3 from your feedback moshe. Attached is an updated patch and interdiff.

shrop’s picture

I did some testing on the updated patch with Guardr. See: #3130712: Test and apply new version of the patch we need for Security Review for Drush 9. The patch in #14 applies and works just fine! Thank you.

  • greggles committed 7207c19 on 8.x-1.x authored by kmoll
    Issue #2912708 by kmoll, joestewart, greggles, malcomio, hey_germano,...
greggles’s picture

Status: Needs review » Fixed

Thanks for the review, shrop. Now committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.