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

autocreation and assignment of NetBox subnets in Logstash #436

Closed
mmguero opened this issue Mar 7, 2024 · 2 comments
Closed

autocreation and assignment of NetBox subnets in Logstash #436

mmguero opened this issue Mar 7, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request logstash Relating to Malcolm's use of Logstash netbox Related to Malcolm's use of NetBox
Milestone

Comments

@mmguero
Copy link
Collaborator

mmguero commented Mar 7, 2024

The NETBOX_PRELOAD_PREFIXES environment variable right now causes Malcolm to create three catch-all prefixes in NetBox:

- prefix: 10.0.0.0/8
  description: 10.0.0.0/8
  site: NETBOX_DEFAULT_SITE
- prefix: 172.16.0.0/12
  description: 172.16.0.0/12
  site: NETBOX_DEFAULT_SITE
- prefix: 192.168.0.0/16
  description: 192.168.0.0/16
  site: NETBOX_DEFAULT_SITE

This is probably not that practically useful. Instead, what if we did something like this: similar to what we do with netbox device autopopulation (probably as another question/setting that's not dependent on the existing autopopulation setting) we also give them a "do you want to autocreate/autopopulate creation of RFC1918 subnets?" option. Essentially, it would do this:

The RFC1918 address space includes the following networks:

10.0.0.0 – 10.255.255.255  (10/8 prefix)
172.16.0.0 – 172.31.255.255  (172.16/12 prefix)
192.168.0.0 – 192.168.255.255 (192.168/16 prefix)

I'm thinking what we would do would autocreate subnets one level down from those top-level blocks. Ie.,

  • 10./16 (255.255.0.0)
    • the IP address 10.9.0.215 would cause us to create and assign it to a 10.9.0.0/16 subnet
  • 192.168./24 (255.255.255.0)
    • the IP address 192.168.100.123 would cause us to create and assign it to a 192.168.100.0/24 subnet
  • 172.16./20 (255.255.240.0)
    • the IP address 172.16.29.10 would cause us to create and assign it to a 172.16.29.10/20 subnet

FWIW I think this would replace the NETBOX_PRELOAD_PREFIXES code completely.

@mmguero mmguero added enhancement New feature or request logstash Relating to Malcolm's use of Logstash netbox Related to Malcolm's use of NetBox labels Mar 7, 2024
@mmguero mmguero added this to the v24.03.1 milestone Mar 7, 2024
@mmguero mmguero self-assigned this Mar 14, 2024
mmguero added a commit to mmguero-dev/Malcolm that referenced this issue Mar 14, 2024
…mon.env as it makes more sense for them to be there (beginning idaholab#436)
mmguero added a commit to mmguero-dev/Malcolm that referenced this issue Mar 14, 2024
mmguero added a commit to mmguero-dev/Malcolm that referenced this issue Mar 14, 2024
mmguero added a commit to mmguero-dev/Malcolm that referenced this issue Mar 15, 2024
mmguero added a commit to mmguero-dev/Malcolm that referenced this issue Mar 15, 2024
@mmguero
Copy link
Collaborator Author

mmguero commented Mar 18, 2024

Screenshots showing result of this work:

Image

Image

@mmguero
Copy link
Collaborator Author

mmguero commented Mar 18, 2024

This seems to be working well now.

@mmguero mmguero closed this as completed Mar 18, 2024
@mmguero mmguero added the CISA label Mar 18, 2024
This was referenced Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request logstash Relating to Malcolm's use of Logstash netbox Related to Malcolm's use of NetBox
Projects
Status: Released
Development

No branches or pull requests

1 participant