cisagov / cyhy-core

Core code for Cyber Hygiene (CyHy)
Other
7 stars 9 forks source link

Update `check_restricted_ip()` error-handling code #93

Closed jeffkause closed 5 months ago

jeffkause commented 5 months ago

🗣 Description

This PR fixes a bug in the error handling code of the check_restricted_ip() function.

💭 Motivation and context

This bug prevents us from being able to add IPs that don't exist in our geoIP DB.

Resolves #92.

🧪 Testing

I tested the changes to geoloc.py in my development environment by:

  1. Running the cyhy-ip command below against IP addresses that don't exist in the geoIP DB
  2. Comparing the results against past results; verifying the correct results
  3. Running the cyhy-ip command below against other IP addresses and CIDRs to assure the results provided the expected results

Expected results verified:

cyhy-ip add TEST_ENTITY <IP address>
IPs added to request, and initialized.  Tally sync required to start scan of new IPs.▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶| ETA:  0:00:00

✅ Pre-approval checklist

✅ Post-merge checklist