[Bug 1962733] Re: [sru] sosreport does not obfuscate a mac address when --mask is used

2022-03-15 Thread Bug Watch Updater
** Changed in: sosreport
   Status: New => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1962733

Title:
  [sru] sosreport does not obfuscate a mac address when --mask is used

To manage notifications about this bug go to:
https://bugs.launchpad.net/sosreport/+bug/1962733/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1962733] Re: [sru] sosreport does not obfuscate a mac address when --mask is used

2022-03-10 Thread nikhil kshirsagar
** Description changed:

- sos 4.3 seems to have a regression in mac address obfuscation. We found
- this in the ubuntu package testing. The file concerned seems to be the
- etc/netplan/50-cloud-init.yaml which seems to end up with an
- unobfuscated mac address inspite of using --mask flag to sos report
- command.
- 
- 
- 
- autopkgtest run shows,
- 
- Found 1 total reports to obfuscate, processing up to 4 concurrently
- 
- sosreport-autopkgtest-2022-03-02-kluxwcz : Beginning obfuscation...
- sosreport-autopkgtest-2022-03-02-kluxwcz : Obfuscation completed 
[removed 16 unprocessable files]
- 
- Successfully obfuscated 1 report(s)
- 
- Creating compressed archive...
- 
- A mapping of obfuscated elements is available at
-   /tmp/sosreport-host0-2022-03-02-kluxwcz-private_map
- 
- Your sosreport has been generated and saved in:
-   /tmp/sosreport-host0-2022-03-02-kluxwcz-obfuscated.tar.xz
- 
-  Size 2.28MiB
-  Ownerroot
-  sha256   42db961f8cde1aa72f78afbef825d7bd54884e76996f96ce657a37fca5e1fa44
- 
- Please send this file to your support representative.
- 
- ### end stdout
- ### start extraction
- ### stop extraction
- # DONE WITH --mask #
- !!! TEST FAILED: MAC address not obfuscated in all places !!!
- /tmp/sosreport_test/etc/netplan/50-cloud-init.yaml:
macaddress: '52:54:00:12:34:56'
+ [Impact]
+ 
+ sos 4.3 has a regression in mac address obfuscation. The file
+ etc/netplan/50-cloud-init.yaml ends up with an unobfuscated mac address
+ inspite of using --mask.
+ 
+ [TEST PLAN]
+ 
+ Documentation for Special Cases:
+ https://wiki.ubuntu.com/SosreportUpdates
+ 
+ [WHERE PROBLEMS COULD OCCUR]
+ 
+ Since we are changing the regex parser code in
+ sos/cleaner/parsers/mac_parser.py we would need to ensure no other regex
+ behavior is changed. The unit tests in autopkgtest will suffice to
+ determine that.
  
  -
- 
+ [Other Info]
+ 
+ Upstream issue is https://github.com/sosreport/sos/issues/2873
+ Upstream MR is https://github.com/sosreport/sos/pull/2875
+ 
+ Reproducer details:
  sos 4.2 shows correct behavior. testing shows..
  
  /etc/netplan/50-cloud-init.yaml contains
  
  network:
- ethernets:
- ens3:
- dhcp4: true
- match:
- macaddress: '52:54:00:12:34:56'
- set-name: ens3
- version: 2
- 
- 
- 4.2 sos contains the file but with the obfuscated mac address. correct 
behavior.
- 
- # This file is generated from information provided by the datasource.  Changes
- # to it will not persist across an instance reboot.  To disable cloud-init's
- # network configuration capabilities, write a file
- # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
- # network: {config: disabled}
- network:
- ethernets:
- ens3:
- dhcp4: true
- match:
- macaddress: '53:4f:53:cf:3a:9e'
- set-name: ens3
- version: 2
- 
+ ethernets:
+ ens3:
+ dhcp4: true
+ match:
+ macaddress: '52:54:00:12:34:56'
+ set-name: ens3
+ version: 2
+ 
+ 4.2 sos contains the file but with the obfuscated mac address. correct
+ behavior.
+ 
+ # This file is generated from information provided by the datasource.  Changes
+ # to it will not persist across an instance reboot.  To disable cloud-init's
+ # network configuration capabilities, write a file
+ # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
+ # network: {config: disabled}
+ network:
+ ethernets:
+ ens3:
+ dhcp4: true
+ match:
+ macaddress: '53:4f:53:cf:3a:9e'
+ set-name: ens3
+ version: 2
  
  --
  
  4.3 testing shows the bug,
  
  the /etc/netplan/50-cloud-init.yaml contains
  
  # This file is generated from information provided by the datasource.  Changes
  # to it will not persist across an instance reboot.  To disable cloud-init's
  # network configuration capabilities, write a file
  # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
  # network: {config: disabled}
  network:
- ethernets:
- ens3:
- dhcp4: true
- match:
- macaddress: '52:54:00:12:34:56'
- set-name: ens3
- version: 2
- 
+ ethernets:
+ ens3:
+ dhcp4: true
+ match:
+ macaddress: '52:54:00:12:34:56'
+ set-name: ens3
+ version: 2
  
  ---
  
  generated sosreport (run with --mask) contains
  
  # This file is generated from information provided by the datasource.  Changes
  # to it will not persist across an instance reboot.  To disable cloud-init's
  # network configuration capabilities, write a file
  # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
  # network: {config: disabled}
  network:
- ethernets:
- ens3:
-