Conversation
felix-kaestner
left a comment
There was a problem hiding this comment.
@weneghawi Please have a look at the openconfig-system:system/aaa yang model. Only configurations that are part of this or are otherwise commonly found on all vendors (Nokia, Juniper, Arista & Co.) should be part of the core api. All Cisco NX-OS specific configuration should be refactored into a vendor specific provider config, see e.g. the ManagementAccess resource on how this is done. There is a separate api package for cisco specific CRDs.
Done. The core API (
All Cisco NX-OS specific config has been moved to the |
14c783c to
c4937c1
Compare
ce3748b to
9b58290
Compare
98588a4 to
b202cf6
Compare
5c5f3d9 to
3fb343d
Compare
Merging this branch will decrease overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
Summary
Restructured the core AAA API to align with the OpenConfig
system/aaaYANG model, making it vendor-agnostic and suitable for multi-vendor support (Nokia, Juniper, Arista, etc.). All Cisco NX-OS specific configuration has been moved to a dedicatedAAAConfigprovider CRD. RADIUS server group support has been added alongside the existing TACACS+ implementation.Core API Changes (
api/core/v1alpha1/aaa_types.go)TACACSServers+TACACSGroupwithServerGroups []AAAServerGroup— protocol-agnostic containers with nested servers, following OpenConfig/system/aaa/server-groups/server-group. Supports bothTACACSandRADIUSgroup types.AAAServerRADIUSstruct withauthPort(default 1812),acctPort(default 1813), andkeySecretRefAuthentication,Authorization, andAccountingto simple method lists (removed NX-OS specific nesting likeLogin.Default/ConsoleandConfigCommands)VRF->VrfName,SourceInterface->SourceInterfaceName(leaves room for future object references)KeyEncryption,LoginErrorEnablemoved to CiscoAAAConfigCRDserverGroups,authentication,authorization, oraccountingmust be settacacsconfigradiusconfiggroupNameis required when method type isGroupdeviceRefis immutableCisco AAAConfig CRD (
api/cisco/nx/v1alpha1/aaaconfig_types.go)ConsoleAuthentication *NXOSMethodList— NX-OS:aaa authentication login consoleConfigCommandsAuthorization *NXOSMethodList— NX-OS:aaa authorization config-commands defaultRADIUSKeyEncryptiontype (Type6/Type7/Clear) withradiusKeyEncryptionfield (default Type7)KeyEncryption(Type6/Type7/Clear) andLoginErrorEnableController (
internal/controller/core/aaa_controller.go)ServerGroups[].Servers[].TACACS.KeySecretRefandServerGroups[].Servers[].RADIUS.KeySecretRefsecretToAAAwatch mapping to trigger reconciliation on changes to both TACACS and RADIUS key secretsNX-OS Provider (
internal/provider/cisco/nxos/)RadiusProvider,RadiusProviderGroup,RadiusProviderRefNX-OS DME structs. AddedMapRADIUSKeyEncryptionhelper. AddedgroupTypeByNameandMapRealmFromGroupto correctly resolve realm as"radius"or"tacacs"based on the referenced server group type. Removed read-onlyNameandRealmfields fromAAADefaultAuthor(NX-OS rejects writes to these). AddedMapNXOSRealm,MapNXOSLocal,MapNXOSFallbackhelpers. Note: RADIUS on NX-OS requires no feature flag (unlike TACACS+ which requiresfeature tacacs+).EnsureAAAto iterateServerGroupswith aswitchon group type covering both TACACS and RADIUS. RewroteDeleteAAAwith batched resets and RADIUS group/server cleanup. Changed fromPatchtoUpdate(netconf replace).Sample YAML (
config/samples/networking_v1alpha1_aaa.yaml)serverGroups, nestedservers, flat method lists, and separate CiscoAAAConfigwith console/config-commands authorization.Test Plan
go build ./...— compiles cleanlygo test ./api/... ./internal/provider/... ./internal/clientutil/...— all passmake run-golangci-lint— 0 issuesmake generate— CRDs and deepcopy regeneratedradius