Skip to content

[yang][tacacs]: reject unsupported mschap auth_type#26884

Open
Flamki wants to merge 1 commit intosonic-net:masterfrom
Flamki:flamki/tacacs-reject-mschap-26540
Open

[yang][tacacs]: reject unsupported mschap auth_type#26884
Flamki wants to merge 1 commit intosonic-net:masterfrom
Flamki:flamki/tacacs-reject-mschap-26540

Conversation

@Flamki
Copy link
Copy Markdown

@Flamki Flamki commented Apr 18, 2026

Why I did it

SONiC TACACS currently accepts auth_type=mschap, but TACACS auth runtime falls back to PAP. This is misleading and can create security/configuration confusion.

Closes #26540.

Work item tracking
  • Microsoft ADO (number only): N/A

How I did it

  • Removed mschap from TACACS auth type enum in:
    • src/sonic-yang-models/yang-models/sonic-system-tacacs.yang
  • Added/updated YANG validation tests to ensure mschap is rejected in both:
    • TACPLUS global auth type
    • TACPLUS_SERVER auth type

How to verify it

  1. Try configuring TACACS auth type as mschap (global or server-specific).
  2. Verify config is rejected by YANG validation (InvalidValue) instead of being accepted and silently behaving as PAP.
  3. Verify existing valid TACACS auth types (pap, chap, login) still work.

Which release branch to backport (provide reason below if selected)

  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511

Tested branch (Please provide the tested image version)

  • master (schema + json test updates)

Description for the changelog

Reject unsupported TACACS mschap auth_type in YANG to prevent misleading PAP fallback behavior.

Link to config_db schema for YANG module changes

N/A (YANG enum tightening only; no new table/schema section).

A picture of a cute animal (not mandatory but encouraged)

Remove TACACS mschap from sonic-system-tacacs YANG auth_type enum to avoid silently falling back to PAP at runtime.

Add TACACS YANG tests to assert mschap is rejected for both global and server auth_type fields.

Signed-off-by: Flamki <[email protected]>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@Flamki
Copy link
Copy Markdown
Author

Flamki commented Apr 18, 2026

One compatibility note for visibility: this PR intentionally tightens YANG validation by rejecting auth_type=mschap (both TACPLUS global and TACPLUS_SERVER), since runtime does not actually support MSCHAP and falls back to PAP.

Potential impact: any existing deployment still carrying auth_type=mschap in config DB may now fail validation/reload until switched to a supported type (pap/chap/login).

Please let me know if you want a follow-up migration/cleanup path documented for operators upgrading with legacy configs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug:TACACS auth_type mschap is accepted by SONiC but silently falls back to PAP

2 participants