Skip to content

Commit

Permalink
Adding description fields
Browse files Browse the repository at this point in the history
  • Loading branch information
bhatti committed Nov 7, 2018
1 parent 16b6afe commit 93014e1
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 6 deletions.
26 changes: 24 additions & 2 deletions .circleci/orb/orb-inline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,46 +6,57 @@ orbs:
parameters:
# url for nowsecure auto API
auto_url:
description: url for nowsecure auto API
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:
description: API token, visit https://docs.nowsecure.com/auto/integration-services/jenkins-integration to generate token
type: string
default: $AUTO_TOKEN
# Specify group if you belong to multiple groups
auto_group:
description: Specify group if you belong to multiple groups
type: string
default: $AUTO_GROUP
# Specify artifacts-dir where security artifacts will be stored
auto_dir:
description: Specify artifacts-dir where security artifacts will be stored
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:
description: Specify absolute path of mobile binary, you would need to attach workspace to this plugin step
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:
description: Specify maximum time to wait for results, if you specify 0 then plugin will not wait for the results
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:
description: Specify minimum score the app should get from security testing, if you specify 0 then score will not be evaulated otherwise build will be marked as failure if security score is below this number
type: string
default: "50"
# Specify test username for automation testing
auto_username:
description: Specify test username for automation testing
type: string
default: ""
# Specify test password for automation testing
auto_password:
description: Specify test password for automation testing
type: string
default: ""
# Specify flag to show status messages from automation testing
auto_show_status_messages:
description: Specify flag to show status messages from automation testing
type: string
default: "false"
# Specify flag to show status messages from automation testing
auto_stop_tests_on_status:
description: Specify flag to show status messages from automation testing
type: string
default: ""
executor: inline_executor
Expand All @@ -67,54 +78,65 @@ orbs:
parameters:
# url for nowsecure auto API
auto_url:
description: url for nowsecure auto API
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:
description: API token, visit https://docs.nowsecure.com/auto/integration-services/jenkins-integration to generate token
type: string
default: $AUTO_TOKEN
# Specify group if you belong to multiple groups
auto_group:
description: Specify group if you belong to multiple groups
type: string
default: $AUTO_GROUP
# Specify artifacts-dir where security artifacts will be stored
auto_dir:
description: Specify artifacts-dir where security artifacts will be stored
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:
description: Specify absolute path of mobile binary, you would need to attach workspace to this plugin step
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:
description: Specify maximum time to wait for results, if you specify 0 then plugin will not wait for the results
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:
description: Specify minimum score the app should get from security testing, if you specify 0 then score will not be evaulated otherwise build will be marked as failure if security score is below this number
type: string
default: "50"
# Specify test username for automation testing
auto_username:
description: Specify test username for automation testing
type: string
default: ""
# Specify test password for automation testing
auto_password:
description: Specify test password for automation testing
type: string
default: ""
# Specify flag to show status messages from automation testing
auto_show_status_messages:
description: Specify flag to show status messages from automation testing
type: string
default: "false"
# Specify flag to show status messages from automation testing
auto_stop_tests_on_status:
description: Specify flag to show status messages from automation testing
type: string
default: ""
steps:
- attach_workspace:
at: /tmp/workspace
- run: cp apkpure_app_887.apk /tmp/workspace/test.apk
- run: curl -Ls https://github.com/nowsecure/auto-circleci-plugin/archive/1.0.4.tar.gz | tar -xzf - -C .
- run: cd auto-circleci-plugin-1.0.4 && 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 >> -Dauto.username=<<parameters.auto_username>> -Dauto.password=<<parameters.auto_password>> -Dauto.show.status.messages=<<parameters.auto_show_status_messages>> -Dauto.stop.tests.on.status=<<parameters.auto_stop_tests_on_status>>
- run: curl -Ls https://github.com/nowsecure/auto-circleci-plugin/archive/1.0.5.tar.gz | tar -xzf - -C .
- run: cd auto-circleci-plugin-1.0.5 && 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 >> -Dauto.username=<<parameters.auto_username>> -Dauto.password=<<parameters.auto_password>> -Dauto.show.status.messages=<<parameters.auto_show_status_messages>> -Dauto.stop.tests.on.status=<<parameters.auto_stop_tests_on_status>>
- persist_to_workspace:
root: /tmp/workspace
paths:
Expand Down
15 changes: 13 additions & 2 deletions .circleci/orb/orb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,52 +17,63 @@ commands:
parameters:
# url for nowsecure auto API
auto_url:
description: url for nowsecure auto API
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:
description: API token, visit https://docs.nowsecure.com/auto/integration-services/jenkins-integration to generate token
type: string
default: $AUTO_TOKEN
# Specify group if you belong to multiple groups
auto_group:
description: Specify group if you belong to multiple groups
type: string
default: $AUTO_GROUP
# Specify artifacts-dir where security artifacts will be stored
auto_dir:
description: Specify artifacts-dir where security artifacts will be stored
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:
description: Specify absolute path of mobile binary, you would need to attach workspace to this plugin step
type: string
# Specify maximum time to wait for results, if you specify 0 then plugin won't wait for the results
auto_wait:
description: Specify maximum time to wait for results, if you specify 0 then plugin will not wait for the results
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:
description: Specify minimum score the app should get from security testing, if you specify 0 then score will not be evaulated otherwise build will be marked as failure if security score is below this number
type: string
default: "50"
# Specify test username for automation testing
auto_username:
description: Specify test username for automation testing
type: string
default: ""
# Specify test password for automation testing
auto_password:
description: Specify test password for automation testing
type: string
default: ""
# Specify flag to show status messages from automation testing
auto_show_status_messages:
description: Specify flag to show status messages from automation testing
type: string
default: "false"
# Specify flag to show status messages from automation testing
auto_stop_tests_on_status:
description: Specify flag to show status messages from automation testing
type: string
default: ""
steps:
- attach_workspace:
at: /tmp/workspace
- run: curl -Ls https://github.com/nowsecure/auto-circleci-plugin/archive/1.0.4.tar.gz | tar -xzf - -C .
- run: cd auto-circleci-plugin-1.0.4 && 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 >> -Dauto.username=<<parameters.auto_username>> -Dauto.password=<<parameters.auto_password>> -Dauto.show.status.messages=<<parameters.auto_show_status_messages>> -Dauto.stop.tests.on.status=<<parameters.auto_stop_tests_on_status>>
- run: curl -Ls https://github.com/nowsecure/auto-circleci-plugin/archive/1.0.5.tar.gz | tar -xzf - -C .
- run: cd auto-circleci-plugin-1.0.5 && 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 >> -Dauto.username=<<parameters.auto_username>> -Dauto.password=<<parameters.auto_password>> -Dauto.show.status.messages=<<parameters.auto_show_status_messages>> -Dauto.stop.tests.on.status=<<parameters.auto_stop_tests_on_status>>
- persist_to_workspace:
root: /tmp/workspace
paths:
Expand Down
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ Following are parameters needed for the job
- auto_url: optional parameter for nowsecure auto API URL with default value of https://lab-api.nowsecure.com
- auto_group: optional parameter for group-id. You can also use environment variable AUTO_GROUP to specify this
- auto_wait: optional parameter to specify maximum wait in minutes until security test is completed. The default value is 30 minutes and you can skip wait by specifying 0 value.
- auto_show_status_messages: Specify flag to show status messages from automation testing

## Sample Usage
You can use Auto CircleCI Orb as follows:
```
version: 2.1
orbs:
auto_ci: nowsecure/[email protected].0
auto_ci: nowsecure/[email protected].5
jobs:
build:
docker:
Expand All @@ -34,7 +35,34 @@ jobs:
auto_file: /tmp/myworkspace/test.apk
auto_wait: "30"
auto_score: "50"
auto_show_status_messages: "true"
```

Note that you will generate mobile binary using gradle, Makefile, Fastlane or other tools instead of copying file but it shows how binary file will be created and then passed to the Auto CircleCI Orb for security analysis.

## Getting Started:
### Access token
Generate token as described on https://docs.nowsecure.com/auto/integration-services/jenkins-integration. This token will be specified by environment variable AUTO_TOKEN in CircleCI context as bellow.

### CircleCI project
Create a CircleCI project by visiting https://circleci.com and selecting "ADD PROJECTS" from left tab, e.g.
![Project](https://github.com/nowsecure/blob/master/images/project.png)

### Context in CircleCI
Create a context in Circle CI by visiting https://circleci.com, selecting "SETTINGS" from left tab and then selecting "Context" from left navigation, e.g.
![NewContext](https://github.com/nowsecure/blob/master/images/create_ctx.png)

### Environment variables in Context
Define environment variables for your token and group (optionally), e.g.
![Environment](https://github.com/nowsecure/blob/master/images/ctx.png)

### Add Plugin to your .circleci/config.yml
Use above example to add NowSecure plugin (nowsecure/ci-auto-orb) to your config.yml

### Submit build
After checking in changes, the circle-ci build should kick off and you can see the output as it's running, e.g.
![Job](https://github.com/nowsecure/blob/master/images/job.png)

### View Artifacts
Once the job is completed, you can view JSON artifacts generated by the mobile security testing, e.g.
![Job](https://github.com/nowsecure/blob/master/images/artifacts.png)
Binary file modified dist/auto-circleci-plugin-1.0.4.jar
Binary file not shown.
Binary file added images/add_project.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/artifacts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/create_ctx.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ctx.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/job.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/main/resources/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.4
1.0.5

0 comments on commit 93014e1

Please sign in to comment.