Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2119155 - With every edit of an exising webhook, the value in password field disappears in Satellite 6.10/6.11/6.12
Summary: With every edit of an exising webhook, the value in password field disappears...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hooks and Webhooks
Version: 6.10.7
Hardware: All
OS: All
unspecified
high
Target Milestone: 6.13.0
Assignee: Oleh Fedorenko
QA Contact: Peter Ondrejka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-08-17 17:45 UTC by Sayan Das
Modified: 2023-05-03 13:21 UTC (History)
6 users (show)

Fixed In Version: rubygem-foreman_webhooks-3.0.5
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2131771 2150069 (view as bug list)
Environment:
Last Closed: 2023-05-03 13:21:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
RHEL 7 Hotfix RPM for Satellite 6.11.3 (1.59 MB, application/x-rpm)
2022-09-29 21:22 UTC, Ian Ballou
no flags Details
RHEL 8 Hotfix RPM for Satellite 6.11.3 (1.58 MB, application/x-rpm)
2022-09-29 21:24 UTC, Ian Ballou
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 35385 0 Normal Closed With every edit of an exising webhook, the value in password field disappears in Satellite 6.10/6.11/6.12 2022-10-14 16:03:14 UTC
Red Hat Issue Tracker SAT-12284 0 None None None 2022-12-01 19:03:15 UTC
Red Hat Product Errata RHSA-2023:2097 0 None None None 2023-05-03 13:21:52 UTC

Description Sayan Das 2022-08-17 17:45:43 UTC
Description of problem:

The password field of a webhook is not persistent while other parameters in the webhook is being modified and submitted


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

Satellite 6.10
Satellite 6.11
Satellite 6.12 ( internal latest snap )


How reproducible:

100%


Steps to Reproduce:
1. Install any of the versions of the satellite as mentioned before

2. Go to Administer --> Webhooks and Create a webhook by selecting any arbitrary stuff But make sure to go to the Credentials page and mention a username and password in their respective fields 

3. Open CLI and go inside rake console to inspect the data.

# foreman-rake console

Webhook.last.password

Webhook.last.user



4. Go back to Administer --> Webhooks , simply edit the webhook, and then submit. We don't even need to make any change.


5. Come back inside CLI where rake console is open and type 

Webhook.last.password

Webhook.last.user



Actual results:

At Step 3: We can see the user and password is set:

irb(main):001:0> Webhook.last.password
=> "redhat"
irb(main):002:0> Webhook.last.user
=> "admin"


At Step 5, We see the user is still set but password has become blank

irb(main):003:0> Webhook.last.password
=> ""

irb(main):004:0> Webhook.last.user
=> "admin"



Even before submitting the hook at Step 4, if we go to the Credentials tab, we will get to see the same thing i.e. password field is blank as soon as we edit the Webhook.


Expected results:

The password should remain set and intact unless manually modified or nullified. 


Additional info:

NA

Comment 1 Sayan Das 2022-08-17 17:48:00 UTC
While creating:

2022-08-17T13:23:58 [I|app|c5d3c02f] Started POST "/api/webhooks" for 10.74.XX.YYY at 2022-08-17 13:23:58 -0400
2022-08-17T13:23:58 [I|app|c5d3c02f] Processing by Api::V2::WebhooksController#create as JSON
2022-08-17T13:23:58 [I|app|c5d3c02f]   Parameters: {"name"=>"Test", "target_url"=>"https://satellite.example.com:9090/shellhook/store_data", "user"=>"admin", "password"=>"[FILTERED]", "webhook_template_id"=>213, "http_method"=>"POST", "http_content_type"=>"application/json", "enabled"=>true, "verify_ssl"=>false, "ssl_ca_certs"=>"", "http_headers"=>"", "proxy_authorization"=>true, "event"=>"build_entered.event.foreman", "apiv"=>"v2", "webhook"=>{"name"=>"Test", "target_url"=>"https://satellite.example.com:9090/shellhook/store_data", "webhook_template_id"=>213, "http_method"=>"POST", "http_content_type"=>"application/json", "enabled"=>true, "verify_ssl"=>false, "ssl_ca_certs"=>"", "user"=>"admin", "password"=>"[FILTERED]", "http_headers"=>"", "proxy_authorization"=>true}}
2022-08-17T13:23:58 [I|aud|c5d3c02f] Webhook (8) create event on name Test
2022-08-17T13:23:58 [I|aud|c5d3c02f] Webhook (8) create event on target_url https://satellite.example.com:9090/shellhook/store_data
2022-08-17T13:23:58 [I|aud|c5d3c02f] Webhook (8) create event on events ["build_entered.event.foreman"]
2022-08-17T13:23:58 [I|aud|c5d3c02f] Webhook (8) create event on webhook_template_id 213
2022-08-17T13:23:58 [I|aud|c5d3c02f] Webhook (8) create event on http_method POST
2022-08-17T13:23:58 [I|aud|c5d3c02f] Webhook (8) create event on http_content_type application/json
2022-08-17T13:23:58 [I|aud|c5d3c02f] Webhook (8) create event on enabled true
2022-08-17T13:23:58 [I|aud|c5d3c02f] Webhook (8) create event on verify_ssl false
2022-08-17T13:23:58 [I|aud|c5d3c02f] Webhook (8) create event on ssl_ca_certs 
2022-08-17T13:23:58 [I|aud|c5d3c02f] Webhook (8) create event on user admin
2022-08-17T13:23:58 [I|aud|c5d3c02f] Webhook (8) create event on password [redacted]
2022-08-17T13:23:58 [I|aud|c5d3c02f] Webhook (8) create event on http_headers 
2022-08-17T13:23:58 [I|aud|c5d3c02f] Webhook (8) create event on proxy_authorization true



While re-opening and immediately submitting without even making any changes :

2022-08-17T13:26:32 [I|app|c96c7748] Started PUT "/api/webhooks/8" for 10.74.XX.YYY at 2022-08-17 13:26:32 -0400
2022-08-17T13:26:32 [I|app|c96c7748] Processing by Api::V2::WebhooksController#update as JSON
2022-08-17T13:26:32 [I|app|c96c7748]   Parameters: {"id"=>"8", "name"=>"Test", "target_url"=>"https://satellite.example.com:9090/shellhook/store_data", "user"=>"admin", "password"=>"[FILTERED]", "http_method"=>"POST", "http_content_type"=>"application/json", "webhook_template_id"=>213, "event"=>"build_entered.event.foreman", "enabled"=>true, "verify_ssl"=>false, "ssl_ca_certs"=>"", "http_headers"=>"", "apiv"=>"v2", "webhook"=>{"id"=>"8", "name"=>"Test", "target_url"=>"https://satellite.example.com:9090/shellhook/store_data", "webhook_template_id"=>213, "http_method"=>"POST", "http_content_type"=>"application/json", "enabled"=>true, "verify_ssl"=>false, "ssl_ca_certs"=>"", "user"=>"admin", "password"=>"[FILTERED]", "http_headers"=>""}}

2022-08-17T13:26:32 [I|aud|c96c7748] Webhook (8) update event on password [redacted], [redacted]


As we can clearly see, the password field gets updated and it gets updated with a blank value


CC'ing Oleh for visibility

Comment 2 Oleh Fedorenko 2022-08-18 14:00:25 UTC
Created redmine issue https://projects.theforeman.org/issues/35385 from this bug

Comment 3 Bryan Kearney 2022-08-18 16:05:17 UTC
Upstream bug assigned to ofedoren

Comment 4 Bryan Kearney 2022-08-18 16:05:19 UTC
Upstream bug assigned to ofedoren

Comment 5 Bryan Kearney 2022-09-05 16:04:52 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/35385 has been resolved.

Comment 10 Ian Ballou 2022-09-29 21:22:05 UTC
Created attachment 1915112 [details]
RHEL 7 Hotfix RPM for Satellite 6.11.3

RHEL 7 INSTALL INSTRUCTIONS:

1. Take a complete backup or snapshot of the Satellite 6.11.3 server running RHEL 7

2. Download the RHEL 7 hotfix RPM for Satellite 6.11.3 attached to this BZ and copy it to the Satellite server

3. # yum install ./tfm-rubygem-foreman_webhooks-2.0.1-2.HOTFIXRHBZ2119155.el7sat.noarch.rpm --disableplugin=foreman-protector

4. # satellite-maintain service restart

Comment 11 Ian Ballou 2022-09-29 21:24:08 UTC
Created attachment 1915113 [details]
RHEL 8 Hotfix RPM for Satellite 6.11.3

RHEL 8 INSTALL INSTRUCTIONS:

1. Take a complete backup or snapshot of the Satellite 6.11.3 server running RHEL 8

2. Download the RHEL 8 hotfix RPM for Satellite 6.11.3 attached to this BZ and copy it to the Satellite server

3. # yum install ./rubygem-foreman_webhooks-2.0.1-2.HOTFIXRHBZ2119155.el8sat.noarch.rpm --disableplugin=foreman-protector

4. # satellite-maintain service restart

Comment 12 Peter Ondrejka 2022-12-12 11:08:19 UTC
Verified on Satellite 6.13 snap 2 using steps from the problem description.

Comment 15 errata-xmlrpc 2023-05-03 13:21:36 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 (Important: Satellite 6.13 Release), 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/RHSA-2023:2097


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