Coder Social home page Coder Social logo

cisshgo's People

Contributors

hellt avatar lykinsbd avatar tbotnz avatar wrgeorge1983 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cisshgo's Issues

cryptossh ReadLine() looks for "\r\n" cisco ios appears to use "\n"

noticed the return char not coming through when using netmiko

DEBUG:paramiko.transport:userauth is OK
INFO:paramiko.transport:Authentication (password) successful!
DEBUG:paramiko.transport:[chan 0] Max packet in: 32768 bytes
DEBUG:paramiko.transport:[chan 0] Max packet out: 32768 bytes
DEBUG:paramiko.transport:Secsh channel 0 opened.
DEBUG:paramiko.transport:[chan 0] Sesch channel 0 request ok
DEBUG:paramiko.transport:[chan 0] Sesch channel 0 request ok
DEBUG:netmiko:read_channel: cisgo1000v>
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:write_channel: b'\n'
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:write_channel: b'\n'
DEBUG:netmiko:read_channel:
DEBUG:netmiko:write_channel: b'\n'

however if the below used it works

{
"library": "netmiko",
"connection_args": {
"device_type": "cisco_ios",
"host": "10.0.2.15",
"username": "{{device_username}}",
"password": "{{device_password}}",
"port":10039,
"fast_cli":true,
"default_enter":"\r\n"
},
"command": "show ip interface brief",
"queue_strategy": "fifo",
"args":{
"use_textfsm":true
}
}

Add Docker Build/Release

Goreleaser does an awesome job taking a tag in Master and creating a release with artifacts.

We need to look at also using it to generate the Docker containers and pushing to Dockerhub.

https://goreleaser.com/customization/docker/

It’s already in the Goreleaser config file, just need to test and try it out!

# uncomment and modify if automated docker build/push is needed
# dockers:
#   - goos: linux
#     goarch: amd64
#     binaries:
#       - cisshgo
#     image_templates:
#       - "hellt/cisshgo:latest"
#       - 'hellt/cisshgo:{{ replace .Version "v" ""}}'
#     dockerfile: Dockerfile
#     skip_push: false

Add support for SSH exec

Hi,
Thank you for providing this useful package.
I can't seem to get any command to be returned if I use asyncssh. If I connect manually, it seems to work fine. I have asyncssh working without anything fancy across Cisco's NXOS, Arista, Juniper, Linux and so on. Would you be able to provide any hints as to why this might be happeniing or help me fix this?

The connection succeeds (as per asyncssh logs, and I see the same with cissshgo's output), but the command "show version" just hangs. I'm attaching the debug log from asyncssh if its of some value.

Thanks,
Dinesh

2021-01-12 08:09:35,175 - asyncssh - INFO - Opening SSH connection to localhost, port 10000
2021-01-12 08:09:35,186 - asyncssh - INFO - [conn=0] Connection to localhost, port 10000 succeeded
2021-01-12 08:09:35,186 - asyncssh - INFO - [conn=0] Local address: 127.0.0.1, port 34924
2021-01-12 08:09:35,186 - asyncssh - DEBUG - [conn=0] Requesting key exchange
2021-01-12 08:09:35,187 - asyncssh - DEBUG - [conn=0] Received key exchange request
2021-01-12 08:09:35,192 - asyncssh - DEBUG - [conn=0] Beginning key exchange
2021-01-12 08:09:35,199 - asyncssh - DEBUG - [conn=0] Completed key exchange
2021-01-12 08:09:35,200 - asyncssh - INFO - [conn=0] Beginning auth for user admin
2021-01-12 08:09:35,202 - asyncssh - DEBUG - [conn=0] Trying password auth
2021-01-12 08:09:35,204 - asyncssh - INFO - [conn=0] Auth for user admin succeeded
2021-01-12 08:09:35,204 - suzieq.poller.nodes.node - INFO - Connected to localhost at 1610467775.2045498
2021-01-12 08:09:35,205 - asyncssh - DEBUG - [conn=0, chan=0] Set write buffer limits: low-water=16384, high-water=65536
2021-01-12 08:09:35,205 - asyncssh - INFO - [conn=0, chan=0] Requesting new SSH session
2021-01-12 08:09:35,207 - asyncssh - INFO - [conn=0, chan=0] Command: show version
2021-01-12 08:09:45,217 - suzieq.poller.nodes.node - ERROR - Unable to connect to localhost show version due to timeout

Need to add License File

@tbotnz

This was talked about briefly in #cisshgo channel on networktocode.slack.com some time ago, but that is now lost to the ages and short scrollback of free slack.

We need to add a license file to this repo to define the license we're using.

https://choosealicense.com/ was what we looked at, I think we wanted to do the Lesser GPL v3:

https://choosealicense.com/licenses/lgpl-3.0/

Permissions

  • Commercial use
  • Distribution
  • Modification
  • Patent use
  • Private use

Conditions

  • Disclose source
  • License and copyright notice
  • Same license (library)
  • State changes

Limitations

  • Liability
  • Warranty

If you're good with this, I can PR up the LGPL license file.

Commands with / in it do not work (e.g. show interfaces GigabitEthernet2/1)

Hello guys,

First of all, congratulations and thank you for such a wonderful tool!

I am opening a new issue because I have tried to issue the following command: "show interfaces GigabitEthernet2/1" and it does not work. I created the file output and map it at the transcript, but no luck. The output of the log shows the command was issued, however it does not print the output. I tried to escape the "/" or any other workaround, but I cannot make it work. Do you know how this could be solved? I believe it is quite important, since most of the Cisco commands related to interfaces would include that.

RFC: Implement Support for Multiple Different Devices

Today, there is only one device available in the transcripts, and there is no ability to select a different device.

We need to decide how to start implementing support for different device types, and how to manage/instantiate them.

This will require some thought/planning around the best way to specify a scenario like the following (as an example):

  • I want 10 fake Cisco ASAs
  • I want 10 fake Cisco ISRs
  • I want 100 fake Juniper MXes

Perhaps the initial configuration simply round-robins through all the devices in transcript_map.yaml and deploys the one of each up to the threshold of maximum listeners?

Is a configuration file specifying the desired topology needed?

@tbotnz and @wrgeorge1983 thoughts?

Allow for "Longest Match" style input to command matching

It should be fairly trivial to introduce a helper function in utils that evaluates any non-matching input against the keys from the FakeDevice[SupportedCommands] map. This would allow us to not have to have duplicate entries, but to simply search for any string with the most matches from the beginning of the line.

Psuedo-code:

func LongestMatch(input string, SupportedCommands slice) (matched bool, matched_command string):
    for command in SupportedCommands:
        \\ Do Regex to match start of string against user input
        return (matched, matched_command)

Semvar and Release Cycle

We probably need to get up to the v1.0.0 release and start strictly following semvar with any pushes to master. With Go modules this can really bite you in the behind later if you don't start early.

I don't anticipate too many people would be importing our code as a module, vs running the standalone application, but you never know.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.