ELTEX-MES-AAA DEFINITIONS ::= BEGIN

-- Title:      ELTEX MES AAA Extension Private
-- Version:    1.1
-- Date:       6 Aug 2023
--

-- 6-Aug-2023 - Added eltMesAAALine objects

IMPORTS
    eltMes, eltMesRadius, eltMesTacacs    FROM ELTEX-MES
    OBJECT-TYPE, Unsigned32               FROM SNMPv2-SMI
    TruthValue                            FROM SNMPv2-TC
    RlAAAAccountingMethod, 
    rlAAALocalUserEntry                   FROM RADLAN-AAA
    rndErrorDesc, rndErrorSeverity        FROM RADLAN-DEVICEPARAMS-MIB
    rlAAAUserInetEntry                    FROM RADLAN-AAA;

--
-- AAA MIB
--

eltMesAAA MODULE-IDENTITY
        LAST-UPDATED "201509210000Z"
        ORGANIZATION "Eltex Ltd."
        CONTACT-INFO
                "http://www.eltex.nsk.ru"
        DESCRIPTION
                "The private MIB module definition for Authentication, Authorization and Accounting
                 in Eltex MES devices."
        ::= { eltMes 79 }

eltMesAAANotifications OBJECT IDENTIFIER ::= { eltMesAAA 0 }

EltAAAServiceType  ::= TEXTUAL-CONVENTION
   STATUS current
   DESCRIPTION    "Line service type."
   SYNTAX INTEGER {
      console(0),
      telnet(1),
      ssh(2)
}

EltAAAMethodListModeType ::= TEXTUAL-CONVENTION
   STATUS current
   DESCRIPTION    "Authentication mode type."
   SYNTAX INTEGER {
      eltAAAMethodListModeTypeChain(0),
      eltAAAMethodListModeTypeBreak(1)
}

EltAAAEncryptionAlgorithmType  ::= TEXTUAL-CONVENTION
   STATUS current
   DESCRIPTION    "Encryption alhorithm type."
   SYNTAX INTEGER {
        md5(1),
        sha-1(2),
        sha-512(3)
}

eltAAAMethodListMode OBJECT-TYPE
    SYNTAX   EltAAAMethodListModeType
    MAX-ACCESS   read-write
    STATUS   current
    DESCRIPTION "Specify the authentication mode."
  ::= { eltMesAAA 1 }

eltAAAAccountingCommandsMethod OBJECT-TYPE
    SYNTAX   RlAAAAccountingMethod
    MAX-ACCESS   read-write
    STATUS   current
    DESCRIPTION "Specify a method used for accounting of user commands."
  ::= { eltMesAAA 2 }

---
--- Line MIB Objects
---

eltMesAAALine          OBJECT IDENTIFIER ::= { eltMesAAA 3 }

eltAAALineTelnetMaxLoginAttempts OBJECT-TYPE
    SYNTAX      INTEGER  (1..10)
    MAX-ACCESS  read-write
    STATUS      current
    DESCRIPTION "The maximum number of unsuccessful login attempts into
                 a Telnet session made before the connection is closed."
    ::= { eltMesAAALine 1 }

eltAAALineSshMaxLoginAttempts OBJECT-TYPE
    SYNTAX      INTEGER  (1..10)
    MAX-ACCESS  read-write
    STATUS      current
    DESCRIPTION "The maximum number of unsuccessful login attempts into
                 a SSH session made before the connection is closed."
    ::= { eltMesAAALine 2 }

--
-- Command Authorization MIB Objects
--
eltAAAAuthorizationCommandsMethodListName OBJECT-TYPE
    SYNTAX   OCTET STRING (SIZE(3..20))
    MAX-ACCESS   read-write
    STATUS   current
    DESCRIPTION "Specify a method used for authorization of user commands."
    DESCRIPTION "Specify the name of authorization list used for authorization of user commands."
    DEFVAL { "cmd_default" }
  ::= { eltMesAAA 5 }

--
-- Augment for rlAAAUserInetTable
--
eltAAAUserInetTable OBJECT-TYPE
    SYNTAX      SEQUENCE OF EltAAAUserInetEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION "The table holds all current users that have been authenticated.
                 it coexist with rlAAAUserTable to support IPv4 and IPv6"
    ::= { eltMesAAA 8 }

---
--- Interim update feature
---
eltAAAAccountingInterimUpdateEnable OBJECT-TYPE
    SYNTAX      TruthValue
    MAX-ACCESS  read-write
    STATUS      current
    DESCRIPTION
        "Enables or disables interim updates."
    DEFVAL      { false }
  ::= { eltMesAAA 9 }

eltAAAAccountingInterimUpdateInterval OBJECT-TYPE
    SYNTAX      INTEGER  (1..300)
    MAX-ACCESS  read-write
    STATUS      current
    DESCRIPTION
        "Time interval in minutes between periodic interim messages."
    DEFVAL      { 1 }
  ::= { eltMesAAA 10 }

eltAAAUserInetEntry OBJECT-TYPE
    SYNTAX      EltAAAUserInetEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION "The row definition for this table."
    AUGMENTS    { rlAAAUserInetEntry }
    ::= { eltAAAUserInetTable 1 }

EltAAAUserInetEntry ::= SEQUENCE {
    eltAAAUserInetMrid  Unsigned32
}

eltAAAUserInetMrid  OBJECT-TYPE
    SYNTAX      Unsigned32
    MAX-ACCESS  read-only 
    STATUS      current
    DESCRIPTION
        "Indicates in which MRID the connection is established."
    ::= { eltAAAUserInetEntry 1 }

--
-- RADIUS attributes
--

eltMesRadiusAttr OBJECT IDENTIFIER ::= { eltMesRadius 1 }

eltRadiusAttrNasIdAccessEnable OBJECT-TYPE
    SYNTAX      TruthValue
    MAX-ACCESS  read-write
    STATUS      current
    DESCRIPTION
        "Enable or disable including NAS-Identifier attribute in Access Request messages"
    DEFVAL      { false }
    ::= { eltMesRadiusAttr 1 }

eltRadiusAttrNasIdFormatString OBJECT-TYPE
    SYNTAX      OCTET STRING (SIZE(0..32))
    MAX-ACCESS  read-write
    STATUS      current
    DESCRIPTION
        "The format string for NAS-Identifier RADIUS attribute."
    DEFVAL      { "%h" }
    ::= { eltMesRadiusAttr 2 }

eltRadiusAttrFramedIPAddressAccessEnable OBJECT-TYPE
    SYNTAX      TruthValue
    MAX-ACCESS  read-write
    STATUS      current
    DESCRIPTION
        "Enable or disable including Framed-IP-Address(8) attribute in 
         Access-Request and Accounting-Request messages for RADIUS-server."
    DEFVAL      { false }
    ::= { eltMesRadiusAttr 3 }

eltRadiusAttrNasPortIdFormatString OBJECT-TYPE
    SYNTAX      OCTET STRING (SIZE(0..32))
    MAX-ACCESS  read-write
    STATUS      current
    DESCRIPTION
        "The format string for NAS-Port-Identifier RADIUS attribute."
    DEFVAL      { "%p" }
    ::= { eltMesRadiusAttr 4 }

eltRadiusAttrServiceTypeAccessReq OBJECT-TYPE
    SYNTAX  INTEGER {
      disable        (0),
      administrative (6),
      nasPrompt      (7)
    }
    MAX-ACCESS  read-write
    STATUS      current
    DESCRIPTION
        "This variable for service type attribute in RADIUS access-request during authorization."
    DEFVAL      { disable }
    ::= { eltMesRadiusAttr 5 }

--
-- TACACS attributes
--

eltMesTacacsAttr OBJECT IDENTIFIER ::= { eltMesTacacs 1 }

eltTacacsAttrPortConfigTable OBJECT-TYPE
    SYNTAX      SEQUENCE OF EltTacacsAttrPortConfigEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "A list of TACACS attributes configuring mechanism."
    ::= { eltMesTacacsAttr 1 }

eltTacacsAttrPortConfigEntry OBJECT-TYPE
   SYNTAX      EltTacacsAttrPortConfigEntry
   MAX-ACCESS  not-accessible
   STATUS      current
   DESCRIPTION
       "An entry containing TACACS attributes configuring
        mechanism."
   INDEX { eltTacacsAttrPortLineType }
   ::= { eltTacacsAttrPortConfigTable 1 }

EltTacacsAttrPortConfigEntry ::=
    SEQUENCE {
        eltTacacsAttrPortLineType
            EltAAAServiceType,
        eltTacacsAttrPortFormat
            OCTET STRING
    }

eltTacacsAttrPortLineType OBJECT-TYPE
    SYNTAX      EltAAAServiceType
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "Line type."
    ::= { eltTacacsAttrPortConfigEntry 1 }

eltTacacsAttrPortFormat OBJECT-TYPE
    SYNTAX      OCTET STRING
    MAX-ACCESS  read-write
    STATUS      current
    DESCRIPTION
        "User defined string to use as port attribute
         in TACACS packets. Specify port
         string template:
              <%n: line session index>,
              <%%: single %>."
    ::= { eltTacacsAttrPortConfigEntry 2 }
    
--
-- Dynamic Authorization MIB Objects
--
eltMesDynamicAuthorization OBJECT IDENTIFIER ::= { eltMesAAA 4 }
eltMesDynamicAuthorizationGlobals OBJECT IDENTIFIER ::= { eltMesDynamicAuthorization 1 }

eltDynamicAuthorizationRadiusEnable OBJECT-TYPE
   SYNTAX       TruthValue
   MAX-ACCESS   read-write
   STATUS       current
   DESCRIPTION
       "Specifies whether Dynamic Radius Server enabled on the switch. "
   DEFVAL  { false }
   ::= { eltMesDynamicAuthorizationGlobals 1 }

eltDynamicAuthorizationRadiusPort OBJECT-TYPE
    SYNTAX INTEGER (1..65535)
    MAX-ACCESS read-write
    STATUS current
    DESCRIPTION
        "To define the accounting UDP port used for dynamic authentication requests."
    DEFVAL  { 3799 }
    ::= { eltMesDynamicAuthorizationGlobals 2 }

---
--- Notifications
---

eltAAAUserTrap NOTIFICATION-TYPE
    OBJECTS   {rndErrorDesc, rndErrorSeverity}
    STATUS current
    DESCRIPTION
        "A eltAAAUserTrap is generated when user
         connect/reject/disconnect from the session."
    ::= { eltMesAAANotifications 1 }

--
-- eltAAALocalUserTable
--
eltAAALocalUserTable OBJECT-TYPE
    SYNTAX       SEQUENCE OF EltAAALocalUserEntry
    MAX-ACCESS   not-accessible
    STATUS       current
    DESCRIPTION  "The table specifies all usernames, their passwords and
                 their authorizations."
    ::= { eltMesAAA 6 }

eltAAALocalUserEntry OBJECT-TYPE
    SYNTAX       EltAAALocalUserEntry
    MAX-ACCESS   not-accessible
    STATUS       current
    DESCRIPTION  "The row definition for this table."
    AUGMENTS    { rlAAALocalUserEntry }
    ::= { eltAAALocalUserTable 1 }

EltAAALocalUserEntry ::= SEQUENCE {
        eltAAAlocalUserTimeLeftToUnblock            Unsigned32,
        eltAAALocalUserEncryptionAlgorithmType      EltAAAEncryptionAlgorithmType
}

eltAAAlocalUserTimeLeftToUnblock OBJECT-TYPE
        SYNTAX          Unsigned32
        MAX-ACCESS      read-only
        STATUS          current
        DESCRIPTION       "Time left for unblock"
        ::= { eltAAALocalUserEntry 1 }

eltAAALocalUserEncryptionAlgorithmType OBJECT-TYPE
        SYNTAX          EltAAAEncryptionAlgorithmType
        MAX-ACCESS      read-write
        STATUS          current
        DESCRIPTION  "Password Encryption algorithm type field"
        ::= { eltAAALocalUserEntry 2 }

--
-- eltAAATimeLeftToUnblock
--
eltAAATimeLeftToUnblock  OBJECT-TYPE
    SYNTAX           Unsigned32 (0..7200)
    MAX-ACCESS       read-write
    STATUS           current
    DESCRIPTION
                     "Time in seconds to unblock user after
                      a few authenticate fails"
    DEFVAL           { 0 }
    ::= { eltMesAAA 7 }

END
