13 Commits
Author SHA1 Message Date
David Barroso ad1a10f08b Merge pull request #19 from napalm-automation/develop
Release 0.2.0
2016-10-25 11:11:07 +02:00
David Barroso 794b90638d Merge pull request #18 from napalm-automation/bump-version-0.2.0
bump version 0.2.0
2016-10-25 11:02:36 +02:00
David Barroso 2000a9388d bump version 0.2.0 2016-10-24 15:56:51 +02:00
Eric Beahan 3cab0dd9c4 Adding ISSUE_TEMPLATE, PULL_REQUEST_TEMPLATE, and CONTRIBUTING files (#17)
Thanks @ebeahan
2016-10-18 21:06:14 -05:00
David Barroso cd2d955ddb Merge pull request #16 from ktbyers/develop
Pin napalm-base
2016-10-15 15:51:39 +02:00
Kirk Byers 225b3256fc Pin napalm-base
Eliminate pylama.ini; replace with setup.cfg
Add requirements-dev.txt
Implement __version__ solution
2016-10-14 12:53:03 -07:00
Mircea Ulinic 9d805f8f3b Merge pull request #11 from ebeahan/fortios_implement_get_config
Thanks @ebeahan!
2016-09-25 18:54:25 +01:00
Eric Beahan 341e0342c6 Added get_config method 2016-09-24 22:36:54 -05:00
Elisa Jasinska 8f50abde62 Merge pull request #12 from fooelisa/develop
adding coveralls
2016-09-23 23:20:14 +02:00
Elisa Jasinska 224944dac7 adding coveralls 2016-09-19 00:16:54 +02:00
David Barroso db99faf523 Version bump 2016-03-21 11:02:48 +01:00
David Barroso 8133ba2af1 Merge pull request #1 from dbarrosop/master
Added driver to the basic module so it can be discovered
2016-03-21 11:00:44 +01:00
David Barroso 3f23beeea2 Added driver to the basic module so it can be discovered 2016-03-21 10:45:17 +01:00
13 changed files with 497 additions and 13 deletions

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
###Description of Issue/Question
### Did you follow the steps from https://github.com/napalm-automation/napalm#faq
- [ ] Yes
- [ ] No
### Setup
### napalm-fortios version
(Paste verbatim output from `pip freeze | grep napalm-fortios` between quotes below)
```
```
### FortiOS version
(Paste verbatim output from `get sys status` between quotes below)
```
```
### Steps to Reproduce the Issue
### Error Traceback
(Paste the complete traceback of the exception between quotes below)
```
```
+1
View File
@@ -0,0 +1 @@
<!-- Make sure you have read http://napalm.readthedocs.io/en/latest/contributing/index.html --!>
+9 -5
View File
@@ -4,6 +4,7 @@ python:
install:
- pip install -r requirements.txt
- pip install .
- pip install coveralls
deploy:
provider: pypi
user: dbarroso
@@ -14,9 +15,12 @@ deploy:
branch: master
script:
- cd test/unit
- nosetests -v TestFortiOSDriver:TestGetterFortiOSDriver.test_get_bgp_neighbors
- nosetests -v TestFortiOSDriver:TestGetterFortiOSDriver.test_get_environment
- nosetests -v TestFortiOSDriver:TestGetterFortiOSDriver.test_get_facts
- nosetests -v TestFortiOSDriver:TestGetterFortiOSDriver.test_get_interfaces
- nosetests -v TestFortiOSDriver:TestGetterFortiOSDriver.test_get_interfaces_counters
- nosetests --with-coverage --cover-package napalm_fortios -v TestFortiOSDriver:TestGetterFortiOSDriver.test_get_bgp_neighbors
- nosetests --with-coverage --cover-package napalm_fortios -v TestFortiOSDriver:TestGetterFortiOSDriver.test_get_environment
- nosetests --with-coverage --cover-package napalm_fortios -v TestFortiOSDriver:TestGetterFortiOSDriver.test_get_facts
- nosetests --with-coverage --cover-package napalm_fortios -v TestFortiOSDriver:TestGetterFortiOSDriver.test_get_interfaces
- nosetests --with-coverage --cover-package napalm_fortios -v TestFortiOSDriver:TestGetterFortiOSDriver.test_get_interfaces_counters
- nosetests --with-coverage --cover-package napalm_fortios -v TestFortiOSDriver:TestGetterFortiOSDriver.test_get_config
- cd ../..
- coverage combine test/unit/.coverage
after_success: coveralls
+1
View File
@@ -0,0 +1 @@
Please, read http://napalm.readthedocs.io/en/latest/contributing/index.html
+2
View File
@@ -1,5 +1,7 @@
[![PyPI](https://img.shields.io/pypi/v/napalm-fortios.svg)](https://pypi.python.org/pypi/napalm-fortios)
[![PyPI](https://img.shields.io/pypi/dm/napalm-fortios.svg)](https://pypi.python.org/pypi/napalm-fortios)
[![Build Status](https://travis-ci.org/napalm-automation/napalm-fortios.svg?branch=master)](https://travis-ci.org/napalm-automation/napalm-fortios)
[![Coverage Status](https://coveralls.io/repos/github/napalm-automation/napalm-fortios/badge.svg?branch=master)](https://coveralls.io/github/napalm-automation/napalm-fortios)
# napalm-fortios
+12
View File
@@ -13,3 +13,15 @@
# the License.
"""napalm_fortios package."""
# Import stdlib
import pkg_resources
# Import local modules
from napalm_fortios.fortios import FortiOSDriver
try:
__version__ = pkg_resources.get_distribution('napalm-fortios').version
except pkg_resources.DistributionNotFound:
__version__ = "Not installed"
__all__ = ('FortiOSDriver',)
+23
View File
@@ -138,6 +138,29 @@ class FortiOSDriver(NetworkDriver):
self.device.candidate_config['vpn certificate local']['Fortinet_SSLProxy'].del_param('certificate')
self.device.commit()
def get_config(self, retrieve="all"):
"""get_config implementation for FortiOS."""
get_startup = retrieve == "all" or retrieve == "startup"
get_running = retrieve == "all" or retrieve == "running"
get_candidate = retrieve == "all" or retrieve == "candidate"
if retrieve == "all" or get_running:
result = self.execute_command_with_vdom('show')
text_result = '\n'.join(result)
return {
'startup': "",
'running': text_result,
'candidate': "",
}
elif get_startup or get_candidate:
return {
'startup': "",
'running': "",
'candidate': "",
}
def get_facts(self):
system_status = self.get_command_with_vdom('get system status', vdom='global')
performance_status = self.get_command_with_vdom('get system performance status', vdom='global')
-6
View File
@@ -1,6 +0,0 @@
[pylama]
linters = mccabe,pep257,pep8,pyflakes
ignore = D203,
[pylama:pep8]
max_line_length = 120
+7
View File
@@ -0,0 +1,7 @@
pytest
pytest-cov
pytest-json
pytest-pythonpath
pylama
flake8-import-order
-r requirements.txt
+1 -1
View File
@@ -1,2 +1,2 @@
napalm_base
napalm-base==0.17.0
pyFG
+6
View File
@@ -0,0 +1,6 @@
[pylama]
linters = mccabe,pep8,pyflakes
ignore = D203,C901
[pylama:pep8]
max_line_length = 100
+1 -1
View File
@@ -12,7 +12,7 @@ reqs = [str(ir.req) for ir in install_reqs]
setup(
name="napalm-fortios",
version="0.1.0",
version="0.2.0",
packages=find_packages(),
author="David Barroso",
author_email="dbarrosop@dravetech.com",
+402
View File
@@ -0,0 +1,402 @@
#config-version=FWF60D-5.00-FW-build271-140124:opmode=1:vdom=0:user=admin
#conf_file_ver=9284291339995375843
#buildno=0271
#global_vdom=1
config system global
set admintimeout 15
set fgd-alert-subscription advisory latest-threat
set gui-certificates enable
set gui-dynamic-routing enable
set gui-ipv6 enable
set gui-local-in-policy enable
set gui-nat46-64 enable
set gui-policy-based-ipsec enable
set hostname "FORTINET"
set service-expire-notification disable
set timezone 08
end
config system accprofile
edit "prof_admin"
set admingrp read-write
set authgrp read-write
set endpoint-control-grp read-write
set fwgrp read-write
set loggrp read-write
set mntgrp read-write
set netgrp read-write
set routegrp read-write
set sysgrp read-write
set updategrp read-write
set utmgrp read-write
set vpngrp read-write
set wanoptgrp read-write
set wifi read-write
next
end
config system interface
edit "dmz"
set vdom "root"
set ip 10.10.10.1 255.255.255.0
set allowaccess ping https fgfm capwap
set type physical
set snmp-index 5
next
edit "wan1"
set vdom "root"
set mode dhcp
set allowaccess ping https ssh snmp
set type physical
set snmp-index 3
config ipv6
set ip6-allowaccess ping https ssh
end
set defaultgw enable
next
edit "wan2"
set vdom "root"
set ip 192.168.101.99 255.255.255.0
set allowaccess ping fgfm auto-ipsec
set type physical
set snmp-index 4
next
edit "modem"
set vdom "root"
set mode pppoe
set type physical
set snmp-index 6
set defaultgw enable
next
edit "ssl.root"
set vdom "root"
set type tunnel
set alias "sslvpn tunnel interface"
set snmp-index 7
next
edit "mesh.root"
set vdom "root"
set type vap-switch
set snmp-index 9
next
edit "internal"
set vdom "root"
set ip 10.10.90.1 255.255.255.0
set allowaccess ping https ssh snmp http fgfm capwap
set status down
set type physical
set snmp-index 2
next
edit "wifi"
set vdom "root"
set ip 10.10.80.1 255.255.255.0
set allowaccess ping https ssh fgfm
set status down
set type vap-switch
set snmp-index 1
next
end
config system admin
edit "admin"
set accprofile "super_admin"
set vdom "root"
config dashboard-tabs
edit 1
set name "Status"
next
edit 2
set columns 1
set name "Top Sources"
next
edit 3
set columns 1
set name "Top Destinations"
next
edit 4
set columns 1
set name "Top Applications"
next
end
config dashboard
edit 1
set tab-id 1
set column 1
next
edit 2
set widget-type licinfo
set tab-id 1
set column 1
next
edit 3
set widget-type jsconsole
set tab-id 1
set column 1
next
edit 4
set widget-type sysres
set tab-id 1
set column 2
next
edit 5
set widget-type gui-features
set tab-id 1
set column 2
next
edit 6
set widget-type alert
set tab-id 1
set column 2
set top-n 10
next
edit 21
set widget-type sessions
set tab-id 2
set column 1
set top-n 25
set sort-by msg-counts
next
edit 31
set widget-type sessions
set tab-id 3
set column 1
set top-n 25
set sort-by msg-counts
set report-by destination
next
edit 41
set widget-type sessions
set tab-id 4
set column 1
set top-n 25
set sort-by msg-counts
set report-by application
next
end
config login-time
edit "admin"
set last-login 2014-03-05 20:18:42
next
end
set password ENC AK1mbPadQmYqP8Q4f7ClXXWGrgEMVWbGGwf6IgRwHQduoc=
next
end
config system ha
set override disable
end
config system storage
edit "FLASH1"
set media-type "scsi"
set partition "4E6CD8C90723C14B"
next
end
config system replacemsg-image
edit "logo_fnet"
set image-base64 ''
set image-type gif
next
edit "logo_fguard_wf"
set image-base64 ''
set image-type gif
next
edit "logo_fw_auth"
set image-base64 ''
set image-type png
next
edit "logo_v2_fnet"
set image-base64 ''
set image-type png
next
edit "logo_v2_fguard_wf"
set image-base64 ''
set image-type png
next
end
config system snmp sysinfo
set status enable
end
config vpn certificate ca
end
config vpn certificate local
end
config wanopt storage
edit "FLASH1"
set size 4563
next
end
config system session-sync
end
config ips global
set default-app-cat-mask 18446744073474670591
end
config ips dbinfo
set version 1
end
config gui console
unset preferences
end
config system auto-install
set auto-install-config enable
set auto-install-image enable
end
config system console
set output standard
end
config system ntp
set ntpsync enable
set syncinterval 60
end
config system settings
set sip-tcp-port 5060
set sip-udp-port 5060
end
config firewall service group
edit "Email Access"
set member "DNS" "IMAP" "IMAPS" "POP3" "POP3S" "SMTP" "SMTPS"
next
edit "Web Access"
set member "DNS" "HTTP" "HTTPS"
next
edit "Windows AD"
set member "DCE-RPC" "DNS" "KERBEROS" "LDAP" "LDAP_UDP" "SAMBA" "SMB"
next
edit "Exchange Server"
set member "DCE-RPC" "DNS" "HTTPS"
next
end
config webfilter ftgd-local-cat
edit "custom1"
set id 140
next
edit "custom2"
set id 141
next
end
config user fortitoken
edit "FTKMOB4302463E0E"
set license "FTMTRIAL00138836"
next
edit "FTKMOB433B7004CF"
set license "FTMTRIAL00138836"
next
end
config user local
edit "guest"
set type password
set passwd ENC SWv0LitZXJWqXLGveoEXgcboipAFM2wg7Np0oxyQpRubIce9royFr2/bxJ2nzvoPR0CN3p1/2+VWuPJlLTDGuYX0ojfBAbWkgLXI2AxwB3jpUp7PMWMyyfn4aT2Y35HnSP5mP87q2d1lMYJkBttbceEmZsDgkmeRyLPDNdtSCFvZ7pKm0gNDILk7sLPyJT7k5ZXxtw==
next
end
config user group
edit "FSSO_Guest_Users"
set group-type fsso-service
next
edit "Guest-group"
set member "guest"
next
end
config spamfilter profile
edit "default"
set comment "malware and phishing URL filtering"
next
end
config wanopt settings
set host-id "default-id"
end
config wanopt profile
edit "default"
set comments "default WANopt profile"
next
end
config web-proxy global
set proxy-fqdn "default.fqdn"
end
config firewall schedule recurring
edit "always"
set day sunday monday tuesday wednesday thursday friday saturday
next
end
config firewall profile-protocol-options
edit "default"
set comment "all default services"
config http
set ports 80
set options clientcomfort no-content-summary
unset post-lang
end
config ftp
set ports 21
set options clientcomfort no-content-summary splice
end
config imap
set ports 143
set options fragmail no-content-summary
end
config mapi
set ports 135
set options fragmail no-content-summary
end
config pop3
set ports 110
set options fragmail no-content-summary
end
config smtp
set ports 25
set options fragmail no-content-summary splice
end
config nntp
set ports 119
set options no-content-summary splice
end
config im
unset options
end
config dns
set ports 53
end
next
end
config firewall deep-inspection-options
edit "default"
set comment "all default services"
config https
set ports 443
end
config ftps
set ports 990
end
config imaps
set ports 993
end
config pop3s
set ports 995
end
config smtps
set ports 465
end
next
end
config firewall identity-based-route
end
config firewall policy
edit 5
set srcintf "internal"
set dstintf "wifi"
set srcaddr "all"
set dstaddr "all"
set action accept
set schedule "always"
set service "ALL"
next
end
config wireless-controller wtp
edit "FWF60D-WIFI0"
next
end
config log disk setting
set status enable
set storage "FLASH1"
end
config log eventfilter
set user disable
set wan-opt disable
end
config log setting
set gui-location disk
end