Bug 1913977 - rsync_opt_extras should only accept valid rsync arg chars
Summary: rsync_opt_extras should only accept valid rsync arg chars
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Migration Toolkit for Containers
Classification: Red Hat
Component: General
Version: 1.4.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 1.4.0
Assignee: Pranav Gaikwad
QA Contact: Xin jiang
Avital Pinnick
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-01-07 22:01 UTC by Erik Nelson
Modified: 2021-11-17 15:32 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-02-11 12:55:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:5329 0 None None None 2021-02-11 12:55:45 UTC

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


Note You need to log in before you can comment on or make changes to this bug.