Skip to content

telekom/mb-netmgmt

Repository files navigation

Network Management Protocols for Mountebank

DevelopmentDocumentationSupportContributeLicensing

SNMP, Telnet, SSH and NETCONF implementation for Mountebank

Installation

Docker

$ docker run -p2525:2525 -p23:23 -p830:830 cbuehler/mb-netmgmt
info: [mb:2525] Loaded custom protocol snmp
info: [mb:2525] Loaded custom protocol telnet
info: [mb:2525] Loaded custom protocol netconf
info: [mb:2525] Loaded custom protocol ssh
info: [mb:2525] mountebank v2.6.0 now taking orders - point your browser to http://localhost:2525/ for help

Manual installation

$ npm install -g mountebank
$ pip install mb-netmgmt
$ wget https://raw.githubusercontent.com/telekom/mb-netmgmt/main/mb_netmgmt/protocols.json
$ mb
info: [mb:2525] Loaded custom protocol snmp
info: [mb:2525] Loaded custom protocol telnet
info: [mb:2525] Loaded custom protocol netconf
info: [mb:2525] Loaded custom protocol ssh
info: [mb:2525] mountebank v2.6.0 now taking orders - point your browser to http://localhost:2525/ for help

Usage

$ curl -XPUT localhost:2525/imposters -d '
{
  "imposters": [
    {
      "port": 22,
      "protocol": "ssh",
      "stubs": [
        {
          "responses": [
            {
              "proxy": {
                "predicatesGenerators": [
                  {
                    "matches": {
                      "command": true
                    }
                  }
                ],
                "to": "ssh://username:password@example.org"
              }
            }
          ]
        }
      ]
    },
    {
      "port": 23,
      "protocol": "telnet",
      "stubs": [
        {
          "predicates": [
            {
              "deepEquals": {
                "command": "show run\r\n"
              }
            }
          ],
          "responses": [
            {
              "is": {
                "response": "end\r\n\r\n#"
              }
            }
          ]
        },
        {
          "responses": [
            {
              "proxy": {
                "predicatesGenerators": [
                  {
                    "matches": {
                      "command": true
                    }
                  }
                ],
                "to": "telnet://example.org"
              }
            }
          ]
        }
      ]
    },
    {
      "port": 830,
      "protocol": "netconf",
      "stubs": [
        {
          "predicates": [
            {
              "deepEquals": {
                "rpc": "<get-config>running</get-config>"
              }
            }
          ],
          "responses": [
            {
              "is": {
                "rpc-reply": "<rpc-reply xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\"><configuration/></rpc-reply>"
              }
            }
          ]
        },
        {
          "responses": [
            {
              "proxy": {
                "predicateGenerators": [
                  {
                    "matches": {
                      "rpc": true
                    }
                  }
                ],
                "to": "netconf://username:password@example.org"
              }
            }
          ]
        }
      ]
    }
  ]
}
'

For more details, have a look at the Mountebank documentation

Code of Conduct

This project has adopted the Contributor Covenant in version 2.1 as our code of conduct. Please see the details in our CODE_OF_CONDUCT.md. All contributors must abide by the code of conduct.

Working Language

We decided to apply English as the primary project language.

Consequently, all content will be made available primarily in English. We also ask all interested people to use English as language to create issues, in their code (comments, documentation etc.) and when you send requests to us. The application itself and all end-user facing content will be made available in other languages as needed.

Support and Feedback

The following channels are available for discussions, feedback, and support requests:

Type Channel
Issues
Other Requests

How to Contribute

Contribution and feedback is encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our Contribution Guidelines. By participating in this project, you agree to abide by its Code of Conduct at all times.

Licensing

Copyright (c) 2021 Deutsche Telekom AG.

Licensed under the GNU General Public License Version 2.0 (or later) (the "License"); you may not use this file except in compliance with the License.

You may obtain a copy of the License by reviewing the file COPYING in the repository or by downloading the respective version from
https://www.gnu.org/licenses/

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the COPYING for the specific language governing permissions and limitations under the License.

About

Network Management Protocols for Mountebank

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published