Credential setup
Netpilot never takes a password on the command line. It reads named credential
slots, trying each set in config.yaml order until one authenticates. A set
whose files are missing is skipped silently.
Credentials are DPAPI-encrypted on Windows — decryptable only by the same Windows user account that created them.
How a slot is resolved
Section titled “How a slot is resolved”A slot name is looked up in this order (src/utils.py:read_credential):
- Environment variable
CRED_{SLOTNAME_UPPERCASE} - File
{secrets_dir}/{slotname}.txt
Slot names come from config.yaml under credentials.sets. Those are names,
never passwords:
credentials: sets: # tried in order until one authenticates - user: "cisco_admin_user" # needs cisco_admin_user.txt password: "cisco_admin_pass" # needs cisco_admin_pass.txt - user: "alcatel_admin_user" password: "alcatel_admin_pass"Run the setup script
Section titled “Run the setup script”cd src.\setup_credentials.ps1The script walks every slot one at a time, hiding password input. Fill in the ones you have and press Enter to skip the rest. You can also preset slots as parameters and be prompted only for the remainder:
powershell -ExecutionPolicy Bypass -File setup_credentials.ps1 -CiscoAdminUser "admin" -CiscoAdminPass "..."Slots it creates
Section titled “Slots it creates”| Group | Slot files |
|---|---|
| Alcatel | alcatel_default_user, alcatel_default_pass, alcatel_admin_user, alcatel_admin_pass, alcatel_ssoeadmin_user, alcatel_ssoeadmin_pass, alcatel_ncsciscolms_user, alcatel_ncsciscolms_pass1, alcatel_ncsciscolms_pass2, alcatel_ncsalcatellms_user, alcatel_ncsalcatellms_pass |
| Shared | ncsciscolms_new_user, ncsciscolms_new_pass |
| Cisco | cisco_admin_user, cisco_admin_pass, cisco_ncsadmin_user, cisco_ncsadmin_pass1, cisco_ncsadmin_pass2, cisco_ssoeadmin_user, cisco_ssoeadmin_pass, cisco_ssoe2admin_user, cisco_ssoe2admin_pass |
Linux / environment variable override
Section titled “Linux / environment variable override”Environment variables win over files on either platform. On Linux the files are
plain text and permission-checked, so group and other bits must be clear
(chmod 600).
export CRED_CISCO_ADMIN_USER="username"export CRED_CISCO_ADMIN_PASS="password"export CRED_ALCATEL_ADMIN_USER="username2"export CRED_ALCATEL_ADMIN_PASS="password2"paths: secrets_dir_linux: "/opt/automation/secrets_v3"If every device fails authentication
Section titled “If every device fails authentication”Check these in order.
config.yamlis missing. This is the most common cause and it produces no error. Netpilot falls back to built-in defaults whose slots are namednetwork_1throughnetwork_4, so every lookup misses.config.yamlis commonly git-ignored, so this bites on fresh clones and new machines.- Wrong Windows account created the DPAPI files. Re-run the setup script as the account that runs Netpilot.
- Slot names don’t match the files. A typo looks identical to a slot you meant to leave empty, because missing slots are skipped silently.
- Secrets directory mismatch. See the hardcoded-path warning above.