Bug 1913977

Summary: rsync_opt_extras should only accept valid rsync arg chars
Product: Migration Toolkit for Containers Reporter: Erik Nelson <ernelson>
Component: GeneralAssignee: Pranav Gaikwad <pgaikwad>
Status: CLOSED ERRATA QA Contact: Xin jiang <xjiang>
Severity: unspecified Docs Contact: Avital Pinnick <apinnick>
Priority: unspecified    
Version: 1.4.0CC: ernelson, rjohnson, sregidor
Target Milestone: ---   
Target Release: 1.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-11 12:55:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Erik Nelson 2021-01-07 22:01:48 UTC
Description of problem:
rsync_opt_extras allows users to specify arbitrary additional arguments to be passed to the rsync command that is executed by the DVM pod. The operator should employ a regex that only accepts valid characters that can make up an rsync argument.

Version-Release number of selected component (if applicable):
1.4.0

How reproducible:
This is a pre-emptive BZ we're filing to ensure this is QE verified.

Expected results:
Example characters that should fail the operator's assertion are ";", "&", "|".

Comment 1 Erik Nelson 2021-01-07 22:03:04 UTC
https://github.com/konveyor/mig-operator/pull/540

Comment 3 Erik Nelson 2021-01-07 22:14:35 UTC
Actual regex implementation is in the controller: https://github.com/konveyor/mig-controller/pull/878

Comment 9 Sergio 2021-01-19 16:27:29 UTC
Verified using MTC 1.4.0
   openshift-migration-rhel7-operator@sha256:ae21f9a062bc660957807dfc540bf8c91f52b8d076b674990ad38aca6c76b7b4
    - name: MIG_CONTROLLER_REPO
      value: openshift-migration-controller-rhel8@sha256
    - name: MIG_CONTROLLER_TAG
      value: 4168777e430bada2e4a303e9df86529a62d184aa99593f93ceba8c86a5ed460f

Using this configuration in the migration controller.

    rsync_opt_bwlimit: 220
    rsync_opt_extras: --myextraoption;new

We got this messages

{"level":"info","ts":1611072388.5539036,"logger":"direct|5x775","msg":"Invalid Rsync extra option passed: --myextraoption;new"}
{"level":"info","ts":1611072388.5539289,"logger":"direct|5x775","msg":"Using Rsync command [rsync --bwlimit=220 --archive --delete --recursive --hard-links --partial --info=COPY2,DEL2,REMOVE2,SKIP2,FLIST2,PROGRESS2,STATS2 --human-readable --port 2222 --log-file /dev/stdout /mnt/django/postgresql/ rsync://root@XXXXX/postgresql]"}


Same with 
{"level":"info","ts":1611072993.7200296,"logger":"direct|mkbh6","msg":"Invalid Rsync extra option passed: --myextraoption|new"}
and
{"level":"info","ts":1611073551.32997,"logger":"direct|rhpzv","msg":"Invalid Rsync extra option passed: --myextraoption&new"}


We need to be aware the the migrationcontroller configuration regarding rsync are only taken into account after we delete manually the migration-controller pod. Since they are exposed as environment variables using the controller-migration configmap.


We move the BZ to VERIFIED.

Comment 11 errata-xmlrpc 2021-02-11 12:55:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Migration Toolkit for Containers (MTC) tool image release advisory 1.4.0), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:5329