Cloudeka
  • Service Portal Cloudeka
  • Starter Guide Deka Flexi
  • Introduction
    • Sign Up
    • Sign In
    • Sign Out
    • Forgot Password
    • Project
      • Create a New Project
      • List Service
      • Delete Project
    • Profile Setting
    • Organization
      • Manage Role Organization
      • Setting Organization
    • Check Audit Log
    • Broadcast
    • Voucher
      • Voucher Trial
      • Voucher Credit
      • Voucher Discount
  • Deka Flexi
    • Deka Flexi: Instance
      • Introduction
      • Machine Type
      • Operating Systems
      • Server Group
        • Create Server Group
        • Detail Server Group
        • Delete Server Group
      • Create a VM Instance
      • Details Instance
        • Deka Agent
        • Power On Instance
        • Power Off Instance
        • Reboot Instance
        • Resize Instance
        • Resize Root Disk
        • Attach Interface
        • Detach Interface
      • Connect to VM Instance
        • Connect to VM Instance via Cloudeka Portal
        • Connect to Windows VM Instance via RDP (Remote Desktop)
        • Connect to Linux VM Instance via SSH
        • Connect to Linux VM Instance via SSH Key
      • Create SSH Keys
      • Delete VM Instance
    • Deka Volume: Storage
      • Creating & Attaching a Storage or Disk
      • Formatting a Disk
        • Formatting & mounting a disk on Windows
        • Formating & mounting a disk on Linux
      • Increase Storage
      • Delete Storage
    • Deka Volume: Images
      • Snapshot
        • Take a Snapshot for Instance
        • Restore a snapshot for Instance
        • Delete a snapshot for Instance
        • Take a snapshot for Storage
        • Delete a snapshot for Storage
      • Backups
      • Custom Image
    • Deka Flexi: Network
      • VPC Network
        • Create VPC Network
        • Edit VPC Network
        • Add/EditPort
        • Delete Port
        • Add/Edit Subnet
        • Delete Subnet
        • Delete VPC Network
      • Floating IP
        • Assign Floating IP
        • Unassign Floating IP
        • Reassign Floating IP
        • Delete Floating IP
    • Deka Flexi: Security
      • Security Firewall Rule
      • Edit Security Firewall Rule
      • Delete Security Firewall Rule
    • Deka SLB
      • Create Load Balancer
      • Configuration Deka SLB
      • Delete Load Balancer
      • Example Use Case
    • Deka VPN
      • Create VPN
      • OpenVPN Configuration
        • Create OpenVPN
        • Add OpenVPN User
        • Edit OpenVPN User Configuration
        • Download OpenVPN
        • Install OpenVPN on Windows
        • Install OpenVPN on MacOS
        • Connection with OpenVPN
        • Delete OpenVPN User
        • Delete OpenVPN
      • IPsec Configuration
        • Create IPsec
        • Connect IPsec
        • View Pre Shared Key
        • Disconnect IPsec
        • Delete IPsec
      • Remote Instance using Putty
      • Delete VPN
    • NAT Gateway
      • Create NAT Gateway
      • Configuration NAT Gateway
        • Add Floating IP
        • Delete Floating IP
        • Add Static Route
        • Delete Static Route
        • Add NAT
        • Delete NAT
      • Remote Instance
        • Create VPC Expert
        • Create Instance
        • Floating IP Configuration
        • Virtual Machine Access Internet
        • Remote Virtual Machine using Computer Terminal
      • Remote Putty
        • Create VPC
        • Configuration Interface
        • Configuration NAT Gateway
        • Configuration Firewall
        • Remote Instance using Putty
      • Delete NAT Gateway
    • Deka Agent
      • Install Deka Agent on Linux
      • Detail Deka Agent
        • Quick CPU / Mem / Disk
        • Basic CPU/ Mem/ NET/ Disk
        • Memory Meminfo
        • Memory Vmstat
        • System Timesync
        • System Processes
        • System Misc
        • Hardware Misc
        • Systemd
        • Storage Disk
        • Storage Filesystem
        • Network Traffic
        • Network Sockstat
        • Network Netstat
        • Node Exporter
      • Export to PDF
      • Monitoring Deka Agent
    • Deka GLB
      • Create Deka GLB
      • Configuration Deka GLB
      • Delete Deka GLB
      • Example Use Case
  • Deka Prime
    • Introduction
    • NSX-T & NSX-V
    • Delete Project
    • Menu Instance
      • Create New Instance
      • Access Console Instance
      • Power On Instance
      • Power Off Instance
      • Detail Instance
      • Configuration NICs
      • Configuration Guest OS
    • Menu Network
      • Create Routed Network
      • Create Isolated Network
      • Edit Network
      • Delete Network
    • Menu Security
      • Firewall
      • NAT
      • Routing
      • IP Set
    • Menu Catalog
    • Configuration Deka Flexi
  • Storage
    • Deka Box
      • Create Deka Box
      • Overview Deka Box
      • Resize Deka Box
      • Managing Deka Box Access Key
      • Access Deka Box using S3 Browser
      • Upload files and folders in S3
      • Enable versioning in S3
      • Create Static Web in S3
      • Delete Deka Box
      • Bucket and Group Access Policies
        • Specify permissions
        • Edit S3 Bucket Policies
    • Deka NFS
      • Create Deka NFS
      • Detail Deka NFS
      • Mount Deka NFS in Instance
      • Unmount Deka NFS in Instance
      • Delete Deka NFS
  • Network
    • Deka CDN
      • Create CDN
      • Location Configuration CDN
      • Configuration CDN via Editor
      • Deploy CDN
      • Renewal SSL
      • Delete CDN
    • Deka DNS
      • Create DNS
      • Setting DNS Management
      • Delete DNS
  • Platform
    • Deka Dbaas
      • Create Data Store
      • Data Store Detail
      • Delete Data Store
      • Database Access Using Other Apps
    • Deka Rock
      • Create Deka ROCK
      • Detail Deka ROCK
      • Machine Set
      • Security Group
      • Maintenance Windows
      • Open Console with Openshift
      • Installing CLI (oc) on Computer
      • Destroy Cluster Deka ROCK
    • Deka Harbor
      • Create Deka Harbor
      • Detail Deka Harbor
      • Configuration Worker
      • Configuration Load Balancer
      • Configuration Inbound Rule
      • Kubernetes Dashboard
      • Delete Deka Harbor
  • Security
    • Deka AST
      • Create Project
      • Scan Project
      • Change Setting Project
      • SAST
      • SAST Issue
      • SAST: Measure Code
      • SAST: Custom Rule
      • SAST: Security Detector
      • SCA
      • Secret Key
      • Repo Missconfiguration
      • Scan Validation AppSec
      • Dynamic Security
      • Integration
      • Report
      • Delete Project
    • Deka SSL
      • Create Deka SSL
      • Download Key SSL
      • Renewal SSL
      • Import SSL
      • Delete SSL
  • CI/CD
    • Deka Registry
      • Create Deka Registry
      • Summary
      • Repositories
      • Logs
      • Labels
      • Tag
      • Member
      • Push
      • Resize
      • Delete Deka Registry
  • Software
    • Deka POP
      • Introduction
      • Detail Deka Pop
  • Monitoring
    • Alerting
      • Create Alert
      • Edit Alert
      • Delete Alert
      • Alerting Tes Implementation
    • Deka Agent
  • Support
    • Support Ticketing
      • Create Ticket
      • Ticket Details
    • Deka Manage Service
      • Bought a Manage Service Package
      • Downgrage/Upgrade Package
      • Unsubscribe Package
  • Billing
    • Check Billing
    • Balance
      • Billing Payment type Postpaid Project
      • Billing Payment type Prepaid Project
  • Miscellaneous
    • NTP Server
    • How to Sync Local and Remote Directories with Rsync
  • Deka GPU
Powered by GitBook
On this page
  • CI/CD: Jenkins
  • Without Jenkins file
  • With Jenkinsfile
  • CI/CD: Bamboo
  • CI/CD: Gitlab
  • CI/CD: Github
  • Notification: SMTP
  • Notification: Telegram
  1. Security
  2. Deka AST

Integration

PreviousDynamic SecurityNextReport

Last updated 2 months ago

CI/CD: Jenkins

Jenkins is an open source software used to automate the software development process. Jenkins main advantage is his flexibility and ability to integrate with the various tools and technologies commonly used in software development.

Jenkins

In this section this guide will be described using Jenkins:\

Without Jenkins file

  • First step, copy all Jenkins syntactic code below.

stage('I3GIS_SCAN') {
    steps {
        script {
            echo "Scanning project golang-sca with i3gis..."
            final String url = """--location -g --request POST 'https://jenkins-svc-dev.i3gis.id/scan' --header 'Content-Type: application/json' --header 'Authorization: Bearer mG9BsdJqG9rbH5Pi/CBF1edE+pC5LAkeq95TKXW8Lv/4/eZqrnMXEN1BGlUEfnj7FDLX4TjhkFKRmC8rqG6Gbuvy/Iq+h8OKEIbt7mncDfz/+GGh7m/GoW5l9sCp0LPqhuBDFyxlHPEzg6m0WheDCg==' -d '{"project_id":23}'"""
            final def (String response, int code) = sh(script: "set +x; curl -s -w '\n%{response_code}' $url", returnStdout: true).trim().tokenize("
")
            echo "HTTP response status code: $code"
            if (code != 200) {
                echo "Response: " + response
                error("Build failed because scan not success...")
            } else {
                echo "Scan project golang-sca with i3gis..."
            }
            echo "Scan project golang-sca with i3gis is starting..."
        }
    }
}
stage('I3GIS_SCAN_STATUS') {
    steps {
        script {
            echo "Get scan status..."
            final Boolean status_running = true
            while(status_running) {
                sleep(time: 5, unit: "SECONDS")
                echo "Scan still running..."
                final String url1 = """--location -g --request GET 'https://jenkins-svc-dev.i3gis.id/scan/23' --header 'Content-Type: application/json' --header 'Authorization: Bearer mG9BsdJqG9rbH5Pi/CBF1edE+pC5LAkeq95TKXW8Lv/4/eZqrnMXEN1BGlUEfnj7FDLX4TjhkFKRmC8rqG6Gbuvy/Iq+h8OKEIbt7mncDfz/+GGh7m/GoW5l9sCp0LPqhuBDFyxlHPEzg6m0WheDCg=='"""
                final def (String response1, int code1) = sh(script: "set +x; curl -s -w '\n%{response_code}' $url1", returnStdout: true).trim().tokenize("
")
                echo "HTTP response status code: $code1"
                if (code1 != 200 && code1 != 404) {
                    echo "Response: " + response1
                    error("Scan failed...")
                }
                if(code1 == 404) break
            }
            echo "Scan finished..."
        }
    }
}
  • The second step is on the Pipeline at Jenkins click the Configure menu.

  • On the Configure menu page, move to the Pipeline Setting Section then in Column Definition to Pipeline Script and paste the syntax code you copied into the Column Script.

With Jenkinsfile

  • For the first step copy Jenkins syntactic code below.

stage('I3GIS_SCAN') {
    steps {
        script {
            echo "Scanning project golang-sca with i3gis..."
            final String url = """--location -g --request POST 'https://jenkins-svc-dev.i3gis.id/scan' --header 'Content-Type: application/json' --header 'Authorization: Bearer mG9BsdJqG9rbH5Pi/CBF1edE+pC5LAkeq95TKXW8Lv/4/eZqrnMXEN1BGlUEfnj7FDLX4TjhkFKRmC8rqG6Gbuvy/Iq+h8OKEIbt7mncDfz/+GGh7m/GoW5l9sCp0LPqhuBDFyxlHPEzg6m0WheDCg==' -d '{"project_id":23}'"""
            final def (String response, int code) = sh(script: "set +x; curl -s -w '\n%{response_code}' $url", returnStdout: true).trim().tokenize("
")
            echo "HTTP response status code: $code"
            if (code != 200) {
                echo "Response: " + response
                error("Build failed because scan not success...")
            } else {
                echo "Scan project golang-sca with i3gis..."
            }
            echo "Scan project golang-sca with i3gis is starting..."
        }
    }
}
stage('I3GIS_SCAN_STATUS') {
    steps {
        script {
            echo "Get scan status..."
            final Boolean status_running = true
            while(status_running) {
                sleep(time: 5, unit: "SECONDS")
                echo "Scan still running..."
                final String url1 = """--location -g --request GET 'https://jenkins-svc-dev.i3gis.id/scan/23' --header 'Content-Type: application/json' --header 'Authorization: Bearer mG9BsdJqG9rbH5Pi/CBF1edE+pC5LAkeq95TKXW8Lv/4/eZqrnMXEN1BGlUEfnj7FDLX4TjhkFKRmC8rqG6Gbuvy/Iq+h8OKEIbt7mncDfz/+GGh7m/GoW5l9sCp0LPqhuBDFyxlHPEzg6m0WheDCg=='"""
                final def (String response1, int code1) = sh(script: "set +x; curl -s -w '\n%{response_code}' $url1", returnStdout: true).trim().tokenize("
")
                echo "HTTP response status code: $code1"
                if (code1 != 200 && code1 != 404) {
                    echo "Response: " + response1
                    error("Scan failed...")
                }
                if(code1 == 404) break
            }
            echo "Scan finished..."
        }
    }
}
  • Then go into the Jenkins file you have and paste the copied syntactic code into the stage bracket as below.

CI/CD: Bamboo

Bamboo is an open source software that is used to automate software development processes. Make sure you've created a project and linked it to your repository, and created a job in the plan on the Bamboo platform.

This section of the guide will be described using Bamboo:

  • Click the Configure Plan menu.

  • On the Tasks tab and click the Add Task button to add a new task.

  • In the search column type script.

  • Copy the following syntax code.

echo "Scanning project golang-sca with i3gis..."
scanResponse=$(curl --write-out '%{http_code}' --request POST -sL \
    --url 'https://jenkins-svc-dev.i3gis.id/scan'\
    --header 'Content-Type: application/json'\
    --header 'Authorization: Bearer rtt2Ihba2AJVQjhmgonuAdjcD+3GIeBK5Q8SgOGt38TPG3YrACeCA7yGJCSX8fWArIlv62Zlli75Ay3UToFa0K4wgJHTTCP3KvlFS8Q+Te90eQkcOUyo7qGGSgSbTiQ8OIP5UEuwshZpSFnyd5ijRg=='\
    --data '{"project_id":23}')
scanCode=$(echo $scanResponse | grep -o ...$)
echo "HTTP response status code: $scanCode"
if [ $scanCode = '200' ]; then
    echo "Scan project golang-sca with i3gis..."
else
    echo "Response: $scanResponse"
    echo "Build failed because scan not success..."
    exit 1
fi
echo "Scan project golang-sca with i3gis is starting..."
echo "Get scan status..."
status_running=true
while [ "$status_running" = true ]; do
    sleep 5
    echo "Scan still running..."
    checkResponse=$(curl --write-out '%{http_code}' --request GET -sL \
        --url 'https://jenkins-svc-dev.i3gis.id/scan/3'\
        --header 'Content-Type: application/json'\
        --header 'Authorization: Bearer rtt2Ihba2AJVQjhmgonuAdjcD+3GIeBK5Q8SgOGt38TPG3YrACeCA7yGJCSX8fWArIlv62Zlli75Ay3UToFa0K4wgJHTTCP3KvlFS8Q+Te90eQkcOUyo7qGGSgSbTiQ8OIP5UEuwshZpSFnyd5ijRg==')
    checkCode=$(echo $checkResponse | grep -o ...$)
    echo "HTTP response status code: $checkCode"
    if [ $checkCode != '200' ] && [ $checkCode != '404' ]; then
        echo "Response: $checkResponse"
        echo "Scan failed..."
        exit 1
    fi
    if [ $checkCode = '404' ]; then
        echo "Scan finished..."
        status_running=false
    fi
done
  • Paste the syntax code you copied previously in the Script Body column. Click the Save button to save the changes.

CI/CD: Gitlab

Gitlab is an open source software tool used to automate software development processes.

This section of the guide will explain integrating Gitlab:

  • On the GitLab repository page click the Settings menu. and select the CI/CD menu.

  • On the Specific runners page there is a Token Registration, copy the syntax below.

gitlab-runner register --name {repository-name} --url {paste-for-url} --registration-token {paste-for-register-token}
  • If successful run the command. In your repository folder create a gitlab-ci.yaml file in your repository. Copy the syntax code below and paste it into the gile gitlab-ci.yml that was created and push it to the gitlab repository.

stages:
  - test
i3gis-job:
  stage: test
  script:
    - echo "Scanning project project-public with i3gis..."
    - 'scanResponse=$(curl --write-out ''%{http_code}'' --request POST -sL --url ''https://api-dev.ast.cloudeka.id/scan-svc/scan'' --header ''Content-Type: application/json'' --header ''Authorization: Bearer fVtuP9ZXxKFEMYP0pPJqwEoLuBLxJ47pD0CUj5lpi+Fu6HUJuTokwq3X7amdZYSso2hpGUmE3YA7kx8WiGKYn59THbBDPSNJPs/NgTXTCnxAGlTt0o6pcoucLfMcaYkVy/glEC6KmTU2eqP/utDWM80DEapfZXTKdqu6p30oP14='' --data ''{"project_id":67}'')'
    - scanCode=$(echo $scanResponse | grep -o ...$)
    - 'echo "HTTP response status code: $scanCode"'
    - if [ $scanCode = "200" ]; then
    - echo "Scan project project-public with i3gis..."
    - else
    - 'echo "Response: $scanResponse"'
    - echo "Build failed because scan not success..."
    - exit 1
    - fi
    - echo "Scan project project-public with i3gis is starting..."

i3gis-status-job:
  stage: test
  script:
    - echo "Get scan status..."
    - status_running=true
    - while [ "$status_running" = true ]; do
    - sleep 5
    - echo "Scan still running..."
    - 'checkResponse=$(curl --write-out ''%{http_code}'' --request GET -sL --url ''https://api-dev.ast.cloudeka.id/scan-svc/scan/67'' --header ''Content-Type: application/json'' --header ''Authorization: Bearer fVtuP9ZXxKFEMYP0pPJqwEoLuBLxJ47pD0CUj5lpi+Fu6HUJuTokwq3X7amdZYSso2hpGUmE3YA7kx8WiGKYn59THbBDPSNJPs/NgTXTCnxAGlTt0o6pcoucLfMcaYkVy/glEC6KmTU2eqP/utDWM80DEapfZXTKdqu6p30oP14='')'
    - checkCode=$(echo $checkResponse | grep -o ...$)
    - 'echo "HTTP response status code: $checkCode"'
    - if [ $checkCode != "200" ] && [ $checkCode != "404" ]; then
    - 'echo "Response: $checkResponse"'
    - echo "Scan failed..."
    - exit 1
    - fi
    - if [ $checkCode = "404" ]; then
    - echo "Scan finished..."
    - status_running=false
    - fi
    - done
  • After a successful commit and push of the gitlab-ci.yml file. Describe the syntax for the gitlab-ci.yml file by running the command below.

gitlab-runner exec shell i3gis-job
gitlab-runner exec shell i3gis-status-job

CI/CD: Github

Make sure you already have a repository on github.

This guide will explain how to integrate Github:

  • On your Github repository page select the Actions tab and hit the New Workflow button.

  • Click Set up a workflow yourself, you will be redirected to code editing where you can define your own workflow.

  • This step is based on the assumption that you don't have a workflow yet but if you have multiple workflows you can skip this step and move to the next step. Specify the initials in the workflow by filling in the line "name" and the line "on" as in the Image below.

  • Copy all github-action scripts below.

jobs:
  i3gis-job:
    runs-on: ubuntu-latest
    steps:
      - name: Scan project with i3gis
        run: |
          echo "Scanning project project-public with i3gis..."
          scanResponse=$(curl --write-out '%{http_code}' --request POST -sL --url 'https://api-dev.ast.cloudeka.id/scan-svc/scan' --header 'Content-Type: application/json' --header 'Authorization: Bearer D2/kx5A1oobZzhloPGyjyr/4ZDPNVEmABVjxB+4PmGVfH0XdmuFB/oSwI0YeTn1E9loNDPPdwIvTfqo0kllIKMWOfIH1Ig3F8RQBMVxk6b2jZHMmCN3k1yjfENapnr/0la65m61B3yawrHH2Rc7ZzSs0jCdKfq5TzSyqh9oZuqE=' --data '{"project_id":67}')
          scanCode=$(echo $scanResponse | grep -o ...$)
          echo "HTTP response status code: $scanCode"
          if [ $scanCode = "200" ]; then
            echo "Scan project project-public with i3gis..."
          else
            echo "Response: $scanResponse"
            echo "Build failed because scan was not successful..."
            exit 1
          fi
          echo "Scan project project-public with i3gis is starting..."
  i3gis-status-job:
    runs-on: ubuntu-latest
    steps:
      - name: Get scan status
        run: |
          echo "Get scan status..."
          status_running=true
          while [ "$status_running" = true ]; do
            sleep 5
            echo "Scan still running..."
            checkResponse=$(curl --write-out ''%{http_code}'' --request GET -sL --url 'https://api-dev.ast.cloudeka.id/scan-svc/scan/67' --header 'Content-Type: application/json' --header 'Authorization: Bearer D2/kx5A1oobZzhloPGyjyr/4ZDPNVEmABVjxB+4PmGVfH0XdmuFB/oSwI0YeTn1E9loNDPPdwIvTfqo0kllIKMWOfIH1Ig3F8RQBMVxk6b2jZHMmCN3k1yjfENapnr/0la65m61B3yawrHH2Rc7ZzSs0jCdKfq5TzSyqh9oZuqE=')
            checkCode=$(echo $checkResponse | grep -o ...$)
            echo "HTTP response status code: $checkCode"
            if [ $checkCode != "200" ] && [ $checkCode != "404" ]; then
              echo "Response: $checkResponse"
              echo "Scan failed..."
              exit 1
            fi
            if [ $checkCode = "404" ]; then
              echo "Scan finished..."
              status_running=false
            fi
          done
  • Paste the github-action syntax below. Click Preview to make sure everything looks correct and hit the Commit Changes button.

  • After committing the workflow file, you will be redirected to the Actions tab. You will see your workflow listed according to the name you provided. Github will run automatically according to predefined rules.

Notification: SMTP

SMTP (Simple Mail Transfer Protocol) is a standard protocol used for sending e-mail over computer networks. This protocol allows the sending of email messages from the sender to the recipient's email server. SMPT acts as a reliable messaging system for transferring e-mails over the internet.

Here are the steps to add SMTP:

  • On the Cloudeka portal service page, select Integration on Deka AST.

  • On the Integration page select SMTP and press the Add SMTP button.

  • The Create SMTP Server window appears. Fill in the Host Server Column, SMTP Port, Email Tester, and Password.

Notification: Telegram

This application is designed to provide messaging services that are fast, secure and can be accessed from various devices. Telegram has one feature, namely automatic bots that can provide information, perform certain tasks and send automatic updates to users.

This guide will explain how to create bots on Telegram:

  • Create a bot on Telegram according to the operating system you are using.

  1. On Iphone start with a new message by tapping the icon at the top right corner in the chat then select New Channel.

  2. On Android, start by tapping the pencil icon in the chat list and then selecting New Channel.

  3. On Windows start by clicking Menu to open the sidebar then selecting New Channel.

Make sure you copy the token and keep it safe so that it can't be used by anyone to control your bot.

  • Add a bot to the newly created Channel and make sure the bot is an Administrator.

  • Activate the channel by typing “activate i3gis notification”

  • On the Cloudeka portal service page, on the Integration menu, select Telegram. Enter the API token you got and press the Confirm button.

  • The notification "Create telegram bot successfully" appears and in the List BOT & Channel section the bot that you created in Telegram appears.

Integration without Jenkinsfile
Integration without Jenkinsfile
Integration with Jenkinsfile
Bamboo
Integration with Bamboo
Integration with Bamboo
Integration with Bamboo
Integration with Bamboo
Gitlab

The first step is to make sure you have installed on your computer. For more details you can visit the Gitlab website page.

Integration Gitlab
Integration Gitlab
Github
Integration Github (a)
Integration Github (b)
Integration Github (c)
Integration Github (d)
SMTP
Add SMTP (a)
Add SMTP (b)
Add SMTP (c)
Telegram
Create Bot (a)

Create bots to send notifications on , and get tokens for API requests. On bot creation BotFather will ask for your name and username and then generate an authentication token for the new bott. The username is the short name that will be linked to t.me. Username must use: a. 5-32 characters long. b.It doesn't matter if you use lowercase or uppercase. c.Use only letters, numbers, and underscore characters. d.Bot usernames must end with the word “bot”.

Create Bot (b)
Create Bot (c)
Create Bot (d)
Create Bot (e)
Create Bot (f)
Gitlab
BotFather
Page cover image