Issue
When configuring a standard menu item within zim
it is possible to specify a simple password
to protect this menu item.
It is not possible to specify a simple password
with the dynamic menu items that are created based on the projects.ini
file.
Requirements
- zim.cfg file
- ZENworks Configuration Management server with Imaging role configured
Solution
Update the projects.ini
file with a password per project then modify the zim.cfg
file to prompt for the appropriate password once the dynamic menu item has been selected.
Procedure
Done | Task | ||
---|---|---|---|
|
|||
|
|||
|
-
Modify zim.cfg file
- Open the
zim.cfg
file with a text editor
- Update the
zim.cfg
file with the following information:
Editzim.cfg
file, changing
from:Set:lookup_project,%_project_item2% Label:lookup_project_info ; Read in project specific information File:Ini,Get,"%_ZimDir%projects.ini","%Lookup_Project%","Project_Image_Path",Project_Image_Path File:Ini,Get,"%_ZimDir%projects.ini","%Lookup_Project%","Project_OS",Project_OS File:Ini,Get,"%_ZimDir%projects.ini","%Lookup_Project%","Partition_Count",Partition_Count File:Ini,Get,"%_ZimDir%projects.ini","%Lookup_Project%","Driver_OS",Project_Driver_OS File:Ini,Get,"%_ZimDir%projects.ini","%Lookup_Project%","Base_Image",Base_Image File:Ini,Get,"%_ZimDir%projects.ini","%Lookup_Project%","Ztoolkit",Project_Ztoolkit File:Ini,Get,"%_ZimDir%projects.ini","%Lookup_Project%","Novcomp",Project_novcomp File:Ini,Get,"%_ZimDir%projects.ini","%Lookup_Project%","Efi_boot_image",Efi_boot_image
to (lines to be added are in green):
Set:lookup_project,%_project_item2% Label:lookup_project_info ; Validate password if set in projects.ini file Set:pw_login_count,"0" Set:pw_login_count_max,"2" File:Ini,Get,"/zimbin/projects.ini","%lookup_project%","project_password",project_password Label:validate_password If:Var,project_password,ne,"" ; password has been set ; Display password prompt Dialog:InputPass,"Enter password:",prompt_password,RED If:Var,prompt_password,ne,"%project_password%" Set:pw_login_count,math(+, 1) If:Var,pw_login_count,gt,"%pw_LOGIN_COUNT_MAX%" Dialog:Ask,"Menu Lockout!","You have failed to authenticate 3 times.\n \nPress a key to return to the main menu.","_Ok","red" Menu:Return End: Goto:validate_password End: End: ; Read in project specific information File:Ini,Get,"%_ZimDir%projects.ini","%Lookup_Project%","Project_Image_Path",Project_Image_Path File:Ini,Get,"%_ZimDir%projects.ini","%Lookup_Project%","Project_OS",Project_OS File:Ini,Get,"%_ZimDir%projects.ini","%Lookup_Project%","Partition_Count",Partition_Count File:Ini,Get,"%_ZimDir%projects.ini","%Lookup_Project%","Driver_OS",Project_Driver_OS File:Ini,Get,"%_ZimDir%projects.ini","%Lookup_Project%","Base_Image",Base_Image File:Ini,Get,"%_ZimDir%projects.ini","%Lookup_Project%","Ztoolkit",Project_Ztoolkit File:Ini,Get,"%_ZimDir%projects.ini","%Lookup_Project%","Novcomp",Project_novcomp File:Ini,Get,"%_ZimDir%projects.ini","%Lookup_Project%","Efi_boot_image",Efi_boot_image
- Save changes to
zim.cfg
and update file on the server.
- Open the
-
Modify projects.ini file
- Open the
projects.ini
file with a text editor - Update the
projects.ini
file with aproject_password
attribute and set a password if required:
NOTE: The project_password attribute needs to be set on each project section. Zim will error if it is not available. The password does not need to be populated on each entry
NOTE: If the buildconsole - integration wizard
is used to recreate the projects.ini file - then the password information will need to be re-applied to the new file.
from:; ; ENGL Zim projects.ini lookup file ; [projects] project1 = Techbite drivers demo - Win 7 project2 = Windows 7 Enterprise (x86) - en-US project3 = xpsp3-test ; Project details [Techbite drivers demo - Win 7] Description = Techbite drivers demo - Win 7 project_image_path = techbite-drivers-win7 project_os = win7-ent-x86 base_image = win7-ent-x86-postsp ztoolkit = ztoolkit.zmg novcomp = [Windows 7 Enterprise (x86) - en-US] Description = Windows 7 Enterprise (x86) - en-US project_image_path = win7-demo project_os = win7-ent-x86 base_image = win7-ent-x86-postsp ztoolkit = ztoolkit.zmg novcomp = novcomp.zmg [xpsp3-test] Description = xpsp3-test project_image_path = xpsp3-test1 project_os = winxp-x86 base_image = winxp-x86-postsp ztoolkit = ztoolkit.zmg novcomp = novcomp.zmg
to:
; ; ENGL Zim projects.ini lookup file ; [projects] project1 = Techbite drivers demo - Win 7 project2 = Windows 7 Enterprise (x86) - en-US project3 = xpsp3-test ; Project details [Techbite drivers demo - Win 7] Description = Techbite drivers demo - Win 7 project_image_path = techbite-drivers-win7 project_os = win7-ent-x86 base_image = win7-ent-x86-postsp ztoolkit = ztoolkit.zmg novcomp = project_password = P@ssw0rd1 [Windows 7 Enterprise (x86) - en-US] Description = Windows 7 Enterprise (x86) - en-US project_image_path = win7-demo project_os = win7-ent-x86 base_image = win7-ent-x86-postsp ztoolkit = ztoolkit.zmg novcomp = novcomp.zmg project_password = P@ssw0rd2 [xpsp3-test] Description = xpsp3-test project_image_path = xpsp3-test1 project_os = winxp-x86 base_image = winxp-x86-postsp ztoolkit = ztoolkit.zmg novcomp = novcomp.zmg project_password =
- Save changes to
projects.ini
and update file on the server.
- Open the
-
Test
- PXE boot a machine to ZENworks imaging/ZIM environment
- Select Restore Menu - select a project :
- If a password has been set for this project - a prompt for the password will popup
- If a password has not been set for this project - the normal forms will be displayed