Skip to content

Add cyhy-domainsync option to skip "owned" resolved IPs#128

Merged
dav3r merged 4 commits intodevelopfrom
improvement/add-no-owned-to-cyhy-domainsync
Nov 17, 2025
Merged

Add cyhy-domainsync option to skip "owned" resolved IPs#128
dav3r merged 4 commits intodevelopfrom
improvement/add-no-owned-to-cyhy-domainsync

Conversation

@dav3r
Copy link
Member

@dav3r dav3r commented Nov 14, 2025

🗣 Description

This PR adds a --no-owned option to cyhy-domainsync that (when enabled) does not assign a hostname to an existing HostDoc if the HostDoc is already owned by an existing CyHy entity (other than the default CYHY entity).

💭 Motivation and context

A similar change was made to cyhy-domain in #122, but it's possible for this situation (adding a hostname to an IP that's owned by an existing non-default CyHy entity) to occur when cyhy-domainsync runs, so we want to update cyhy-domainsync to be able to prevent this from happening, if so desired.

Resolves #126.

🧪 Testing

I tested in a dev environment and confirmed the following:

  • When --no-owned option is set, a hostname that resolves to an IP address that is "owned" in CyHy by a non-CYHY entity is not added to the HostDoc for that IP (different from current behavior).
  • When --no-owned option is set, a hostname that resolves to an IP address that is "owned" in CyHy by the default CYHY entity is added to the HostDoc for that IP (no change from current behavior).
  • When --no-owned option is not set, a hostname that resolves to an IP address that is "owned" in CyHy by a non-CYHY entity is added to the HostDoc for that IP (no change from current behavior).
  • When --no-owned option is not set, a hostname that resolves to an IP address that is "owned" in CyHy by the default CYHY entity is added to the HostDoc for that IP (no change from current behavior).
  • When --no-owned option is not set, a hostname that resolves to an IP address that is not "owned" in CyHy by anyone is added to a newly-created HostDoc (owned by the default CYHY entity) for that IP (no change from current behavior).
  • When --no-owned option is set, a hostname that resolves to an IP address that is not "owned" in CyHy by anyone is added to a newly-created HostDoc (owned by the default CYHY entity) for that IP (no change from current behavior).

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All relevant repo and/or project documentation has been updated to reflect the changes in this PR.
  • All new and existing tests pass.
  • Bump major, minor, patch, pre-release, and/or build versions as appropriate via the bump_version script if this repository is versioned and the changes in this PR warrant a version bump.

✅ Pre-merge checklist

  • Finalize version.

✅ Post-merge checklist

  • Create a release (necessary if and only if the version was bumped).
  • Deploy this change to Production and manually enable the --no-owned flag (confirm with CyHy Ops team first)

Skips resolved IP addresses that are owned by a CyHy entity other than the default owner.

See #126 for more info.
@dav3r dav3r requested a review from Copilot November 14, 2025 21:05
@dav3r dav3r self-assigned this Nov 14, 2025
@dav3r dav3r added improvement This issue or pull request will add or improve functionality, maintainability, or ease of use version bump This issue or pull request increments the version number labels Nov 14, 2025
@dav3r dav3r added the python Pull requests that update Python code label Nov 14, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@dav3r dav3r moved this to In Progress in CyHy System Nov 17, 2025
@dav3r dav3r marked this pull request as ready for review November 17, 2025 15:46
@dav3r dav3r requested review from jsf9k and mcdonnnj as code owners November 17, 2025 15:46
@dav3r dav3r removed the status in CyHy System Nov 17, 2025
Copy link
Member

@jsf9k jsf9k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment for your evaluation.

@dav3r dav3r moved this to In Progress in CyHy System Nov 17, 2025
Copy link
Member

@jsf9k jsf9k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval intensifies!!!

@dav3r dav3r merged commit f966377 into develop Nov 17, 2025
10 checks passed
@dav3r dav3r deleted the improvement/add-no-owned-to-cyhy-domainsync branch November 17, 2025 18:37
@github-project-automation github-project-automation bot moved this from In Progress to Done in CyHy System Nov 17, 2025
dav3r added a commit to cisagov/ansible-role-cyhy-commander that referenced this pull request Nov 17, 2025
The --no-owned flag skips resolved IP addresses that are owned by a CyHy entity other than the default owner.

See cisagov/cyhy-core#128 for more info.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement This issue or pull request will add or improve functionality, maintainability, or ease of use python Pull requests that update Python code version bump This issue or pull request increments the version number

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add --no-owned option to cyhy-domainsync

3 participants