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

Private IPs Get Added With New Stakeholder Imports! #61

Open
climber-girl opened this issue May 4, 2021 · 1 comment
Open

Private IPs Get Added With New Stakeholder Imports! #61

climber-girl opened this issue May 4, 2021 · 1 comment
Labels
bug This issue or pull request addresses broken functionality

Comments

@climber-girl
Copy link

🐛 Summary

While adding some new stakeholders (if one overlooks that the request has IPs in the text template which gets changed to JSON and imported to the DB), we found that private IPs are allowed to be added. It doesn't even require the --force option to complete, but it does causes a float error when initiating/syncing.

Error when attempting to initialize scope that contains private/reserved IPs:
float() argument must be a string or a number (None, None)

Error when attempting to sync scope that contains private/reserved IPs:

Traceback (most recent call last):
  File "/usr/local/bin/cyhy-tool", line 271, in <module>
    main()
  File "/usr/local/bin/cyhy-tool", line 234, in main
    status(db, args["OWNER"], args["--sync"])
  File "/usr/local/bin/cyhy-tool", line 147, in status
    sync_tallies(db, owner)
  File "/usr/local/bin/cyhy-tool", line 117, in sync_tallies
    if SCAN_TYPE.CYHY not in db.RequestDoc.get_by_owner(owner_id)["scan_types"]:
TypeError: 'NoneType' object has no attribute '__getitem__'

We've found that in order to resolve this improper add, you can remove all IPs from their scope and add back only the public IPs, both with the $ cyhy-ip command (removing just the private ranges probably would also be sufficient though) and finish setting them up after. Feel free to reference my solution walkthrough in CYHYOPS-7760 if needed!

To reproduce

You can see this as early as CYHYOPS-4884 and as recently as CYHYOPS-7760. CYHYOPS-6190 is a good show of the error output.

Expected behavior

When private or reserved IPs are included in a JSON that is getting imported to the DB, it should error out similarly to when IPs are already assigned to existing stakeholders.

Any helpful log output or screenshots

See comments in above listed Jira tickets or output in above "Summary" section.

@mcdonnnj mcdonnnj added the bug This issue or pull request addresses broken functionality label May 6, 2021
@KeithBonesJr
Copy link

@jeffkause have a look at this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue or pull request addresses broken functionality
Projects
None yet
Development

No branches or pull requests

3 participants