cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
205
Views
2
Helpful
2
Replies

Start Radkit as a service in Windows

mario.jost
Level 3
Level 3

I have installed radkit and confiured alot in it already. All done within my userprofile C:/Users/myusername/.radkit

I have first saved the password as a base64 string in the environment variables with this commend:

$env:RADKIT_SERVICE_SUPERADMIN_PASSWORD_BASE64 = [Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes("superstrongpassword!"))

I can verifiy, that the password is present in the environemnt variables:

PS C:\Program Files\Cisco RADKit\env\Scripts> dir env:RADKIT_SERVICE_SUPERADMIN_PASSWORD_BASE64

Name Value
---- -----
RADKIT_SERVICE_SUPERADMIN_P... SwBXADIAOABEcAUAredacted==

Then, i have installed the service like this:

radkit-service.exe --radkit-directory "C:\Users\myusername\.radkit" windows-service install

But when i try to start the service, it stops after a short amount of time and the web interface is not reachable. So my guess is that the service is not taking the password that is saved within the environment variables. When i start the service manually with the entry in the startmenu that runs following command:

"C:\Program Files\Cisco RADKit\env\pythonw.exe" -c "from radkit_service.entry_points.gui import main; main()"

I get a password prompt. So this also seems not to be taking the env variable. I am using RADKit 1.6.9 Any help on this topic?

1 Accepted Solution

Accepted Solutions

mario.jost
Level 3
Level 3

So after the troubleshooting session with Anthony the main issue was that the password could not be read from the environment variables. I could see the variable in powershell, but it wasnt visible in the windows GUI. So im guessing the command that i got from the radkit documentation only creates an environment variable in the "userspace". so I created the same entry in the Windows GUI and from there on, everything worked great. Thanks to Anthony for the time and effort he took to help in this case.

View solution in original post

2 Replies 2

antchris
Cisco Employee
Cisco Employee

Hello mario.jost,

Thanks for reaching out concerning your reported issue. I'd like to take a closer look at your install however I do want to point out the following recommendations.

- We recommend using the Windows installer rather than pip.

- Installation on Windows machine should be performed under the following directory: 

C:\> cd "\Program Files\Cisco RADKit\env\Scripts"

- The use of Global Environment variables is recommended, otherwise defining via command prompt/powershell will require you to input with any new cmd prompt/powershell window. Additionally when starting the Service, you may also need to store the RADKit configuration settings in a settings TOML file (see -- Advanced Service setup, Installation options)

- Regarding the use of BASE64 password, per RADKit documentation (see -- Advanced Service setup,  RADKIT_SERVICE_SUPERADMIN_PASSWORD_BASE64):

"Storing a password in an environment variable is inherently insecure and is not recommended in any way, especially if the password unlocks credentials that grant access to a production environment. The Base64 encoding only protects against the most trivial over-the-shoulder password gleaning attacks. It does not provide any actual security. Use this authentication method at your own risk, preferably in a controlled and secure environment."

- Post installation, using installer, you will start the service a number of ways:

  • through the CLI by executing radkit-service.exe windows-service start;

  • through the services.msc graphical interface by pressing “Win+R” and typing services.msc, then locating “Cisco RADKit Service and starting it;

  • by rebooting the machine, if the default AUTO startup mode was selected during the installation;

  • by any other Windows-specific means (eg. through Task Manager or using the Start-Service PowerShell command)

As mentioned, I'd like to take a closer look at your issue and will PM you directly so that we can better coordinate. I will update this thread once we have reached a solution.

 

mario.jost
Level 3
Level 3

So after the troubleshooting session with Anthony the main issue was that the password could not be read from the environment variables. I could see the variable in powershell, but it wasnt visible in the windows GUI. So im guessing the command that i got from the radkit documentation only creates an environment variable in the "userspace". so I created the same entry in the Windows GUI and from there on, everything worked great. Thanks to Anthony for the time and effort he took to help in this case.