From 967dbccafb93a22894ef822ad8438185ab2efd9e Mon Sep 17 00:00:00 2001 From: Erika-Dsouza Date: Mon, 21 Jan 2019 14:03:55 -0500 Subject: [PATCH 1/2] chore(appscan): Disable appscan and upddate version --- .bumpversion.cfg | 2 +- .travis.yml | 5 ----- setup.py | 2 +- watson_developer_cloud/version.py | 2 +- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 7420aa137..aada262e8 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 2.5.3 +current_version = 2.6.0 commit = True [bumpversion:file:watson_developer_cloud/version.py] diff --git a/.travis.yml b/.travis.yml index bf04ff21a..becd4944a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,12 +13,7 @@ install: - pip install tox-travis - pip install bumpversion - npm install @semantic-release/exec -- if [ "${TRAVIS_TAG}" = "${TRAVIS_BRANCH}" ]; then cd appscan; make asoc-tool; cd - ../; fi -before_script: -- if [ "${TRAVIS_TAG}" = "${TRAVIS_BRANCH}" ]; then chmod a+x ./appscan/ASOC.sh; fi script: -- if [ "${TRAVIS_TAG}" = "${TRAVIS_BRANCH}" ]; then ./appscan/ASOC.sh; fi - pip install -U python-dotenv - tox before_deploy: diff --git a/setup.py b/setup.py index 00e9990c8..a3630c13d 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ import os import sys -__version__ = '2.5.3' +__version__ = '2.6.0' if sys.argv[-1] == 'publish': # test server diff --git a/watson_developer_cloud/version.py b/watson_developer_cloud/version.py index 2d517506c..f0e5e1eae 100644 --- a/watson_developer_cloud/version.py +++ b/watson_developer_cloud/version.py @@ -1 +1 @@ -__version__ = '2.5.3' +__version__ = '2.6.0' From 7ced7e80f9f39355c3be2749672563e918a938e3 Mon Sep 17 00:00:00 2001 From: Erika-Dsouza Date: Tue, 22 Jan 2019 10:19:08 -0500 Subject: [PATCH 2/2] chore(appscan): remove appscan directory --- appscan/ASOC.sh | 7 ----- appscan/Configfile | 19 ------------- appscan/Makefile | 69 ---------------------------------------------- appscan/app.json | 42 ---------------------------- appscan/getJson.py | 22 --------------- 5 files changed, 159 deletions(-) delete mode 100644 appscan/ASOC.sh delete mode 100644 appscan/Configfile delete mode 100644 appscan/Makefile delete mode 100644 appscan/app.json delete mode 100644 appscan/getJson.py diff --git a/appscan/ASOC.sh b/appscan/ASOC.sh deleted file mode 100644 index 7f681691c..000000000 --- a/appscan/ASOC.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -cd appscan -make generate-irx -make upload-file -make run-scan -cd ../ diff --git a/appscan/Configfile b/appscan/Configfile deleted file mode 100644 index 40b4e6ede..000000000 --- a/appscan/Configfile +++ /dev/null @@ -1,19 +0,0 @@ -# URLs to the CISO APIs -LOGIN_URL ?= 'https://appscan.ibmcloud.com/api/V2/Account/ApiKeyLogin' -UPLOAD_URL ?= 'https://appscan.ibmcloud.com/api/v2/FileUpload' -GET_APP_URL ?= 'https://appscan.ibmcloud.com/api/V2/Apps?$$$$filter=Name%20eq%20' -STATIC_SCAN_URL ?= 'https://appscan.ibmcloud.com/api/v2/Scans/StaticAnalyzer' -CREATE_APP_URL ?= 'https://appscan.ibmcloud.com/api/V2/Apps' -GET_ASSET_GROUP_URL ?= 'https://appscan.ibmcloud.com/api/V2/AssetGroups' - -APPSCAN_CLIENT_URL ?= https://appscan.ibmcloud.com/api/SCX/StaticAnalyzer/SAClientUtil?os= -OS ?= linux -APPSCAN_TOOL := $(APPSCAN_CLIENT_URL)$(OS) - -GIT_REPO ?= git@github.com:watson-developer-cloud/python-sdk.git - -PROJECT_NAME ?= python-sdk - -# Headers added to curl command -CONTENT_HEADER_JSON := --header 'Content-Type: application/json' -ACCEPT_HEADER_JSON := --header 'Accept: application/json' diff --git a/appscan/Makefile b/appscan/Makefile deleted file mode 100644 index 3a39315a0..000000000 --- a/appscan/Makefile +++ /dev/null @@ -1,69 +0,0 @@ -include Configfile - -# This will configure a 32-bit architecture on top of a 64-bit linux machine -config-arch: - sudo dpkg --add-architecture i386 - sudo apt-get update - sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 - -# Gets the ASoC Client Tool and configures it -asoc-tool: config-arch - $(eval DIR := $(shell pwd)) - curl -o $(HOME)/client.zip $(APPSCAN_TOOL) - mkdir $(HOME)/client ; mkdir $(HOME)/tool - unzip -qq $(HOME)/client.zip -d $(HOME)/client - cd $(HOME)/client ; ls | xargs -I {} sh -c "cp -r {}/* $(HOME)/tool" - rm -rf client - -# Clone repo -clone-repo: - git clone $(GIT_REPO) - -# Generates the irx file for icp-cert-manager -generate-irx: - cd $(TRAVIS_BUILD_DIR) - $(HOME)/tool/bin/appscan.sh prepare -oso - -# Login to the AppScan API -api-login: - curl -o $(HOME)/token.json -X POST $(CONTENT_HEADER_JSON) $(ACCEPT_HEADER_JSON) -d '{"KeyId":"$(ASOC_APIKEY)", "KeySecret":"$(ASOC_SECRET)"}' $(LOGIN_URL) - -# Uploads the irx file to the AppScan API -upload-file: api-login - $(eval TOKE := $(shell python getJson.py $(HOME)/token.json "Token")) - $(eval AUTH := --header 'Authorization: Bearer $(TOKE)') - $(eval FILE := fileToUpload=@$(shell pwd)/$(notdir $(shell find $(pwd) -maxdepth 2 -name '*.irx' -print))) - - curl -o $(HOME)/file.json -X POST --header 'Content-Type: multipart/form-data' $(ACCEPT_HEADER_JSON) $(AUTH) -F $(FILE) $(UPLOAD_URL) - -# Checks to see if Cert-Manager-Application already exists. -# TODO: Error with the url, will come back to this later. -get-app: - $(eval TOKE := $(shell python getJson.py $(HOME)/token.json "Token")) - $(eval AUTH := --header 'Authorization: Bearer $(TOKE)') - $(eval URL := $(GET_APP_URL)'$(APP_NAME)''') - - curl -X GET $(ACCEPT_HEADER_JSON) $(AUTH) $(URL) - -# Assume we have an existing application, then we'll simply run the static scan -run-scan: - $(eval TOKE := $(shell python getJson.py $(HOME)/token.json "Token")) - $(eval AUTH := --header 'Authorization: Bearer $(TOKE)') - $(eval FILE_ID := "$(shell python getJson.py $(HOME)/file.json "FileId")") - $(eval APP_ID := "$(shell python getJson.py app.json "Id")") - - curl -X POST $(CONTENT_HEADER_JSON) $(ACCEPT_HEADER_JSON) $(AUTH) -d '{"ARSAFileId": $(FILE_ID), "ApplicationFileId": $(FILE_ID), "ScanName": "$(TRAVIS_TAG):$(TRAVIS_JOB_NUMBER):$(TRAVIS_COMMIT)", "EnableMailNotification": false, "Locale": "en-US", "AppId": $(APP_ID), "Execute": true, "Personal": false}' $(STATIC_SCAN_URL) - -get-asset-group: - $(eval TOKE := $(shell python getJson.py $(HOME)/token.json "Token")) - $(eval AUTH := --header 'Authorization: Bearer $(TOKE)') - - curl -o asset.json -X GET $(ACCEPT_HEADER_JSON) $(AUTH) $(GET_ASSET_GROUP_URL) - -# Create the application only if the application doesn't already exist. -create-app: get-asset-group - $(eval ASSET_GROUP_ID := "$(shell python getJson.py asset.json "Id")") - $(eval TOKE := $(shell python getJson.py $(HOME)/token.json "Token")) - $(eval AUTH := --header 'Authorization: Bearer $(TOKE)') - - curl -o app.json -X POST $(CONTENT_HEADER_JSON) $(ACCEPT_HEADER_JSON) $(AUTH) -d '{"Name": $(APP_NAME), "AssetGroupId": $(ASSET_GROUP_ID), "BusinessImpact": "Unspecified"}' $(CREATE_APP_URL) \ No newline at end of file diff --git a/appscan/app.json b/appscan/app.json deleted file mode 100644 index 4e9d697cc..000000000 --- a/appscan/app.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "Id": "769fd34f-7a4a-484a-a069-9b27d052cd9b", - "AssetGroupName": "IBM Watson and Cloud Platform", - "DateCreated": null, - "LastUpdated": null, - "LastComment": null, - "RiskRating": "Unknown", - "CreatedBy": null, - "CriticalIssues": 0, - "HighIssues": 0, - "MediumIssues": 0, - "LowIssues": 0, - "IssuesInProgress": 0, - "MaxSeverity": "Undetermined", - "RR_MaxSeverity": 0, - "NewIssues": 0, - "OpenIssues": 0, - "TotalIssues": 0, - "OverallCompliance": null, - "ComplianceStatuses": [], - "CanBeDeleted": true, - "LockedToSubscription": false, - "Name": "Watson Python SDK", - "AssetGroupId": null, - "BusinessImpact": "Unspecified", - "Url": null, - "Description": null, - "BusinessUnit": null, - "Type": null, - "Technology": null, - "TestingStatus": "NotStarted", - "Hosts": null, - "CollateralDamagePotential": "NotDefined", - "TargetDistribution": "NotDefined", - "ConfidentialityRequirement": "NotDefined", - "IntegrityRequirement": "NotDefined", - "AvailabilityRequirement": "NotDefined", - "Tester": null, - "BusinessOwner": null, - "DevelopmentContact": null, - "PreferredOfferingType": "None" - } diff --git a/appscan/getJson.py b/appscan/getJson.py deleted file mode 100644 index 1fc689422..000000000 --- a/appscan/getJson.py +++ /dev/null @@ -1,22 +0,0 @@ -import json -import sys - -def main(): - data = load_data() - printFields(data) - -def load_data(): - data = "" - filename = sys.argv[1] - with open(filename, "r") as read: - data = json.load(read) - if isinstance(data, list): - data = data[0] - return data - -def printFields(data): - fields = sys.argv[2:] - for i in fields: - print(data[i]) - -main()