Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1978155

Summary: Designate DNS – it’s possible to create blacklist using invalid patterns
Product: Red Hat OpenStack Reporter: Arkady Shtempler <ashtempl>
Component: openstack-designateAssignee: Don Kehn <dkehn>
Status: CLOSED ERRATA QA Contact: Toni Freger <tfreger>
Severity: medium Docs Contact:
Priority: medium    
Version: 17.0 (Wallaby)CC: dkehn, jschluet, lavraham, michjohn, njohnston, scohen
Target Milestone: gaKeywords: Triaged
Target Release: 17.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-designate-12.0.2-0.20220614212615.f255747.el9ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-09-21 12:16:04 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 Arkady Shtempler 2021-07-01 08:35:20 UTC
Scenario:
Create blacklist using string that cannot be used either as a regex or as a zone name, for example: 
patterns = ['', '#(*&^%$%$#@$']


Empty pattern console result:
2021-07-01 10:36:29,649 770881 INFO     [tempest.lib.common.rest_client] Request (BlacklistsAdminTest:test_create_blacklist_invalid_pattern): 201 POST http://10.35.64.8/dns/v2/blacklists 0.216s
2021-07-01 10:36:29,650 770881 DEBUG    [tempest.lib.common.rest_client] Request - Headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Token': '<omitted>'}
        Body: {"pattern": "", "description": "tempest-2122752535"}
    Response - Headers: {'date': 'Thu, 01 Jul 2021 07:36:29 GMT', 'server': 'Apache/2.4.41 (Ubuntu)', 'location': 'http://10.35.64.8/dns/v2/blacklists/81759d14-1aa4-4395-b4da-0e9f8e024044', 'content-length': '257', 'x-openstack-request-id': 'req-5bbf9f42-6903-4bbe-b670-92860217864d', 'connection': 'close', 'content-type': 'application/json', 'status': '201', 'content-location': 'http://10.35.64.8/dns/v2/blacklists'}
        Body: b'{"id": "81759d14-1aa4-4395-b4da-0e9f8e024044", "pattern": "", "description": "tempest-2122752535", "created_at": "2021-07-01T07:36:30.000000", "updated_at": null, "links": {"self": "http://10.35.64.8/dns/v2/blacklists/81759d14-1aa4-4395-b4da-0e9f8e024044"}}'
}}}

Invalid string (#(*&^%$%$#@$") console result:
2021-07-01 10:32:32,316 770535 INFO     [tempest.lib.common.rest_client] Request (BlacklistsAdminTest:test_create_blacklist_invalid_pattern): 201 POST http://10.35.64.8/dns/v2/blacklists 0.037s
2021-07-01 10:32:32,317 770535 DEBUG    [tempest.lib.common.rest_client] Request - Headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Token': '<omitted>'}
        Body: {"pattern": "#(*&^%$%$#@$", "description": "tempest-374346852"}
    Response - Headers: {'date': 'Thu, 01 Jul 2021 07:32:32 GMT', 'server': 'Apache/2.4.41 (Ubuntu)', 'location': 'http://10.35.64.8/dns/v2/blacklists/4527e92e-f6f9-438a-917b-7478a2c02e0c', 'content-length': '268', 'x-openstack-request-id': 'req-2f6969a4-5cce-417b-80f2-509e42128499', 'connection': 'close', 'content-type': 'application/json', 'status': '201', 'content-location': 'http://10.35.64.8/dns/v2/blacklists'}
        Body: b'{"id": "4527e92e-f6f9-438a-917b-7478a2c02e0c", "pattern": "#(*&^%$%$#@$", "description": "tempest-374346852", "created_at": "2021-07-01T07:32:32.000000", "updated_at": null, "links": {"self": "http://10.35.64.8/dns/v2/blacklists/4527e92e-f6f9-438a-917b-7478a2c02e0c"}}'

Actual Result:
Blacklist is successfully created

Expected result:
400 BadRequest

Comment 11 errata-xmlrpc 2022-09-21 12:16:04 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 (Release of components for Red Hat OpenStack Platform 17.0 (Wallaby)), 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/RHEA-2022:6543