我要评分
获取效率
正确性
完整性
易理解

Security Application Running and Debugging

After you create a Java or Python project in the Development Assistant, a general compilation task and a security application debugging task are generated in the Compiler and Debugger. You can compile and run the tasks based on your requirements or create a security application debugging task on your own.

Prerequisites

  • The program has been compiled before debugging.
  • In the Resource Manager of VS Code, the folder of the local source program has been opened.

Procedure

  1. Click in the navigation pane on the left, or click Development and choose Debug under Compiler and Debugger. On the debug configuration page that is displayed, choose Security application and set the parameters. See Figure 1.
    Figure 1 Security application debugging
    Table 1 Security application debugging parameters

    Parameter

    Description

    Debug Type

    The options are:

    • General application
    • Parallel HPC application
    • CUDA application
    • Security application
    • DPU debugging

    Remote Server

    Remote server for completing the debugging.

    Use an existing server or add a target server. Click Add Target Server to go to the target server management page. .

    Linux Password

    Password of the Linux user.

    Remember password

    If this option is selected, the Linux user password of the current remote server will be remembered.

    Program

    Enter the path of the program (tee_teleport binary file).

    (Optional) Program Arguments

    Arguments passed to the program for debugging.

    (Optional) Working Directory

    Enter the working directory of the program to be debugged.

    Table 2 describes the debug parameters.

    Table 2 Debug parameters

    Parameter

    Description

    Return Value

    install (-s)

    Installs the Java or Python runtime environment in the TEE.

    If the installation is successful, 0 is returned. If the installation fails, -1 is returned.

    uninstall (-u)

    Uninstalls the Java or Python runtime environment in the TEE. This parameter must be used together with parameter type.

    If the installation is successful, 0 is returned. If the installation fails, -1 is returned.

    type (-t)

    Installation type, which can be Java, Python, or Py3rd. This parameter must be used together with parameter -s.

    -

    import (-m)

    Installs the Java or Python third-party library in the TEE.

    If the installation is successful, 0 is returned. If the installation fails, -1 is returned.

    create (-c)

    Creates an application running directory and session ID in the TEE.

    If the creation is successful, 0 is returned. If the creation fails, -1 is returned.

    id (-i)

    Session ID. This parameter must be specified when run, input, output, or destroy is used.

    -

    run (-r)

    Run the application. This parameter must be used together with parameter sessionID.

    If the operation is successful, 0 is returned. If the operation fails, -1 is returned.

    input (-n)

    Inputs data to the TEE. This parameter can be used together with parameter -d (a relative path is required).

    If the operation is successful, 0 is returned. If the operation fails, -1 is returned.

    output (-o)

    Outputs data from the TEE to the REE. This parameter can be used together with parameter -v.

    If the operation is successful, 0 is returned. If the operation fails, -1 is returned.

    destroy (-e)

    Destroys the data, directory, and session ID of a Java or Python application. This parameter must be used together with parameter sessionID.

    If the operation is successful, 0 is returned. If the operation fails, -1 is returned.

    delete (-d)

    Deletes a subfile or subdirectory of the application in the TEE.

    If the operation is successful, 0 is returned. If the operation fails, -1 is returned.

    query (-q)

    Checks whether a subfile or subdirectory of the application exists in the TEE.

    If the queried file or directory exists, 0 is returned. If it does not exist, 1 is returned. If the check fails, -1 is returned.

    parameter (-p)

    Parameters required for running the application.

    -

    rename (-a)

    Path of the input file.

    -

    save (-v)

    Path of the output file.

    -

    help (-h)

    Obtains help information.

    -

    An example is provided as follows:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    tee_teleport -s jre.sec -t java   # Installs Java.
    tee_teleport -s python.sec -t python   # Installs Python.
    tee_teleport -u -t java   # Uninstalls Java.
    tee_teleport -u -t python   # Uninstalls Python.
    tee_teleport -m third.sec -t python   # Installs a third-party library.
    tee_teleport -c test.sec   # Installs an application. A sessionID.txt file is generated in the current directory.
    tee_teleport -r TeeJava.class -i sessionID.txt   # Runs an application.
    tee_teleport -n data_dir -i sessionID.txt   # Inputs a file.
    tee_teleport -o data_dir -i sessionID.txt   # Outputs a file.
    tee_teleport -e -i sessionID.txt   # Uninstalls an application.
    tee_teleport -d output/tee.log -i sessionID.txt   # Deletes a file.
    tee_teleport -q output/tee.log -i sessionID.txt   # Queries a file.
    tee_teleport -c test.sec -r TeeJava.class -n data_dir -o output/tee.log -e   # Performs installation, file input, execution, and uninstallation.
    

    tee_teleport is an auxiliary tool in the rich execution environment (REE) used to deploy applications into the TEE, start applications, and obtain results.

  2. Click Debug. A dialog box is displayed, indicating that the log file has been generated. You can log in to the server on the terminal to view the log file.