Make cyhy-ip aware of default CyHy owner#129
Merged
Conversation
- get_default_owner_ip_set - get_default_owner_intersections
…efault CyHy owner Also: * Print an error message if attempting to add addresses to the default owner * Print a warning when adding addresses owned by the default owner to another owner * Clarify wording of final output message
Contributor
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jsf9k
reviewed
Nov 18, 2025
Member
jsf9k
left a comment
There was a problem hiding this comment.
This all looks fine, except that I don't understand exactly what kind of dictionary is being returned by get_default_owner_intersections().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🗣 Description
This PR makes changes to various
cyhy-ipfunctions in order to make them work as intended (or not work, in certain cases - see below) when interacting with the default CyHy owner (CYHY). Specifically:cyhy-ip add:last_changetimestamp) and displays a warning message that this is happeningcyhy-ip check: Checks for addresses owned by the default ownercyhy-ip list: Lists addresses owned by the default ownercyhy-ip list-all: Lists addresses owned by the default ownercyhy-ip remove: Prints an error message if attempting to remove addresses owned by the default ownercyhy-ip compare: Supports comparison with addresses owned by the default ownercyhy-ip move: Prints an error message if attempting to move addresses to or from the default ownercyhy-ip setstage: Supports setting the scan stage for addresses owned by the default owner💭 Motivation and context
Some of these changes were specifically requested by the CyHy Ops team. The other changes were made so that
cyhy-ipoperates in a sane and consistent way with respect to the default CyHy owner.Resolves #127.
🧪 Testing
The following items were validated:
cyhy-ip add <OWNER> <ADDRESSES>for aCYHY-owned IP displays a warning message that the IP is owned byCYHYcyhy-ip add <OWNER> <ADDRESSES>for aCYHY-owned IP modifies the owner of the existing HostDoc without changing any other info from the HostDoc (aside from thelast_changetimestamp)cyhy-ip add <OWNER> <ADDRESSES>for a non-CYHY-owned IP operates the same as it does nowcyhy-ip add CYHY <ADDRESSES>displays an error message that addresses cannot be manually added to theCYHYownercyhy-ip check <ADDRESSES>forCYHY-owned addresses correctly displays ownership or lack thereof byCYHYcyhy-ip compare CYHY <ADDRESSES>correctly compares the addresses to those owned byCYHYcyhy-ip list CYHYdisplays IPs owned byCYHYcyhy-ip list-alldisplays IPs owned byCYHY(as well as all other entities)cyhy-ip movedisplays an error message when attempting to move IPs to or from the defaultCYHYownercyhy-ip remove CYHY <ADDRESSES>displays an error message that IPs owned byCYHYcannot be manually removedcyhy-ip setstage <STAGE> <ADDRESSES>correctly sets the scan stage for IPs owned byCYHY✅ Pre-approval checklist
bump_versionscript if this repository is versioned and the changes in this PR warrant a version bump.✅ Pre-merge checklist
✅ Post-merge checklist