Add Nested Shared Folder (NSF) support to CyberArk PAM import#2233
Open
pvagare-ks wants to merge 4 commits into
Open
Add Nested Shared Folder (NSF) support to CyberArk PAM import#2233pvagare-ks wants to merge 4 commits into
pvagare-ks wants to merge 4 commits into
Conversation
sali-ks
reviewed
Jul 22, 2026
| """ | ||
| from ... import api, vault_extensions | ||
| from .nsf_helpers import find_pam_configuration | ||
| from .record_loader import iter_accessible_record_uids, load_pam_record |
sali-ks
reviewed
Jul 22, 2026
| rec = load_pam_record(params, uid) | ||
| if not rec or getattr(rec, "version", None) != 6: | ||
| continue | ||
| title = getattr(rec, "title", "") or "" |
Contributor
There was a problem hiding this comment.
We can create separate method for match
def is_matching_title(title: str, base: str) -> bool:
title = title.casefold()
if title == base:
return True
if not title.startswith(base):
return False
return bool(re.fullmatch(r" #\d+", title[len(base):]))
Contributor
There was a problem hiding this comment.
if is_matching_title(getattr(record, "title", "") or "", config_base):
candidates.append(record)
seen_uids.add(uid)
sali-ks
reviewed
Jul 22, 2026
| if not config_rec: | ||
| for uid in iter_accessible_record_uids(params): | ||
| rec = load_pam_record(params, uid) | ||
| if not rec or getattr(rec, "version", None) != 6: |
Contributor
There was a problem hiding this comment.
what if positive condition used
if rec or getattr(rec, "version", None) == 6:
title = getattr(rec, "title", "") or ""
sali-ks
reviewed
Jul 22, 2026
| # wrapper folder(s). Records live inside these (and inside | ||
| # their Resources / Users subfolders for the safe-per-folder | ||
| # layout). | ||
| shared_folder_uids: List[str] = [] |
sali-ks
reviewed
Jul 22, 2026
| return index | ||
|
|
||
| try: | ||
| from keepercommander.commands.pam_import.nsf_helpers import get_folder_record_uids |
sali-ks
reviewed
Jul 22, 2026
| for ruid in all_record_uids: | ||
| rec = vault.KeeperRecord.load(params, ruid) | ||
| try: | ||
| from keepercommander.commands.pam_import.record_loader import load_pam_record |
sali-ks
reviewed
Jul 22, 2026
|
|
||
| root = NestedShareFolderNode() | ||
| root.uid = "nsf-root" | ||
| root.name = "PAM Environments" |
Contributor
There was a problem hiding this comment.
create constant for "PAM Environments", "CyberArk Migration", "Win_Local" etc
sali-ks
reviewed
Jul 22, 2026
| def test_find_classic_wrapper_still_works(self): | ||
| from types import SimpleNamespace | ||
| from keepercommander.commands.pam_import.cyberark_import import CyberArkPAMCleanupCommand | ||
| from keepercommander.subfolder import BaseFolderNode |
| "--platform-map", "map.json", | ||
| "--state-filter", "active,inactive", | ||
| "--no-verify-ssl", | ||
| "--nsf", |
Contributor
There was a problem hiding this comment.
use nsf as default and add classic flow as a flag
adeshmukh-ks
requested changes
Jul 23, 2026
adeshmukh-ks
left a comment
Contributor
There was a problem hiding this comment.
if possible change the code to make nsf as default flow and classic folder flow to be on using a flag
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.
Summary
--nsftopam project cyberark-importso CyberArk migrations can create project folders, records and PAM configuration under Nested Shared Folders instead of classic shared folders.Changes
pam project cyberark-import <cybeark_tenant> --nsfcommand for creating nsf folders, pam records and pam config