ZE-AuditService Deployment

Prerequisite

AuditService Service Deployment (Jar)

  • Create a directory under folder opt “zephyrservice”

    mkdir zephyrservice

  • Download the ze-audit-service.jar and copy it under zephyrservice.

  • Create a ze-audit-service.jar config file Named “zeAuditService.properties" under folder zephyrservice

    vi zeAuditService.properties

  • Add the below line to the file zeAuditService.properties

    #Audit Service port
    server.port=8083
    
    #RabbitMq Configuration
    zephyr.queue.name=ze_audit_queue
    zephyr.queue.exchange=ze_audit_exchange
    zephyr.queue.routing.key=ze_audit_routing_key
    
    #hostname should point to continer name if in case you are running webhook on docker
    spring.rabbitmq.host=<rabbitmq_hostname>
    spring.rabbitmq.port=<rabbitmq_port>
    spring.rabbitmq.username=<rabbitmq_username>
    spring.rabbitmq.password=<rabbitmq_password>
    spring.rabbitmq.ssl.enabled=true
    
    # Activate Profile {dbType} = mysql/mssql/oracle, {queueType} = artemis/rabbitmq
    spring.profiles.active={dbType},{queueType}
    spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jms.artemis.ArtemisAutoConfiguration 
    

Append the below database-specific properties based on the Zephyr database you are using.

MsSQL

# Data source configurations applied for mssql
---
---
spring.config.activate.on-profile=mssql
spring.datasource.url=jdbc:sqlserver://<database_ipaddress>:<database_port>;database=itcc;encrypt=true;trustServerCertificate=true
spring.datasource.username=<datbase_username>
spring.datasource.password=<database_password>
spring.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
spring.jpa.hibernate.ddl-auto=none
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.SQLServer2012Dialect

MySQL

# Data source configurations applied for mysql
---
---
spring.config.activate.on-profile=mysql
spring.datasource.url=jdbc:mysql://<database_ipaddress>:<database_port>/itcc?useUnicode=true&characterEncoding=utf-8&useSSL=false
spring.datasource.username=<datbase_username>
spring.datasource.password=<database_password>
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.jpa.hibernate.ddl-auto=none
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect

Oracle

# Data source configurations applied for oracle
---
---
spring.config.activate.on-profile=oracle
spring.datasource.url=jdbc:oracle:thin:@<hostname>:<port>:orcl
spring.datasource.username=<datbase_username>
spring.datasource.password=<database_password>
spring.datasource.driver-class-name=oracle.jdbc.OracleDriver
spring.jpa.properties.hibernate.default_schema=itcc
spring.jpa.hibernate.ddl-auto=none
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.OracleDialect
  • An example of zeAuditService.properties for MYSQL DB would look like the below:

    #Audit Service port
    server.port=8083
    
    #RabbitMq Configuration
    zephyr.queue.name=ze_audit_queue
    zephyr.queue.exchange=ze_audit_exchange
    zephyr.queue.routing.key=ze_audit_routing_key
    
    # hostname should point to continer name if in case you are running webhook on docker
    spring.rabbitmq.host=localhost
    spring.rabbitmq.port=5672
    spring.rabbitmq.username=guest
    spring.rabbitmq.password=guest
    spring.rabbitmq.ssl.enabled=true
    
    # Activate Profile {dbType} = mysql/mssql/oracle, {queueType} = artemis/rabbitmq
    spring.profiles.active=mysql,rabbitmq
    
    # Data source configurations applied for mysql
    ---
    ---
    spring.config.activate.on-profile=mysql
    spring.datasource.url=jdbc:mysql://localhost:3306/itcc?useUnicode=true&characterEncoding=utf-8&useSSL=false
    spring.datasource.username=root
    spring.datasource.password=root
    spring.datasource.driver-class-name=com.mysql.jdbc.Driver
    spring.jpa.hibernate.ddl-auto=none
    spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
    
  • Open the “Terminal” or “Command Prompt”

  • Navigate to folder /opt/zephyrservice

  • Type the below command

Start the ze-jira-webhook with the following command

sudo nohup java -jar -Dspring.profiles.active=DB,queue_name -DzeAuditConfigPath="<config file path till root folder>" ze-audit-service-main.jar &

Example command for MySQL:

sudo nohup java -jar -Dspring.profiles.active=mysql,rabbitmq -DzeAuditConfigPath="/opt/zephyrservice" ze-audit-service-main.jar &

Note

The Logs folder will be created where your jars are deployed. Separate log files will be created for each jar. In the above example, it will be in /opt/zephyrservice

Verification in the browser:

Verify webhook application status by using HTTP://<hostname>:8083/actuator/health.

AuditService Service Deployment (Docker)

  • Install Docker in the System

  • Create a directory under folder opt “zephyrservice"

    mkdir zephyrservice

    Download the Docker compose and copy it under zephyrservice

    #dockercompose
    version: '3.5'
    services:
      #AuditService
      ze-audit-service:
        image: smartbear/zeauditservices:ze-audit-service
        container_name: ze-audit-service
        ports:
          - "8083:8083"
        environment:
          - server_port=8083
        volumes:
          - ./propertiesFile/zeAuditService.properties:/usr/src/app/zeAuditService.properties
        networks:
          - audit_service
    networks:
      audit_service:
        name: webhook_service
        external: true
  • Create a ze-audit-service.jar config file Named “zeAuditService.properties" under folder zephyrservicevi zeAuditService.properties

    vi zeAuditService.properties

    Add the below line to the file zeAuditService.properties

    server.port=8083 zephyr.queue.name=ze_audit_queue zephyr.queue.exchange=ze_audit_exchange zephyr.queue.routing.key=ze_audit_routing_key # hostname should point to continer name if in case you are running webhook on docker spring.rabbitmq.host=<rabbitmq_hostname> spring.rabbitmq.port=<rabbitmq_port> spring.rabbitmq.username=<rabbitmq_username> spring.rabbitmq.password=<rabbitmq_password>

    An example of zeAuditService.properties should look like the below:

    server.port=8082#Rabbitmq configzephyr.queue.name=ze_audit_queuezephyr.queue.exchange=ze_audit_exchangezephyr.queue.routing.key=ze_audit_routing_keyspring.rabbitmq.host=localhostspring.rabbitmq.port=5672spring.rabbitmq.username=guestspring.rabbitmq.password=guest

    server.port=8083 #Rabbitmq config zephyr.queue.name=ze_audit_queue zephyr.queue.exchange=ze_audit_exchange zephyr.queue.routing.key=ze_audit_routing_key spring.rabbitmq.host=localhost spring.rabbitmq.port=5672 spring.rabbitmq.username=guest spring.rabbitmq.password=guest

    Notice

    • Make sure port 8083 is available.

    • zeAuditService should be able to connect with RabbitMQ.

Start the ze-jira-webhook with docker with the following command:

  • Navigate to zephyrservice and run the below command:

    docker-compose up -d

    The audit started snapshot for reference: -

    audit-started.png

Verification in the browser:

Verify webhook application status by using HTTP://<hostname>:8083/actuator/health.

Publication date: