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

Add Citrix Netscaler OS Plugin #357

Merged
merged 4 commits into from
Aug 14, 2023

Conversation

MaxGroot
Copy link
Contributor

This pull requests adds support for Citrix Netscaler images. Depending on which filesystems are available, it maps the filesystems to:

  • / (the in-memory filesystem loaded by the init binary, whenever this disk is available)
  • /var (Hard disk storage of Citrix Netscalers)
  • /flash (The boot disk, which is mounted to /flash when operating on a live Citrix Netscaler)

The plugin parses the configuration files (and, where needed, their backups) to retrieve information about ips, usernames, timezone, version and hostname.

When testing other plugins (such as os.unix.history.commandhistory and apps.webserver.apache) I ran into a few peculiarities once the Citrix OS plugin correctly maps directories. For Citrix Netscalers, the commandhistory plugin incorrectly parses the bash history of users, and the apache plugin doesn't process any httpaccess or httperror logfiles, which can be useful for investigation. It's probably best to address those fixes in separate PR's.

@codecov
Copy link

codecov bot commented Aug 13, 2023

Codecov Report

Merging #357 (eb97e79) into main (86a732e) will increase coverage by 0.14%.
The diff coverage is 97.87%.

@@            Coverage Diff             @@
##             main     #357      +/-   ##
==========================================
+ Coverage   70.40%   70.55%   +0.14%     
==========================================
  Files         233      234       +1     
  Lines       17944    18038      +94     
==========================================
+ Hits        12633    12726      +93     
- Misses       5311     5312       +1     
Flag Coverage Δ
unittests 70.55% <97.87%> (+0.14%) ⬆️

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

Files Changed Coverage Δ
dissect/target/plugins/os/unix/bsd/citrix/_os.py 97.84% <97.84%> (ø)
dissect/target/plugin.py 89.02% <100.00%> (+0.02%) ⬆️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

tests/test_plugins_os_unix_bsd_citrix.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/unix/bsd/citrix/_os.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/unix/bsd/citrix/_os.py Outdated Show resolved Hide resolved
nstmp_users.add(entry.name)
for username in self._config_usernames:
if username == "root" and self.target.fs.exists("/root"):
yield UnixUserRecord(name="root", home="/root")
Copy link
Contributor

Choose a reason for hiding this comment

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

would you not get a double entry for root in the current way?

Suggested change
yield UnixUserRecord(name="root", home="/root")
yield UnixUserRecord(name="root", home="/root")
continue

Copy link
Contributor

Choose a reason for hiding this comment

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

If you would like both, add a comment to why you do it it like this ;)

dissect/target/plugins/os/unix/bsd/citrix/_os.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/unix/bsd/citrix/_os.py Outdated Show resolved Hide resolved
dissect/target/plugins/os/unix/bsd/citrix/_os.py Outdated Show resolved Hide resolved
MaxGroot and others added 3 commits August 14, 2023 14:25
Co-authored-by: Miauwkeru <Miauwkeru@users.noreply.github.com>
@Miauwkeru Miauwkeru merged commit 0f8df7b into fox-it:main Aug 14, 2023
10 checks passed
Poeloe pushed a commit that referenced this pull request Feb 29, 2024
@MaxGroot MaxGroot deleted the feature/citrix-os-plugin branch March 9, 2024 19:49
Zawadidone pushed a commit to Zawadidone/dissect.target that referenced this pull request Apr 5, 2024
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.

2 participants