<% content_for :title, "Add Network Range" %>

Add Network Range

Create a new network range for tracking and rule management

<%= form_with(model: @network_range, local: true, class: "space-y-6") do |form| %> <% if @network_range.errors.any? %>

There were <%= pluralize(@network_range.errors.count, "error") %> with your submission:

    <% @network_range.errors.full_messages.each do |message| %>
  • <%= message %>
  • <% end %>
<% end %>

Network Information

<%= form.label :network, "Network Range (CIDR)", class: "block text-sm font-medium text-gray-700" %> <%= form.text_field :network, class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm", placeholder: "e.g., 192.168.1.0/24 or 2001:db8::/32" %>

Enter the network range in CIDR notation. Supports both IPv4 and IPv6.

<%= form.label :source, "Source", class: "block text-sm font-medium text-gray-700" %> <%= form.select :source, options_for_select([ ["User Created", "user_created"], ["Manual Import", "manual"], ["API Imported", "api_imported"], ["Auto Generated", "auto_generated"] ], "user_created"), {}, { class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm" } %>
<%= form.label :creation_reason, "Creation Reason", class: "block text-sm font-medium text-gray-700" %> <%= form.text_area :creation_reason, rows: 3, class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm", placeholder: "Optional reason for creating this network range" %>

Network Intelligence

Optional intelligence data about this network range

<%= form.label :asn, "ASN", class: "block text-sm font-medium text-gray-700" %> <%= form.number_field :asn, class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm", placeholder: "e.g., 15169" %>
<%= form.label :asn_org, "ASN Organization", class: "block text-sm font-medium text-gray-700" %> <%= form.text_field :asn_org, class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm", placeholder: "e.g., Google LLC" %>
<%= form.label :company, "Company", class: "block text-sm font-medium text-gray-700" %> <%= form.text_field :company, class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm", placeholder: "e.g., Google LLC" %>
<%= form.label :country, "Country Code", class: "block text-sm font-medium text-gray-700" %> <%= form.text_field :country, class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm", placeholder: "e.g., US" %>
<%= form.check_box :is_datacenter, class: "h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500" %> <%= form.label :is_datacenter, "Datacenter Network", class: "text-sm font-medium text-gray-900" %>
<%= form.check_box :is_vpn, class: "h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500" %> <%= form.label :is_vpn, "VPN Network", class: "text-sm font-medium text-gray-900" %>
<%= form.check_box :is_proxy, class: "h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500" %> <%= form.label :is_proxy, "Proxy Network", class: "text-sm font-medium text-gray-900" %>
<%= form.label :abuser_scores, "Abuser Scores", class: "block text-sm font-medium text-gray-700" %> <%= form.text_area :abuser_scores, rows: 3, class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm", placeholder: '{ "score": "0.001", "source": "api" }' %>

JSON format with abuser scoring information

<%= form.label :additional_data, "Additional Data", class: "block text-sm font-medium text-gray-700" %> <%= form.text_area :additional_data, rows: 4, class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm", placeholder: '{ "custom_field": "value" }' %>

JSON format for any additional metadata

<%= link_to "Cancel", network_ranges_path, class: "inline-flex items-center px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50" %> <%= form.submit "Create Network Range", class: "inline-flex items-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700" %>
<% end %>