diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..c551d4a --- /dev/null +++ b/.circleci/config.yml @@ -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 diff --git a/.circleci/orb/orb-inline.yml b/.circleci/orb/orb-inline.yml new file mode 100644 index 0000000..ab7f450 --- /dev/null +++ b/.circleci/orb/orb-inline.yml @@ -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: <> + auto_token: <> + auto_group: <> + auto_dir: <> + auto_file: <> + auto_wait: <> + 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 diff --git a/.circleci/orb/orb.yml b/.circleci/orb/orb.yml new file mode 100644 index 0000000..529cdac --- /dev/null +++ b/.circleci/orb/orb.yml @@ -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 diff --git a/dist/auto-circleci-plugin-0.4.jar b/dist/auto-circleci-plugin-0.4.jar new file mode 100644 index 0000000..5d5c3d1 Binary files /dev/null and b/dist/auto-circleci-plugin-0.4.jar differ