Details
-
New Feature
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
Extend MariaDB user and role account host-name handling to support IPv6 addresses throughout account management and client connection matching.
Currently, IPv4 addresses are supported in account host specifications and host-based access control. This enhancement aims to provide comprehensive IPv6 support, enabling administrators to define and manage user and role accounts using IPv6 addresses and allowing MariaDB to correctly identify and match client connections originating from IPv6 addresses.
The implementation should cover IPv6 address parsing, validation, representation, storage, account creation and modification, privilege management, and connection-time host matching. It should also address interactions between IPv4 and IPv6 addresses, including IPv4-mapped IPv6 addresses, while preserving existing behavior for IPv4 addresses, hostnames, and wildcard-based host specifications.
Scope of Work
1. IPv6 Address Parsing and Validation
- Support standard IPv6 address notation, including compressed and expanded forms.
- Validate IPv6 address syntax and reject malformed addresses.
- Handle equivalent textual representations consistently.
- Define the handling of IPv6 scope identifiers, where applicable.
2. Account Management
- Support IPv6 addresses in user account host specifications.
- Ensure compatibility with account-management statements, including CREATE USER, ALTER USER, DROP USER, and RENAME USER, wherever applicable.
- Support IPv6 host specifications for roles through CREATE ROLE, ALTER or other applicable role-management operations, and DROP ROLE.
- Ensure account definitions can be stored, retrieved, displayed, and persisted correctly.
3. Privilege Management
- Ensure IPv6-based account specifications work consistently with GRANT and REVOKE.
- Verify that privileges are associated with the intended user or role account.
- Preserve existing privilege-management behavior for IPv4 accounts and other supported host specifications.
4. Client Connection Host Matching
- Support matching client connections using IPv6 addresses.
- Implement exact IPv6 address matching.
- Ensure matching works consistently for compressed and expanded representations of the same address.
- Integrate IPv6 handling with existing account-selection and host-matching logic.
- Preserve deterministic account selection when multiple account host specifications could match a connection.
5. IPv4 and IPv6 Interoperability
- Define and implement consistent handling of IPv4-mapped IPv6 addresses.
- Prevent unintended cross-matching between IPv4 and IPv6 address families.
- Preserve existing IPv4 address matching, hostname resolution, wildcard matching, and legacy host-based access-control behavior.
- Verify behavior in environments using IPv4, IPv6, and dual-stack networking.
6. Networking and Authentication Integration
- Verify that IPv6 client connections can be associated with the correct MariaDB account.
- Ensure IPv6 address handling integrates correctly with existing connection and authentication flows.
- Identify and address any limitations in the networking or account-matching layers that prevent IPv6-based account identification.
7. Testing and Documentation
- Add unit tests for IPv6 address parsing, validation, and normalization.
- Add integration tests for account creation, privilege management, and connection-time host matching.
- Cover IPv6-only and dual-stack scenarios where supported.
- Add regression tests to ensure existing IPv4 behavior remains unchanged.
- Update relevant MariaDB documentation and test cases.
Acceptance Criteria
- Valid IPv6 addresses are accepted in supported account host specifications.
- Invalid IPv6 addresses are rejected with appropriate errors.
- Equivalent compressed and expanded IPv6 addresses are handled consistently.
- User and role account-management operations correctly support IPv6 host specifications wherever applicable.
- GRANT and REVOKE operate correctly with IPv6-based account specifications.
- Client connections originating from IPv6 addresses are matched to the intended accounts.
- Account selection remains deterministic when exact addresses, hostnames, wildcard specifications, and other supported host forms overlap.
- IPv4-mapped IPv6 addresses are handled according to the defined compatibility policy.
- IPv4, IPv6, and dual-stack connection scenarios behave correctly.
- Existing IPv4 address matching, hostname handling, wildcard behavior, and account-management functionality remain unaffected.
- Account definitions involving IPv6 are persisted and restored correctly across server restarts.
- Automated tests cover the supported functionality, error conditions, and backward-compatibility requirements.
Examples-
CREATE USER 'ipv6_admin'@'2001:db8::25'
|
IDENTIFIED BY 'test_password';
|
|
|
ALTER USER 'ipv6_admin'@'2001:db8::25'
|
IDENTIFIED BY 'new_password';
|
|
|
RENAME USER 'ipv6_admin'@'2001:db8::25'
|
TO 'ipv6_admin2'@'2001:db8::25';
|
|
|
DROP USER 'ipv6_admin2'@'2001:db8::25';
|
-- IPv6 loopback
|
CREATE USER 'ipv6_local'@'::1'
|
IDENTIFIED BY 'test_password';
|
|
|
-- Full IPv6 address
|
CREATE USER 'ipv6_user'@'2001:db8:abcd:12::25'
|
IDENTIFIED BY 'test_password';
|
|
|
-- Expanded IPv6 address
|
CREATE USER 'ipv6_expanded'@'2001:0db8:abcd:0012:0000:0000:0000:0025'
|
IDENTIFIED BY 'test_password';
|
|
|
-- Global IPv6 address
|
CREATE USER 'ipv6_global'@'2001:db8::10'
|
IDENTIFIED BY 'test_password';
|
CREATE ROLE 'ipv6_role'@'2001:db8::25';
|
|
|
SHOW CREATE ROLE 'ipv6_role'@'2001:db8::25';
|
|
|
DROP ROLE 'ipv6_role'@'2001:db8::25';
|
Attachments
Issue Links
- relates to
-
MDEV-25515 Request: User Account Host Names using CIDR notation
-
- Closed
-
-
DOCS-6952 Loading...
- has action item
-
DOCS-6957 Loading...