Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jquery update #418

Open
wants to merge 41 commits into
base: public
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
ab3eba4
Update properties.json
SaneiSaya Jan 10, 2024
c288417
Update README.md with Docker instructions
SaneiSaya Jan 11, 2024
3364dca
Update README.md
SaneiSaya Jan 11, 2024
e76f864
Update README.md
SaneiSaya Jan 11, 2024
6f2a124
Create Dockerfile
SaneiSaya Jan 11, 2024
5c98314
Create docker-compose.yml
SaneiSaya Jan 11, 2024
c09334d
Update requirements.txt for docker
SaneiSaya Jan 11, 2024
cf9a657
Merge pull request #1 from eNMS-automation/public
SaneiSaya Jan 11, 2024
eff129f
Update requirements.txt
SaneiSaya Jan 26, 2024
4bd3fed
Merge pull request #2 from eNMS-automation/public
SaneiSaya Jan 31, 2024
b336b9b
Update docker-compose.yml with scheduler variables
SaneiSaya Jan 31, 2024
db27d78
Updated version to 4.7.1
SaneiSaya Feb 3, 2024
9948a51
Update docker-compose.yml
SaneiSaya Feb 7, 2024
66abc47
Update settings.json
SaneiSaya Feb 9, 2024
63f6f3b
Update settings.json
SaneiSaya Feb 10, 2024
c641db2
Update README.md
SaneiSaya Feb 26, 2024
bc52e5b
Update README.md
SaneiSaya Feb 26, 2024
2253e9d
ldap
Mar 1, 2024
d56fbdf
ldap vars
ghering90 Mar 1, 2024
41fe322
ldap added @
ghering90 Mar 1, 2024
20d9f23
Merge pull request #4 from ghering90/public
SaneiSaya Mar 4, 2024
eb3d188
ldap bug fix
Mar 6, 2024
d2f34d7
Merge branch 'SaneiSaya:public' into public
ghering90 Mar 6, 2024
b39d3fc
Merge pull request #5 from ghering90/public
SaneiSaya Mar 6, 2024
36377f0
libreNMS device pull bug fix
Mar 6, 2024
2113633
Merge branch 'public' of https://github.com/ghering90/docker-eNMS-yup…
Mar 6, 2024
daf0cc8
Merge branch 'SaneiSaya:public' into public
ghering90 Mar 6, 2024
f8eeaa2
Merge pull request #6 from ghering90/public
SaneiSaya Mar 6, 2024
6b4354f
Changed from traefik to nginx
SaneiSaya Mar 27, 2024
9eb6a36
Merge branch 'public' into dev
SaneiSaya Mar 27, 2024
e948643
Merge branch 'eNMS-automation:public' into dev
SaneiSaya Mar 27, 2024
8b6b609
Create dependabot.yml
SaneiSaya Sep 12, 2024
3f79442
Merge pull request #10 from SaneiSaya/SaneiSaya-patch-1
SaneiSaya Sep 12, 2024
0decc12
Setup dependabot scan
SaneiSaya Sep 12, 2024
2c278fe
Merge branch 'dev' into public
SaneiSaya Sep 12, 2024
7453172
Delete dependabot.yml
SaneiSaya Sep 12, 2024
5f042f5
Delete .github/docker-compose.yml
SaneiSaya Sep 12, 2024
49bc1b9
Create SECURITY.md
SaneiSaya Sep 12, 2024
e3a9700
JQuery updates
SaneiSaya Sep 17, 2024
86c7e87
Update for jquery bootstrap
SaneiSaya Sep 17, 2024
f1d5406
Merge branch 'public' into jquery-update
SaneiSaya Sep 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/dependabot.yml.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:
- package-ecosystem: "npm" # Use "yarn" if you're using Yarn instead of npm.
directory: "/" # Location of the `package.json` file, adjust this if it's in a subdirectory.
schedule:
interval: "daily" # Checks for updates daily, you can set it to weekly or monthly.
commit-message:
prefix: "deps"
open-pull-requests-limit: 10 # Limit the number of open PRs Dependabot will create.
44 changes: 44 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Set the base image
FROM python:3.9

# Set environment variables
ENV UNSEAL_VAULT_KEY1=key1
ENV UNSEAL_VAULT_KEY2=key2
# Add more environment variables if needed...

# Install required packages
RUN apt-get update && apt-get install -y git supervisor wget

# Create and set work directory
WORKDIR /eNMS

# Clone the eNMS repository
#RUN git clone https://github.com/eNMS-automation/eNMS.git .

# Copy the local directory content into the container
COPY . /eNMS

# Change to the eNMS directory and install Python requirements
WORKDIR /eNMS
RUN pip install -r build/requirements/requirements.txt

# Download the latest release of eNMS
#RUN wget https://github.com/afourmy/eNMS/archive/refs/tags/v4.7.tar.gz && \
# tar --strip-components=1 -xzf v4.2.tar.gz -C /eNMS && \
# rm v4.7.tar.gz

# Install gunicorn
RUN pip install gunicorn

# Install correct version of Flask_WTF
RUN pip3 install flask_wtf==v1.0.1

# Install correct version of werkzueg
RUN pip install werkzeug===2.2.2

# Add a command to list the contents of /eNMS
#RUN ls -l /eNMS

# Set the command to run when the container starts
WORKDIR /eNMS
CMD ["gunicorn", "-c", "gunicorn.py", "eNMS.server:server"]
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<h1 align="center">eNMS</h1>
<h2 align="center">An enterprise-grade vendor-agnostic network automation platform.</h2>

## If you are looking for Docker Intructions go here [https://github.com/SaneiSaya/docker-eNMS/wiki](https://github.com/SaneiSaya/docker-eNMS/wiki)


# Introduction

eNMS is a vendor-agnostic NMS designed for building workflow-based network automation solutions.
Expand Down Expand Up @@ -114,3 +117,7 @@ You can follow us on _[Twitter](https://twitter.com/AutomationEnms)_ or _[Linked
export FLASK_APP=app.py
flask run --host=0.0.0.0
Log in (default credentials: admin / admin)

## Docker Install
Installation instructions are in the wiki on this repo
[https://github.com/SaneiSaya/docker-eNMS/wiki](https://github.com/SaneiSaya/docker-eNMS/wiki)
21 changes: 21 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Security Policy

## Supported Versions

Use this section to tell people about which versions of your project are
currently being supported with security updates.

| Version | Supported |
| ------- | ------------------ |
| 5.1.x | :white_check_mark: |
| 5.0.x | :x: |
| 4.0.x | :white_check_mark: |
| < 4.0 | :x: |

## Reporting a Vulnerability

Use this section to tell people how to report a vulnerability.

Tell them where to go, how often they can expect to get an update on a
reported vulnerability, what to expect if the vulnerability is accepted or
declined, etc.
16 changes: 13 additions & 3 deletions build/requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,27 @@ flask-socketio
flask_wtf
gitpython
gunicorn
itsdangerous
itsdangerous==2.0.1
napalm
ncclient
netmiko
passlib
psutil
redis
ruamel.yaml==0.17.21
sqlalchemy
sqlalchemy==2.0.25
watchdog
wtforms
wtforms==2.3.3
xlrd
xlwt
xmltodict
ansible
hvac
ldap3
pynetbox
scrapli
scrapli-netconf
slack_sdk
ssh2-python
tacacs_plus
ttp
92 changes: 92 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
version: '3.8'
services:
services:
enms:
build:
context: .
dockerfile: Dockerfile
container_name: enms
# image: saneisaya/docker-enms:latest
restart: always
environment:
- GITHUB_API_TOKEN=${GITHUB_API_TOKEN}
- GIT_USER_NAME=${GIT_USER_NAME}
- GIT_USER_EMAIL=${GIT_USER_EMAIL}
- SCHEDULER_ADDR=http://enms-scheduler:8000
# - VAULT_ADDRESS=${VAULT_ADDRESS}
# - VAULT_TOKEN=${VAULT_TOKEN}
# - UNSEAL_VAULT_KEY1=${UNSEAL_VAULT_KEY1}
# - UNSEAL_VAULT_KEY2=${UNSEAL_VAULT_KEY2}
volumes:
- /data/docker/projects:/root/projects
- /opt/docker/docker-enms/eNMS:/eNMS
networks:
- nginx_proxy
depends_on:
- db
db:
image: mariadb:10.5
restart: always
environment:
- MYSQL_ROOT_PASSWORD=root_password
- MYSQL_DATABASE=enms
- MYSQL_USER=enms
- MYSQL_PASSWORD=enms_password
volumes:
- /data/docker/db_data:/var/lib/mysql

vault-server:
image: hashicorp/vault:latest
container_name: vault-server
ports:
- "8200:8200"
restart: always
volumes:
- /opt/docker/vault/logs:/vault/logs
- /opt/docker/vault/file:/vault/file
- /opt/docker/vault/config:/vault/config
cap_add:
- IPC_LOCK
entrypoint: vault server -config=/vault/config/vault.json
networks:
- nginx_proxy

enms-scheduler:
build:
context: .
dockerfile: Dockerfile
container_name: enms-scheduler
restart: always
ports:
- "8000:8000"
environment:
- ENMS_ADDR=http://enms:5000
- ENMS_PASSWORD=admin
- ENMS_USER=admin
- VERIFY_CERTIFICATE=0
- REDIS_ADDR=enms
- SCHEDULER_ADDR=http://enms-scheduler:8000
- GUNICORN_ACCESS_LOG=/home/centos/enms/logs/access_scheduler.log
- GUNICORN_LOG_LEVEL=info
- DATABASE_URL=mysql://root:PASSWORD@localhost/enms?charset=utf8
volumes:
- /data/docker/projects/enms/enms-scheduler:/root/projects
- /opt/docker/docker-enms/eNMS-Scheduler/eNMS:/eNMS
- /opt/docker/docker-enms/eNMS-Scheduler/eNMS/scheduler:/scheduler
- ./logs:/home/centos/enms/logs
networks:
- nginx_proxy
depends_on:
- mysqld
# eNMS-Scheduler mysqld
mysqld:
image: mysql:latest
restart: always
environment:
- MYSQL_ROOT_PASSWORD=PASSWORD
- MYSQL_DATABASE=enms
volumes:
- /data/docker/mysql_data_schedulers:/var/lib/mysql
networks:
nginx_proxy:
external: true
23 changes: 18 additions & 5 deletions eNMS/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from warnings import warn

try:
from ldap3 import Connection
from ldap3 import Server, Connection, ALL
except ImportError as exc:
warn(f"Couldn't import ldap3 module({exc})")

Expand All @@ -12,13 +12,26 @@


class CustomApp:
def ldap_authentication(self, user, name, password):
def ldap_authentication(self, user_dn, name, password):
if not hasattr(env, "ldap_server"):
env.log("error", "LDAP authentication failed: no server configured")
return False
user = f"uid={name},dc=example,dc=com"
success = Connection(env.ldap_server, user=user, password=password).bind()
return {"name": name, "is_admin": True} if success else False
try:
conn = Connection(env.ldap_server, user=f"{env.ldap_binduser}@{env.ldap_userdn}", password=env.ldap_bindpassword, auto_bind=True)
conn.search(env.ldap_basedn, '(sAMAccountName={})'.format(name))
if len(conn.entries) == 1:
user_dn = conn.entries[0].entry_dn
conn = Connection(env.ldap_server, user=user_dn, password=password, auto_bind=True)
if conn.bind():
print('worked')
return {"name": name, "is_admin": True} if conn else False
else:
return False
else:
return False
except Exception as e:
print("Error:", e)
return False

def tacacs_authentication(self, user, name, password):
if not hasattr(env, "tacacs_client"):
Expand Down
4 changes: 4 additions & 0 deletions eNMS/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ def init_authentication(self):
try:
if ldap_address:
self.ldap_server = Server(getenv("LDAP_ADDR"))
self.ldap_binduser = getenv("LDAP_BINDUSER")
self.ldap_userdn = getenv("LDAP_USERDN")
self.ldap_bindpassword = getenv("LDAP_BINDPASSWORD")
self.ldap_basedn = getenv("LDAP_BASEDN")
if tacacs_address:
self.tacacs_client = TACACSClient(
getenv("TACACS_ADDR"), 49, getenv("TACACS_PASSWORD")
Expand Down
1 change: 1 addition & 0 deletions eNMS/models/services/miscellaneous/topology_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def query_librenms(self):
devices = http_get(
f"{self.librenms_address}/api/v0/devices",
headers={"X-Auth-Token": env.get_password(self.librenms_token)},
verify=False,
).json()["devices"]
for device in devices:
db.factory(
Expand Down
2 changes: 1 addition & 1 deletion eNMS/static/js/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -1396,7 +1396,7 @@ $(document).ready(function() {
createNotificationBanner();
});

$(window).load(function() {
$(window).on('load',(function() {
NProgress.done();
});

Expand Down
6 changes: 3 additions & 3 deletions eNMS/static/lib/bootstrap-select/bootstrap-select.min.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions eNMS/static/lib/bootstrap-select/bootstrap-select.min.js

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions eNMS/static/lib/jquery/jquery.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions setup/properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -1490,15 +1490,15 @@
"property_list": {
"device": {
"model": {
"choices": [["Arista", "Arista"], ["Cisco", "Cisco"], ["Linux", "Linux"], ["Juniper", "Juniper"]],
"choices": [["Arista", "Arista"], ["Cisco", "Cisco"], ["Fortigate", "Fortigate"], ["Linux", "Linux"], ["Juniper", "Juniper"], ["Vyatta", "Vyatta"]],
"validate_choice": false
},
"operating_system": {
"choices": [["IOS", "IOS"], ["IOS-XE", "IOS-XE"], ["IOS-XR", "IOS-XR"], ["Junos", "Junos"], ["EOS", "EOS"], ["Linux", "Linux"]],
"choices": [["FortiOS", "FortiOS"], ["IOS", "IOS"], ["IOS-XE", "IOS-XE"], ["IOS-XR", "IOS-XR"], ["Junos", "Junos"], ["EOS", "EOS"], ["Linux", "Linux"], ["Vyos", "Vyos"]],
"validate_choice": false
},
"vendor": {
"choices": [["Arista", "Arista"], ["Cisco", "Cisco"], ["Juniper", "Juniper"], ["Linux", "Linux"]],
"choices": [["Arista", "Arista"], ["Cisco", "Cisco"], ["Fortinet", "Fortinet"], ["Juniper", "Juniper"], ["Linux", "Linux"], ["Ciena", "Ciena"]],
"validate_choice": false
}
},
Expand Down