Skip to content

Commit

Permalink
Making changes recommended for PR, and testing them.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Minnix authored and Brandon Minnix committed Mar 20, 2024
1 parent 35e26a1 commit 53badb5
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 12 deletions.
12 changes: 12 additions & 0 deletions development_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,18 @@
"_dict": lib_mapper.NETUTILSPARSER_LIB_MAPPER_REVERSE,
"_file": "docs/user/lib_mapper/netutilsparser_reverse.md",
},
"nist": {
"header_src": "NIST",
"header_dst": "NORMALIZED",
"_dict": lib_mapper.NIST_LIB_MAPPER,
"_file": "docs/user/lib_mapper/nist.md",
},
"nist_reverse": {
"header_src": "NORMALIZED",
"header_dst": "NIST",
"_dict": lib_mapper.NIST_LIB_MAPPER_REVERSE,
"_file": "docs/user/lib_mapper/nist_reverse.md",
},
"ntctemplates": {
"header_src": "NTCTEMPLATES",
"header_dst": "NORMALIZED",
Expand Down
5 changes: 3 additions & 2 deletions docs/dev/code_reference/nist.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
show_submodules: True

**Notes:**
<br/>

In order to use the URLs generated by netutils.nist.get_nist_urls*, you will need an api key provided by NIST [here]('https://nvd.nist.gov/developers/request-an-api-key'). This key will need to be passed in as an additional header in your request in the form of `{"apiKey": "<key_value>"}` as stated by NIST in their [Getting Started]('https://nvd.nist.gov/developers/start-here') section.
<br/><br/>

This module currently only supports the following OS platforms:

- Arista EOS
- Cisco IOS
- Cisco IOS XR
Expand Down
8 changes: 8 additions & 0 deletions docs/user/lib_mapper/nist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
| NIST | | NORMALIZED |
| ---------- | -- | ------ |
| eos || arista_eos |
| ios || cisco_ios |
| ios_xe || cisco_xe |
| ios_xr || cisco_xr |
| junos || juniper_junos |
| nx-os || cisco_nxos |
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
| NIST_LIB_MAPPER_SUPPORTED | | NORMALIZED |
| ---------------- | -- | ----------- |
| cisco_nxos || nx-os |
| cisco_xr || ios_xr |
| cisco_xe || ios_xe |
| NORMALIZED | | NIST |
| ---------- | -- | ------ |
| arista_eos || eos |
| cisco_ios || ios |
| juniper_junos || junos |
| cisco_nxos || nx-os |
| cisco_xe || ios_xe |
| cisco_xr || ios_xr |
| juniper_junos || junos |
2 changes: 0 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,9 @@ nav:
- Library Helpers: "dev/code_reference/lib_helpers.md"
- Library Mapping: "dev/code_reference/lib_mapping.md"
- Mac Address: "dev/code_reference/mac.md"
- NIST: "dev/code_reference/nist.md"
- OS Version: "dev/code_reference/os_version.md"
- Password: "dev/code_reference/password.md"
- Ping: "dev/code_reference/ping.md"
- Platform Mapper: "dev/code_reference/platform_mapper.md"
- Protocol Mapper: "dev/code_reference/protocol_mapper.md"
- Regex: "dev/code_reference/regex.md"
- Route: "dev/code_reference/route.md"
Expand Down
14 changes: 12 additions & 2 deletions netutils/lib_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,16 @@
"SRX": "juniper_junos",
}

# NIST | Normalized
NIST_LIB_MAPPER = {
"nx-os": "cisco_nxos",
"ios_xr": "cisco_xr",
"ios_xe": "cisco_xe",
"eos": "arista_eos",
"ios": "cisco_ios",
"junos": "juniper_junos",
}

# Normalized | NAPALM
NAPALM_LIB_MAPPER_REVERSE = {
"arista_eos": "eos",
Expand Down Expand Up @@ -545,8 +555,8 @@
"paloalto_panos": "PAN_OS",
}

# Normalized | NIST Parser
NIST_LIB_MAPPER_SUPPORTED = {
# Normalized | NIST
NIST_LIB_MAPPER_REVERSE = {
"cisco_nxos": "nx-os",
"cisco_xr": "ios_xr",
"cisco_xe": "ios_xe",
Expand Down

0 comments on commit 53badb5

Please sign in to comment.