oxidized 0.29.1 → 0.30.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/codeql.yml +4 -4
  3. data/.github/workflows/publishdocker.yml +3 -0
  4. data/.github/workflows/ruby.yml +1 -1
  5. data/.github/workflows/stale.yml +4 -1
  6. data/.rubocop.yml +6 -3
  7. data/.rubocop_todo.yml +10 -93
  8. data/CHANGELOG.md +66 -4
  9. data/CONTRIBUTING.md +174 -0
  10. data/Dockerfile +12 -1
  11. data/README.md +18 -36
  12. data/bin/oxidized +2 -5
  13. data/docs/Hooks.md +37 -1
  14. data/docs/Model-Notes/APC_AOS.md +52 -0
  15. data/docs/Model-Notes/FSOS.md +11 -0
  16. data/docs/Model-Notes/FortiOS.md +28 -0
  17. data/docs/Model-Notes/README.md +1 -20
  18. data/docs/Model-Notes/XGS4600-Zyxel.md +5 -0
  19. data/docs/Ruby-API.md +1 -1
  20. data/docs/Sources.md +13 -0
  21. data/docs/Supported-OS-Types.md +178 -270
  22. data/docs/Troubleshooting.md +16 -0
  23. data/examples/podman-compose/Makefile +61 -0
  24. data/examples/podman-compose/README.md +58 -0
  25. data/examples/podman-compose/docker-compose.yml +21 -0
  26. data/examples/podman-compose/model-simulation/Dockerfile-model +13 -0
  27. data/examples/podman-compose/model-simulation/asternos.sh +34 -0
  28. data/examples/podman-compose/oxidized-config/.gitignore +8 -0
  29. data/examples/podman-compose/oxidized-config/config +46 -0
  30. data/examples/podman-compose/oxidized-config/router.db +1 -0
  31. data/examples/podman-compose/oxidized-ssh/README.md +14 -0
  32. data/extra/rest_client.rb +2 -2
  33. data/extra/syslog.rb +2 -2
  34. data/lib/oxidized/cli.rb +6 -4
  35. data/lib/oxidized/config.rb +17 -14
  36. data/lib/oxidized/core.rb +22 -3
  37. data/lib/oxidized/hook.rb +3 -3
  38. data/lib/oxidized/input/exec.rb +1 -1
  39. data/lib/oxidized/input/ftp.rb +2 -2
  40. data/lib/oxidized/input/http.rb +32 -8
  41. data/lib/oxidized/input/input.rb +1 -1
  42. data/lib/oxidized/input/scp.rb +52 -0
  43. data/lib/oxidized/input/ssh.rb +10 -7
  44. data/lib/oxidized/input/telnet.rb +3 -2
  45. data/lib/oxidized/input/tftp.rb +1 -1
  46. data/lib/oxidized/jobs.rb +11 -1
  47. data/lib/oxidized/manager.rb +6 -6
  48. data/lib/oxidized/model/acos.rb +1 -1
  49. data/lib/oxidized/model/addpack.rb +26 -0
  50. data/lib/oxidized/model/adtran.rb +5 -1
  51. data/lib/oxidized/model/adva.rb +2 -2
  52. data/lib/oxidized/model/aoscx.rb +2 -1
  53. data/lib/oxidized/model/apc_aos.rb +2 -1
  54. data/lib/oxidized/model/aricentiss.rb +7 -0
  55. data/lib/oxidized/model/asternos.rb +22 -0
  56. data/lib/oxidized/model/asyncos.rb +2 -2
  57. data/lib/oxidized/model/awplus.rb +2 -2
  58. data/lib/oxidized/model/bdcom.rb +1 -0
  59. data/lib/oxidized/model/c4cmts.rb +1 -2
  60. data/lib/oxidized/model/ciscosma.rb +1 -1
  61. data/lib/oxidized/model/ciscosmb.rb +6 -1
  62. data/lib/oxidized/model/comware.rb +2 -2
  63. data/lib/oxidized/model/cumulus.rb +1 -1
  64. data/lib/oxidized/model/dellx.rb +1 -1
  65. data/lib/oxidized/model/dlink.rb +4 -2
  66. data/lib/oxidized/model/dlinknextgen.rb +51 -0
  67. data/lib/oxidized/model/dnos.rb +3 -0
  68. data/lib/oxidized/model/edgecos.rb +1 -1
  69. data/lib/oxidized/model/eltex.rb +2 -0
  70. data/lib/oxidized/model/enterasys800.rb +1 -1
  71. data/lib/oxidized/model/eos.rb +1 -1
  72. data/lib/oxidized/model/firebrick.rb +2 -2
  73. data/lib/oxidized/model/firewareos.rb +1 -1
  74. data/lib/oxidized/model/fortios.rb +9 -2
  75. data/lib/oxidized/model/fsos.rb +44 -0
  76. data/lib/oxidized/model/ios.rb +1 -1
  77. data/lib/oxidized/model/iosxr.rb +2 -2
  78. data/lib/oxidized/model/junos.rb +3 -2
  79. data/lib/oxidized/model/mimosab11.rb +34 -0
  80. data/lib/oxidized/model/ml66.rb +33 -0
  81. data/lib/oxidized/model/model.rb +3 -3
  82. data/lib/oxidized/model/netgear.rb +1 -1
  83. data/lib/oxidized/model/netscaler.rb +1 -1
  84. data/lib/oxidized/model/nxos.rb +4 -3
  85. data/lib/oxidized/model/ocnos.rb +42 -0
  86. data/lib/oxidized/model/onefinity.rb +18 -0
  87. data/lib/oxidized/model/openbsd.rb +1 -1
  88. data/lib/oxidized/model/opengear.rb +36 -1
  89. data/lib/oxidized/model/opnsense.rb +1 -1
  90. data/lib/oxidized/model/panos.rb +2 -0
  91. data/lib/oxidized/model/pfsense.rb +1 -0
  92. data/lib/oxidized/model/procurve.rb +3 -1
  93. data/lib/oxidized/model/rgos.rb +33 -0
  94. data/lib/oxidized/model/routeros.rb +10 -8
  95. data/lib/oxidized/model/slxos.rb +2 -2
  96. data/lib/oxidized/model/sonicos.rb +18 -17
  97. data/lib/oxidized/model/sros.rb +3 -3
  98. data/lib/oxidized/model/tplink.rb +4 -3
  99. data/lib/oxidized/model/truenas.rb +2 -1
  100. data/lib/oxidized/model/vrp.rb +3 -1
  101. data/lib/oxidized/model/vyatta.rb +6 -0
  102. data/lib/oxidized/model/zynos.rb +67 -3
  103. data/lib/oxidized/model/zynosadsl.rb +14 -0
  104. data/lib/oxidized/model/zynosgs.rb +2 -0
  105. data/lib/oxidized/model/zynosmgs.rb +32 -0
  106. data/lib/oxidized/node.rb +7 -7
  107. data/lib/oxidized/nodes.rb +17 -12
  108. data/lib/oxidized/output/file.rb +1 -1
  109. data/lib/oxidized/output/git.rb +5 -3
  110. data/lib/oxidized/output/gitcrypt.rb +4 -3
  111. data/lib/oxidized/signals.rb +44 -0
  112. data/lib/oxidized/source/csv.rb +1 -1
  113. data/lib/oxidized/source/http.rb +26 -5
  114. data/lib/oxidized/source/source.rb +2 -2
  115. data/lib/oxidized/source/sql.rb +3 -3
  116. data/lib/oxidized/version.rb +2 -2
  117. data/lib/oxidized/worker.rb +8 -1
  118. data/lib/oxidized.rb +3 -2
  119. data/lib/refinements.rb +1 -1
  120. data/oxidized.gemspec +6 -3
  121. metadata +77 -9
data/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  Oxidized is a network device configuration backup tool. It's a RANCID replacement!
11
11
 
12
- Light and extensible, Oxidized supports over 130 operating system types.
12
+ It is light and extensible and supports over 130 operating system types.
13
13
 
14
14
  Feature highlights:
15
15
 
@@ -17,13 +17,13 @@ Feature highlights:
17
17
  * Restful API to a move node immediately to head-of-queue (GET/POST /node/next/[NODE])
18
18
  * Syslog udp+file example to catch config change events (IOS/JunOS) and trigger a config fetch
19
19
  * Will signal which IOS/JunOS user made the change, can then be used by output modules (via POST)
20
- * The `git` output module uses this info - 'git blame' will show who changed each line, and when
20
+ * The `git` output module uses this info - 'git blame' will show who changed each line
21
21
  * Restful API to reload list of nodes (GET /reload)
22
22
  * Restful API to fetch configurations (/node/fetch/[NODE] or /node/fetch/group/[NODE])
23
23
  * Restful API to show list of nodes (GET /nodes)
24
24
  * Restful API to show list of version for a node (/node/version[NODE]) and diffs
25
25
 
26
- Check out the [Oxidized TREX 2014 presentation](http://youtu.be/kBQ_CTUuqeU#t=3h) video on YouTube!
26
+ Check out the [Oxidized TREX 2014 presentation](http://youtu.be/kBQ_CTUuqeU?t=3h) video on YouTube!
27
27
 
28
28
  > :warning: [Maintainer Wanted!](#help-needed) :warning:
29
29
  >
@@ -38,6 +38,7 @@ Check out the [Oxidized TREX 2014 presentation](http://youtu.be/kBQ_CTUuqeU#t=3h
38
38
  * [FreeBSD](#freebsd)
39
39
  * [Build from Git](#build-from-git)
40
40
  * [Docker](#running-with-docker)
41
+ * [Podman-Compose](#running-with-podman-compose)
41
42
  * [Installing Ruby 2.3 using RVM](#installing-ruby-23-using-rvm)
42
43
  3. [Initial Configuration](#configuration)
43
44
  4. [Configuration](docs/Configuration.md)
@@ -67,7 +68,8 @@ Check out the [Oxidized TREX 2014 presentation](http://youtu.be/kBQ_CTUuqeU#t=3h
67
68
  * [Hook: ciscosparkdiff](docs/Hooks.md#hook-type-ciscosparkdiff)
68
69
  5. [Creating and Extending Models](docs/Creating-Models.md)
69
70
  6. [Help](#help)
70
- 7. [Ruby API](docs/Ruby-API.md#ruby-api)
71
+ 7. [Help Needed](#help-needed)
72
+ 8. [Ruby API](docs/Ruby-API.md#ruby-api)
71
73
  * [Input](docs/Ruby-API.md#input)
72
74
  * [Output](docs/Ruby-API.md#output)
73
75
  * [Source](docs/Ruby-API.md#source)
@@ -87,7 +89,7 @@ add-apt-repository universe
87
89
  Install the dependencies:
88
90
 
89
91
  ```shell
90
- apt-get install ruby ruby-dev libsqlite3-dev libssl-dev pkg-config cmake libssh2-1-dev libicu-dev zlib1g-dev g++
92
+ apt-get install ruby ruby-dev libsqlite3-dev libssl-dev pkg-config cmake libssh2-1-dev libicu-dev zlib1g-dev g++ libyaml-dev
91
93
  ```
92
94
 
93
95
  Finally, install the gems:
@@ -171,7 +173,7 @@ rake install
171
173
 
172
174
  ### Running with Docker
173
175
 
174
- Currently, Docker Hub automatically builds the master branch as [oxidized/oxidized](https://hub.docker.com/r/oxidized/oxidized/), you can make use of this container or build your own.
176
+ Currently, Docker Hub automatically builds the master branch for linux/amd64 and linux/arm64 platforms as [oxidized/oxidized](https://hub.docker.com/r/oxidized/oxidized/), you can make use of this container or build your own.
175
177
 
176
178
  To build your own, clone git repo:
177
179
 
@@ -255,6 +257,10 @@ If you need to use an internal CA (e.g. to connect to an private github instance
255
257
  docker run -v /etc/oxidized:/home/oxidized/.config/oxidized -v /path/to/MY-CA.crt:/usr/local/share/ca-certificates/MY-CA.crt -p 8888:8888/tcp -e UPDATE_CA_CERTIFICATES=true -t oxidized/oxidized:latest
256
258
  ```
257
259
 
260
+ ### Running with podman-compose
261
+ Under [examples/podman-compose](examples/podman-compose), you will find a complete
262
+ example of how to integrate the container into a docker-compose.yml file.
263
+
258
264
  ### Installing Ruby 2.3 using RVM
259
265
 
260
266
  Install Ruby 2.3 build dependencies
@@ -391,38 +397,14 @@ If you need help with Oxidized then we have a few methods you can use to get in
391
397
 
392
398
  ## Help Needed
393
399
 
394
- As things stand right now, `oxidized` is maintained by a single person. A great
395
- many [contributors](https://github.com/ytti/oxidized/graphs/contributors) have
396
- helped further the software, however contributions are not the same as ongoing
397
- owner- and maintainer-ship. It appears that many companies use the software to
398
- manage their network infrastructure, this is great news! But without additional
399
- help to maintain the software and put out releases, the future of oxidized
400
- might be less bright. The current pace of development and the much needed
401
- refactoring simply are not sustainable if they are to be driven by a single
402
- person.
403
-
404
- ## Maintainers
405
-
406
- If you would like to be a maintainer for Oxidized then please read through the below and see if it's something you would like to help with. It's not a requirement that you can tick all the boxes below but it helps :)
407
-
408
- * Triage on issues, review pull requests and help answer any questions from users.
409
- * Above average knowledge of the Ruby programming language.
410
- * Professional experience with both oxidized and some other config backup tool (like rancid).
411
- * Ability to keep a cool head, and enjoy interaction with end users! :)
412
- * A desire and passion to help drive `oxidized` towards its `1.x.x` stage of life
413
- * Help refactor the code
414
- * Rework the core infrastructure
415
- * Permission from your employer to contribute to open source projects
416
-
417
- ## YES, I WANT TO HELP
418
-
419
- Awesome! Simply send an e-mail to Saku Ytti at <saku@ytti.fi>.
400
+ As things stand right now, `oxidized` is maintained by very few people.
401
+ We would appreciate more individuals and companies getting involved in Oxidized.
420
402
 
421
- ## Further reading
403
+ Beyond software development, documentation or maintenance of Oxidized, you could
404
+ become a model maintainer, which can be done with little burden and would be a
405
+ big help to the community.
422
406
 
423
- Brian Anderson (from Rust fame) wrote an [excellent
424
- post](http://brson.github.io/2017/04/05/minimally-nice-maintainer) on what it
425
- means to be a maintainer.
407
+ Interested? Have a look at [CONTRIBUTING.md](CONTRIBUTING.md).
426
408
 
427
409
  ## License and Copyright
428
410
 
data/bin/oxidized CHANGED
@@ -1,13 +1,10 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- # FIX ME, killing oxidized needs -9
4
- trap("INT") { exit } # sinatra will otherwise steal this from us
5
-
6
3
  begin
7
4
  require_relative '../lib/oxidized/cli'
8
5
  Oxidized::CLI.new.run
9
- rescue StandardError => error
10
- warn error.to_s
6
+ rescue StandardError => e
7
+ warn e
11
8
  debug = Oxidized.config.debug rescue true
12
9
  raise if debug
13
10
 
data/docs/Hooks.md CHANGED
@@ -46,7 +46,7 @@ Exec hook recognizes the following configuration keys:
46
46
  * `async`: Execute the command in an asynchronous fashion. The main thread by default will wait for the hook command execution to complete. Set this to `true` for long running commands so node configuration pulls are not blocked. Default: `false`
47
47
  * `cmd`: command to run.
48
48
 
49
- ### exec hook configuration example
49
+ ### Exec Hook configuration example
50
50
 
51
51
  ```yaml
52
52
  hooks:
@@ -62,6 +62,42 @@ hooks:
62
62
  timeout: 120
63
63
  ```
64
64
 
65
+ ### Exec Hook configuration example to send mail
66
+
67
+ To send mail you need the package `msmtp` (It is pre-installed with the docker container)
68
+
69
+ You then need to update the `~/.msmtprc` file to contain your SMTP credentials like this:
70
+
71
+ *Note: In the docker container the file is in /home/oxidized/.config/oxidized/.msmtprc so you can create the file if it doesn't exist in your oxidized config folder.*
72
+
73
+ ```cfg
74
+ # Default settings
75
+ defaults
76
+ auth on
77
+ tls on
78
+ # Outlook SMTP
79
+ account mainaccount
80
+ host smtp.office365.com
81
+ port 587
82
+ from user@domain.com
83
+ user user@domain.com
84
+ password edit-password
85
+
86
+ account default : mainaccount
87
+ ```
88
+
89
+ For non docker users this file should have the 600 permission, using: `chmod 600 .msmtprc` and the owner of the file should be the owner of oxidized `chown oxidized:oxidized .msmtprc`
90
+
91
+ Then, you can configure Hooks to send mail like this:
92
+
93
+ ```yaml
94
+ hooks:
95
+ send_mail_hook:
96
+ type: exec
97
+ events: [node_fail]
98
+ cmd: '/usr/bin/echo -e "Subject: [Oxidized] Error on node $OX_NODE_NAME \n\nThe device $OX_NODE_NAME has not been backed-up, reason: \n\n$OX_EVENT: $OX_ERR_REASON" | msmtp destination@domain.com'
99
+ ```
100
+
65
101
  ## Hook type: githubrepo
66
102
 
67
103
  Note: You must not use the same name as any local repo configured under output. Make sure your 'git' output has a unique name that does not match your remote_repo.
@@ -0,0 +1,52 @@
1
+ # APC AOS Configuration
2
+
3
+ Currently, the configuration of APC Network Management Cards can be downloaded with FTP only.
4
+
5
+ A download of the configuration with SCP is [work in progress](https://github.com/ytti/oxidized/issues/1802).
6
+ As the APC has an unusual behavior (the connection is closed without an exit-status), this has to be
7
+ [fixed](https://github.com/net-ssh/net-scp/pull/71) upstream in [Net::SCP](https://github.com/net-ssh/net-scp).
8
+ As soon as there is a release of Net::SCP supporting the behavior of APC OS, we will activate SCP in oxidized.
9
+
10
+ ## Can I collect more information than just the configuration?
11
+ APC OS does not have the ability to show the config.ini within an SSH-session. As oxidized can only get the
12
+ configuration with one input type at a time, it is not possible to fetch config.ini via FTP/SCP and get the output of
13
+ some commands via SSH at the same time.
14
+
15
+ A ticket has been opened with APC support in order to support "cat config.ini" within an SSH-session, but
16
+ the chances it will be supported at some time are not very good, and older versions will still not support it.
17
+
18
+ ## How do I activate FTP input?
19
+ In order to download the configuration with FTP (and in the future with SCP), you have to activate it as an
20
+ input in the oxidized configuration. If you do not activate the input, oxidized will fail for the node with
21
+ a rather unspecific error (`WARN -- : /apc status fail, retry attempt 1`).
22
+
23
+ The configuration can be done either globally or only for the model apc_aos.
24
+
25
+ The global configuration would look like this. Note that Oxidized will try every input type in the given order
26
+ until it succeeds, or it will report a failure.
27
+ ```yaml
28
+ input:
29
+ default: ssh, ftp, scp
30
+ ```
31
+
32
+ Configuration for activating the FTP input for apc_aos only:
33
+ ```yaml
34
+ input:
35
+ default: ssh
36
+ models:
37
+ apc_aos:
38
+ input: ftp
39
+ ```
40
+
41
+ You can also set specific username and password for apc_aos only:
42
+ ```yaml
43
+ username: default-user
44
+ password: default-password
45
+ input:
46
+ default: ssh
47
+ models:
48
+ apc_aos:
49
+ username: apc-user
50
+ password: apc-password
51
+ input: ftp
52
+ ```
@@ -0,0 +1,11 @@
1
+ # Fiberstore (fs.com) FSOS notes
2
+
3
+ This has been tested against the following models and OS versions
4
+
5
+ |Model |OS Version and Build |
6
+ |--------------------|------------------------------|
7
+ |S3400-48T4SP |Version 2.0.2J Build 81736 |
8
+ |S3400-48T4SP |Version 2.0.2J Build 95262 |
9
+ |S3400-48T6SP |Version 2.2.0F Build 109661 |
10
+
11
+ Back to [Model-Notes](README.md)
@@ -0,0 +1,28 @@
1
+ # FortiOS Configuration
2
+
3
+ Create user oxidized with ED25519 public key
4
+
5
+ ```text
6
+ config system admin
7
+ edit oxidized
8
+ set trusthost1 192.0.2.1 255.255.255.255
9
+ set accprofile "super_admin_readonly"
10
+ set ssh-public-key1 "ssh-ed25519 AAAAThisIsJustAnExmapleKey_UseYourOxidizedPUBLICKEY oxidized@librenms"
11
+ end
12
+ ```
13
+
14
+
15
+ Fortigate procdues a lot of config changes. I recommend filtering using
16
+
17
+ ```yaml
18
+ models:
19
+ fortios:
20
+ vars:
21
+ remove_secret: true
22
+ ```
23
+
24
+
25
+
26
+ Oxidized can now retrieve your configuration!
27
+
28
+ Back to [Model-Notes](README.md)
@@ -2,25 +2,6 @@
2
2
 
3
3
  This directory contains implementation notes and caveats to assist you in your oxidized deployment.
4
4
 
5
- Use the table below for more information on the Vendor/Model caveats.
6
-
7
- Vendor | Model |Updated
8
- ----------------|-----------------|----------------
9
- 3COM|[Comware](Comware.md)|15 Feb 2018
10
- AireOS|[AireOS](AireOS.md)|29 Nov 2017
11
- Arbor Networks|[ArbOS](ArbOS.md)|27 Feb 2018
12
- Arista|[EOS](EOS.md)|05 Feb 2018
13
- Cumulus|[Cumulus](Cumulus.md)|11 Jun 2018
14
- Huawei|[VRP](VRP-Huawei.md)|17 Nov 2017
15
- Huawei|[SmartAX series](SmartAX-Huawei.md)|21 Jan 2019
16
- Cisco IOS|[IOS](IOS.md)|29 Mar 2019
17
- Juniper|[MX/QFX/EX/SRX/J Series](JunOS.md)|18 Jan 2018
18
- Netgear|[Netgear](Netgear.md)|11 Apr 2018
19
- Nokia|[Nokia ISAM](Nokia.md)|22 Aug 2018
20
- Dell/EMC|[Dell EMC Networking OS10](OS10.md)|07 Dec 2021
21
- Viptela|[Viptela](Viptela.md)|1 Jul 2018
22
- Zyxel|[XGS4600 Series](XGS4600-Zyxel.md)|1 Feb 2018
23
- Linux|[LinuxGeneric](LinuxGeneric.md)|10 Jun 2019
24
- Lenovo|[Lenovo Network OS](LenovoNOS.md)|5 Apr 2022
5
+ The model notes are linked from the [list of supported OS types](/docs/Supported-OS-Types.md).
25
6
 
26
7
  If you discover additional caveats or problems please make sure to consult the [GitHub issues for oxidized](https://github.com/ytti/oxidized/issues) known issues.
@@ -5,6 +5,11 @@
5
5
  FTP access is only possible as admin, other users can login but cannot pull the files.
6
6
  For the XGS4600 series the config file is _config_ and not _config-0_
7
7
 
8
+ To enable FTP backup, uncomment the following line in _oxidized/lib/oxidized/model/zynos.rb_
9
+ ```text
10
+ # cmd 'config-0'
11
+ ```
12
+
8
13
  The following line in _oxidized/lib/oxidized/model/zynos.rb_ will need changing
9
14
 
10
15
  ```text
data/docs/Ruby-API.md CHANGED
@@ -6,7 +6,7 @@ The following objects exist in Oxidized.
6
6
 
7
7
  * gets config from nodes
8
8
  * must implement 'connect', 'get', 'cmd'
9
- * 'ssh', 'telnet', 'ftp', 'tftp', 'http' implemented
9
+ * 'ssh', 'telnet', 'ftp', 'tftp', 'scp', 'http' implemented
10
10
 
11
11
  ### http
12
12
 
data/docs/Sources.md CHANGED
@@ -187,3 +187,16 @@ source:
187
187
  scheme: https
188
188
  secure: false
189
189
  ```
190
+
191
+ HTTP source also supports pagination. Two settings must be enabled. (`pagination` as a bool and `pagination_key_name` as a string)
192
+ The `pagination_key_name` setting is the key name that an api returns to find the url of the next page.
193
+
194
+ **Disclaimer**: currently only tested with netbox as the source
195
+
196
+ ```yaml
197
+ source:
198
+ default: http
199
+ http:
200
+ pagination: true
201
+ pagination_key_name: 'next'
202
+ ```