Install - Java Agent Controller on Containerized Springboot App for Dynamic Analysis


Installation Steps

  1. Download the latest vFunction Sudoless Controller Installation TGZ
  2. Download a sample installation.yaml
  3. Download a sample startup.sh
  4. Set the Configurable Settings in the downloaded installation.yaml
  5. Modify the downloaded startup.sh under the “Running application” Section to be relevant for your Application
#!/usr/bin/env bash

set -x

echo "Start the Controller process"

bash /tmp/vfunction/opt/vfunction/controller-installation/restart-controller.sh -i default-java -c

jvm_args=$(cat /tmp/vfunction/etc/sysconfig/vfunction/agent/instances/default-java/vmargs-examples/raw)
export JAVA_TOOL_OPTIONS="$jvm_args"

echo "Running application"
cd /path/to/application/jar/that/should/be/updated/here/
jar_name=$(ls -1 *.jar)
java -jar $jar_name
  1. Create a folder for vFunction artifacts in the Artifact Repository accessible by the Docker Build
  2. Add the vFunction Sudoless Controller Installation TGZ, the installation.yaml and the startup.sh to the Artifact Repository
  3. Create a vFunction specific branch to add the vFunction artificats to the Application’s Dockerfile
  4. Modify the Application’s Dockerfile
FROM <existing_docker_image>

COPY <existing_workflow>

### vFunction COPY workflow

COPY /artifact_repository/vfunction/vfunction-controller-sudo-less-installation*.tgz /tmp/vfunction-controller-sudo-less-installation.tgz
COPY /artifact_repository/vfunction/installation.yaml /tmp/
COPY artifact_repository/vfunction/startup.sh /tmp/

RUN <existing_workflow>

### vFunction RUN workflow

RUN cd /tmp && tar zxvf /tmp/vfunction-controller-sudo-less-installation.tgz                         && \
            rm -rf /tmp/vfunction-controller-sudo-less-installation.tgz                             && \
            mv /tmp/installation.yaml /tmp/vfunction/etc/sysconfig/vfunction/installation/instances/default-java/       && \
            mv /tmp/startup.sh /tmp/vfunction/                                                    && \
            bash /tmp/vfunction/opt/vfunction/controller-installation/install.sh -i default-java -n -a             && \  
            chmod -R 777 /tmp/vfunction                                                            && \
            chown -R <appuser>:<appuser> /tmp/vfunction/                                                

### vFunction ENTRYPOINT workflow

ENTRYPOINT ["/bin/sh"]
CMD ["/tmp/vfunction/startup.sh"]

  1. Build and deploy the Application
  2. Confirm that the Application comes up and functions as expected
  3. If any issues arise: