Bug 1225432 - [Agama][Milestone8+] iSCSI Discovery Passwords are logged into y2log in plain text
Summary: [Agama][Milestone8+] iSCSI Discovery Passwords are logged into y2log in plain...
Status: RESOLVED FIXED
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Installation (show other bugs)
Version: Current
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: E-mail List
QA Contact: Jiri Srain
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-28 07:32 UTC by Lukas Ocilka
Modified: 2024-06-12 08:30 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Snippet of the log (337.27 KB, image/png)
2024-05-28 07:32 UTC, Lukas Ocilka
Details
The dialog for searching for iSCSI... (107.25 KB, image/png)
2024-05-28 07:33 UTC, Lukas Ocilka
Details
YaST logs with more details (252.20 KB, application/x-xz)
2024-05-28 07:33 UTC, Lukas Ocilka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Ocilka 2024-05-28 07:32:43 UTC
Created attachment 875149 [details]
Snippet of the log

When iSCSI Targets are being discovered in Agama, the iSCSI library logs all the details. Sadly, also including passwords.

How to reproduce? Easily

-> Start Agama Installer
-> Go to Storage details
-> Click Prepare devices by configuring advanced storage technologies
-> Choose iSCSI
-> Click Discover iSCSI targets
-> Fill-up some users/passwords
-> Click Confirm

This will be most probably the same in YaST as well because it uses the same library. BTW, there are two entries for user/password, but you can see only the first one in the log. That's most probably because the second one would be used later, if the first one succeeds (not my case).

Additionally, even the save_y2logs script does not remove the passwords. maybe because the string in the log this:

{"name"=>"discovery.sendtargets.auth.password", "value"=>"and their password", "kind"=>"value", "type"=>1, "comment"=>""}
Comment 1 Lukas Ocilka 2024-05-28 07:33:29 UTC
Created attachment 875150 [details]
The dialog for searching for iSCSI...
Comment 2 Lukas Ocilka 2024-05-28 07:33:53 UTC
Created attachment 875151 [details]
YaST logs with more details
Comment 3 Stefan Hundhammer 2024-05-28 08:44:36 UTC
This should be as easy as replacing

  attr_accessor :password

with 

  secret_attr :password

and adding

  require "yast2/secret_attributes"

  class ...
    include Yast2::SecretAttributes
Comment 4 Knut Alejandro Anderssen González 2024-05-28 09:19:09 UTC
Have not checked it deeper but..

https://github.com/yast/yast-iscsi-client/blob/920ffae4b15dee0fb5f075d59b6f169679bb7a94/src/lib/y2iscsi_client/config.rb#L44

We are logging the raw_data read which includes everything...
Comment 5 Stefan Hundhammer 2024-05-28 09:50:50 UTC
>> 08:56:08 <1> [Ruby] modules/IscsiClientLib.rb(oldConfig):422 
>>   Store temporary config #<Y2IscsiClient::Config:0x00007f4a91d6b310 @raw_data=...

>> 09:18:29 <1> [Ruby] modules/IscsiClientLib.rb(oldConfig):422 
>>   Store temporary config #<Y2IscsiClient::Config:0x00007f4a91d6b310 @raw_data=...


https://github.com/yast/yast-iscsi-client/blob/master/src/modules/IscsiClientLib.rb#L422

>>    Builtins.y2milestone("Store temporary config %1", @config)

Not sure if that log line is ever going to be very helpful to us.
Comment 6 Stefan Hundhammer 2024-05-28 11:46:22 UTC
This @config is an array of hashes, not a real class, so using 'secret_attr' will not help. It's buried here:

https://github.com/yast/yast-iscsi-client/blob/master/src/lib/y2iscsi_client/config.rb

I suggest to simply remove that y2milestone line (see comment #5).
Comment 7 Stefan Hundhammer 2024-05-28 11:57:40 UTC
Fix:

https://github.com/yast/yast-iscsi-client/pull/128
Comment 8 Stefan Hundhammer 2024-05-28 12:08:13 UTC
The fix will become available with yast2-iscsi-client-5.0.2.
Comment 9 Stefan Hundhammer 2024-05-28 12:10:38 UTC
SR to OBS openSUSE:Factory:

  https://build.opensuse.org/request/show/1177328
Comment 10 Stefan Hundhammer 2024-05-28 14:36:52 UTC
This also affects yast-iscsi-client as a standalone YaST module as well as using iSCSI during a YaST installation.

Backport to SLE-15-SP5:

  PR: https://github.com/yast/yast-iscsi-client/pull/129

  SR to IBS SLE-15-SP5: https://build.suse.de/request/show/332524


Backport to SLE-15-SP6:

  PR: https://github.com/yast/yast-iscsi-client/pull/130

  The SR failed with a HTTP 403 :-(

  "The target project SUSE:SLE-15-SP6:GA is not accepting
   requests because: Project is locked."
Comment 11 Maintenance Automation 2024-06-12 08:30:02 UTC
SUSE-RU-2024:2004-1: An update that has one fix can now be installed.

Category: recommended (moderate)
Bug References: 1225432
Maintenance Incident: [SUSE:Maintenance:34090](https://smelt.suse.de/incident/34090/)
Sources used:
openSUSE Leap 15.5 (src):
 yast2-iscsi-client-4.5.9-150500.3.6.2
Basesystem Module 15-SP5 (src):
 yast2-iscsi-client-4.5.9-150500.3.6.2

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.