Forum Discussion

JWhitesPro_1928's avatar
JWhitesPro_1928
Icon for Cirrostratus rankCirrostratus
Dec 11, 2017

how to use rest or cli to edit protocol security profile

Can anyone point me in the right direction for how to use tmsh or REST to edit an smtp protocol security profile?

 

4 Replies

  • you can modify protocol via tmsh by referencing the virtual server in question first.

     

    tmsh create ltm virtual "test123" destination 1.1.1.1:80 profile ... and then you can modify the profile.

     

  • SMTP security profile is available only on systems licensed for ASM. In SMTP profile, only option is to enable or disable SMTP Protocol Security.

     

  • I will look at this but I have a feeling this is to modify the profile assigned and not the actual profile properties.

     

  • Until I find a good answer I just created an AutoIT script that reads a file called c:\myfile.txt that contains each domain on a line. You then open the script and go to the smtp security profile,click the domain text box and place the mouse over the "Add" button and then press Control + V and the script will read the file line by line, type the text into the box, click the add button, then press Shift + TAB to bring focus back to the text box, wait half a second and then do it again for the next line. Script below for anyone who cares. It could be modified to automate other things in the GUI of this nature. (AutoIT).

    include 
    include 
    
    HotKeySet("^v","ClipboardToKeystroke")
    
    While 1
        Sleep(50) ; If you forget this, your program takes up max CPU
    WEnd
    
    Func ClipboardToKeystroke()
        HotKeySet("^v", "Dummy") ; This unregisters the key from this function, and sets it on a dummy function
        While _IsPressed("11") Or _IsPressed("56") ; Wait until both the ctrl and the v key are unpressed
            Sleep(50)
        WEnd
    
        $file = "c:\myfile.txt"
        FileOpen($file,0)
    
        For $i = 1 to _FileCountLines($file)
            $line = FileReadLine($file,$i)
            Send($line,1)
            MouseClick("left")
            Send("+{TAB}")  ; Send Shift + tab to move back to textbox
            Sleep(500)
        Next
        FileClose($file)
         HotKeySet("^v", "ClipboardToKeystroke")
    
    EndFunc
    
    Func Dummy()
        ; Do nothing, this prevents the hotkey to calling the ClipboardToKeystroke function a lot when you hold the key down too long
    EndFunc