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

feat: add MAC address obfuscation in cleaner #4373

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xiangce
Copy link
Contributor

@xiangce xiangce commented Mar 5, 2025

  • Add MAC addr obfuscation, and generate relevant reports. One MAC address, no matter lowercase or uppercase will be treat as one same address, has the same obfuscated result.

  • MAC obfuscation will be enabled individually by setting "obfuscate_mac=True" in insights-client.conf. And can be disabled for particular specs by adding "no_obfuscate=['mac']" in spec RegistryPoint

  • RHINENG-14805

All Pull Requests:

Check all that apply:

  • Have you followed the guidelines in our Contributing document, including the instructions about commit messages?
  • No Sensitive Data in this change?
  • Is this PR to correct an issue?
  • Is this PR an enhancement?

Complete Description of Additions/Changes:

Add your description here

@codecov-commenter
Copy link

codecov-commenter commented Mar 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.37%. Comparing base (35dc56c) to head (13c7d7c).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4373      +/-   ##
==========================================
+ Coverage   77.34%   77.37%   +0.03%     
==========================================
  Files         745      746       +1     
  Lines       41548    41603      +55     
  Branches     8824     8832       +8     
==========================================
+ Hits        32135    32192      +57     
+ Misses       8365     8364       -1     
+ Partials     1048     1047       -1     
Flag Coverage Δ
unittests 77.36% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@xiangce xiangce force-pushed the mac_obf branch 3 times, most recently from 241793a to 6a1961a Compare March 5, 2025 14:26
@xiangce xiangce requested a review from JoySnow March 6, 2025 10:09
- Add MAC addr obfuscation, and generate relevant reports.
  One MAC address, no matter lowercase or uppercase will be
  treat as one same address, has the same obfuscated result.

- MAC obfuscation will be enabled individually by setting
  "obfuscate_mac=True" in insights-client.conf. And can
  be disabled for particular specs by adding
  "no_obfuscate=['mac']" in spec RegistryPoint

- RHINENG-14805

Signed-off-by: Xiangce Liu <[email protected]>
Copy link
Collaborator

@JoySnow JoySnow left a comment

Choose a reason for hiding this comment

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

@xiangce it's LGTM.

if new_mac:
logger.debug("Obfuscating MAC Addr - %s > %s", mac, new_mac)
return line.replace(mac, new_mac)
# it's an obfuscated IP
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like a typo here, you might mean MAC...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants