Skip to content

Commit

Permalink
Adding circle-ci config
Browse files Browse the repository at this point in the history
  • Loading branch information
bhatti committed Oct 8, 2018
1 parent 98abb5a commit 1d5db22
Show file tree
Hide file tree
Showing 4 changed files with 166 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/openjdk:8-jdk
environment:
# Customize the JVM maximum heap limit
JVM_OPTS: -Xmx500m
TERM: dumb
steps:
- checkout
- run: gradle dependencies
- run: gradle test
99 changes: 99 additions & 0 deletions .circleci/orb/orb-inline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
version: 2.1
orbs:
insectest:
jobs:
inline_job:
parameters:
# url for nowsecure auto API
auto_url:
type: string
default: https://lab-api.nowsecure.com
# API token, visit https://docs.nowsecure.com/auto/integration-services/jenkins-integration to generate token
auto_token:
type: string
default: $AUTO_TOKEN
# Specify group if you belong to multiple groups
auto_group:
type: string
default: $AUTO_GROUP
# Specify artifacts-dir where security artifacts will be stored
auto_dir:
type: string
default: "/tmp/workspace/nowsecure-auto-security-test"
# Specify absolute path of mobile binary, you would need to attach workspace to this plugin step
auto_file:
type: string
default: $AUTO_FILE
# Specify maximum time to wait for results, if you specify 0 then plugin won't wait for the results
auto_wait:
type: string
default: "30"
# Specify minimum score the app should get from security testing, if you specify 0 then score won't be evaulated otherwise build will be marked as failure if security score is below this number
auto_score:
type: string
default: "50"
executor: inline_executor
steps:
- inline_command:
auto_url: <<parameters.auto_url>>
auto_token: <<parameters.auto_token>>
auto_group: <<parameters.auto_group>>
auto_dir: <<parameters.auto_dir>>
auto_file: <<parameters.auto_file>>
auto_wait: <<parameters.auto_wait>>
auto_score: <<parameters.auto_score>>
commands:
inline_command:
parameters:
# url for nowsecure auto API
auto_url:
type: string
default: https://lab-api.nowsecure.com
# API token, visit https://docs.nowsecure.com/auto/integration-services/jenkins-integration to generate token
auto_token:
type: string
default: $AUTO_TOKEN
# Specify group if you belong to multiple groups
auto_group:
type: string
default: $AUTO_GROUP
# Specify artifacts-dir where security artifacts will be stored
auto_dir:
type: string
default: "/tmp/workspace/nowsecure-auto-security-test"
# Specify absolute path of mobile binary, you would need to attach workspace to this plugin step
auto_file:
type: string
default: $AUTO_FILE
# Specify maximum time to wait for results, if you specify 0 then plugin won't wait for the results
auto_wait:
type: string
default: "30"
# Specify minimum score the app should get from security testing, if you specify 0 then score won't be evaulated otherwise build will be marked as failure if security score is below this number
auto_score:
type: string
default: "50"
steps:
- attach_workspace:
at: /tmp/workspace
- run: cp apkpure_app_887.apk /tmp/workspace/test.apk
- run: curl -Ls https://github.com/bhatti/circle-auto/archive/0.3.tar.gz | tar -xzf - -C .
- run: cd circle-auto-0.3 && gradle run -Dauto.url=<< parameters.auto_url >> -Dauto.token=<< parameters.auto_token >> -Dauto.dir=<< parameters.auto_dir >> -Dauto.file=<< parameters.auto_file >> -Dauto.group=<< parameters.auto_group >> -Dauto.wait=<< parameters.auto_wait >> -Dauto.score=<< parameters.auto_score >>
- persist_to_workspace:
root: /tmp/workspace
paths:
- nowsecure-auto-security-test/*
- store_artifacts:
path: /tmp/workspace/nowsecure-auto-security-test
destination: nowsecure-auto-security-test
executors:
inline_executor:
docker:
- image: circleci/openjdk:8-jdk-node
environment:
TERM: dumb
workflows:
test:
jobs:
- insectest/inline_job:
auto_file: /tmp/workspace/test.apk
53 changes: 53 additions & 0 deletions .circleci/orb/orb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
version: 2.1
description: CircleCI orb for NowSecure AUTO that provides fully automated, mobile
appsec testing coverage
executors:
default:
description: Java docker container to use when running the NowSecure AUTO orb
docker:
- image: circleci/openjdk:8-jdk-node
environment:
TERM: dumb
commands:
sectest:
description: Executes security test using NowSecure AUTO.
parameters:
# url for nowsecure auto API
auto_url:
type: string
default: https://lab-api.nowsecure.com
# API token, visit https://docs.nowsecure.com/auto/integration-services/jenkins-integration to generate token
auto_token:
type: string
default: $AUTO_TOKEN
# Specify group if you belong to multiple groups
auto_group:
type: string
default: $AUTO_GROUP
# Specify artifacts-dir where security artifacts will be stored
auto_dir:
type: string
default: "/tmp/workspace/nowsecure-auto-security-test"
# Specify absolute path of mobile binary, you would need to attach workspace to this plugin step
auto_file:
type: string
# Specify maximum time to wait for results, if you specify 0 then plugin won't wait for the results
auto_wait:
type: string
default: "30"
# Specify minimum score the app should get from security testing, if you specify 0 then score won't be evaulated otherwise build will be marked as failure if security score is below this number
auto_score:
type: string
default: "50"
steps:
- attach_workspace:
at: /tmp/workspace
- run: curl -Ls https://github.com/bhatti/circle-auto/archive/0.3.tar.gz | tar -xzf - -C .
- run: cd circle-auto-0.3 && gradle run -Dauto.url=<< parameters.auto_url >> -Dauto.token=<< parameters.auto_token >> -Dauto.dir=<< parameters.auto_dir >> -Dauto.file=<< parameters.auto_file >> -Dauto.group=<< parameters.auto_group >> -Dauto.wait=<< parameters.auto_wait >> -Dauto.score=<< parameters.auto_score >>
- persist_to_workspace:
root: /tmp/workspace
paths:
- nowsecure-auto-security-test/*
- store_artifacts:
path: /tmp/workspace/nowsecure-auto-security-test
destination: nowsecure-auto-security-test
Binary file added dist/auto-circleci-plugin-0.4.jar
Binary file not shown.

0 comments on commit 1d5db22

Please sign in to comment.