From 76832755d069fb252a24a4cac1303d326d63bb9c Mon Sep 17 00:00:00 2001 From: Danny Leung Date: Mon, 4 Apr 2022 13:51:39 -0700 Subject: [PATCH 01/17] PEX-63: generate version.json --- .github/workflows/build-and-validate.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/build-and-validate.yml b/.github/workflows/build-and-validate.yml index 99a0da2ab7..923910e85a 100644 --- a/.github/workflows/build-and-validate.yml +++ b/.github/workflows/build-and-validate.yml @@ -191,6 +191,15 @@ jobs: tar -czf content-pack-build-escu.tar.gz dist/escu/* # update build number and version for ssa tar -czf content-pack-build-ssa.tar.gz dist/ssa/* + + # create version.json for dist/api + # example: {"version":{"name":"v3.37.1","published_at":"2022-04-04T18:15:38Z"}} + VERSION_TS=$(git log -n 1 --pretty=format:%ci -- dist/escu/default/content-version.conf | sed 's/ /_/g') + echo "{\"version\":{\"name\":\"$CONTENT_VERSION\",\"published_at\":\"$VERSION_TS\"}}" > dist/api/version.json + + #test + cat dist/api/version.json + - name: Persist to Workspace uses: actions/upload-artifact@v2 From f901aa5f94b930a2a5fea06cd109cb7000677cf2 Mon Sep 17 00:00:00 2001 From: Danny Leung Date: Mon, 18 Apr 2022 13:15:34 -0700 Subject: [PATCH 02/17] PEX-63: debug --- .github/workflows/build-and-validate.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-and-validate.yml b/.github/workflows/build-and-validate.yml index 923910e85a..3109e66f1b 100644 --- a/.github/workflows/build-and-validate.yml +++ b/.github/workflows/build-and-validate.yml @@ -199,6 +199,7 @@ jobs: #test cat dist/api/version.json + ls dist/api - name: Persist to Workspace From 0cdb1df1a354352c41ce82161ee2105cd62de627 Mon Sep 17 00:00:00 2001 From: Danny Leung Date: Mon, 18 Apr 2022 15:51:16 -0700 Subject: [PATCH 03/17] PEX-63: debug more --- .github/workflows/build-and-validate.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-and-validate.yml b/.github/workflows/build-and-validate.yml index 3109e66f1b..72b042546c 100644 --- a/.github/workflows/build-and-validate.yml +++ b/.github/workflows/build-and-validate.yml @@ -194,6 +194,9 @@ jobs: # create version.json for dist/api # example: {"version":{"name":"v3.37.1","published_at":"2022-04-04T18:15:38Z"}} + ls -l dist/escu/default/content-version.conf + echo "git log TS:" + git log -n 1 --pretty=format:%ci -- dist/escu/default/content-version.conf | sed 's/ /_/g' VERSION_TS=$(git log -n 1 --pretty=format:%ci -- dist/escu/default/content-version.conf | sed 's/ /_/g') echo "{\"version\":{\"name\":\"$CONTENT_VERSION\",\"published_at\":\"$VERSION_TS\"}}" > dist/api/version.json From f1a8bf36d9f79fadd469d1a07e7bfc0d9a0d91c4 Mon Sep 17 00:00:00 2001 From: Danny Leung Date: Mon, 18 Apr 2022 16:54:41 -0700 Subject: [PATCH 04/17] PEX-63: debug --- .github/workflows/build-and-validate.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build-and-validate.yml b/.github/workflows/build-and-validate.yml index 72b042546c..f1c23ea362 100644 --- a/.github/workflows/build-and-validate.yml +++ b/.github/workflows/build-and-validate.yml @@ -195,8 +195,13 @@ jobs: # create version.json for dist/api # example: {"version":{"name":"v3.37.1","published_at":"2022-04-04T18:15:38Z"}} ls -l dist/escu/default/content-version.conf + git branch + printf "\n\n" + git status + printf "\n\n" echo "git log TS:" git log -n 1 --pretty=format:%ci -- dist/escu/default/content-version.conf | sed 's/ /_/g' + printf "\n\n" VERSION_TS=$(git log -n 1 --pretty=format:%ci -- dist/escu/default/content-version.conf | sed 's/ /_/g') echo "{\"version\":{\"name\":\"$CONTENT_VERSION\",\"published_at\":\"$VERSION_TS\"}}" > dist/api/version.json From 74e4c6f9ca21598fd2466ad26404f08113fa2e8e Mon Sep 17 00:00:00 2001 From: Danny Leung Date: Tue, 26 Apr 2022 12:52:39 -0700 Subject: [PATCH 05/17] PEX-63: debug checkout separate branch --- .github/workflows/build-and-validate.yml | 45 ++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/.github/workflows/build-and-validate.yml b/.github/workflows/build-and-validate.yml index f1c23ea362..fa5dc6923e 100644 --- a/.github/workflows/build-and-validate.yml +++ b/.github/workflows/build-and-validate.yml @@ -116,6 +116,51 @@ jobs: git branch git branch --show-current + build-version-json: + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.sha }} + - name: Update Version and Build number + run : | + # check if tag is set, get build number from the tag if set + if [ -z "${{ steps.vars.outputs.tag }}" ]; then + CONTENT_VERSION=$(grep -oP "(\d+.\d+.\d+$)" dist/escu/default/content-version.conf) + echo "detected content version: $CONTENT_VERSION" + else + CONTENT_VERSION=$(echo ${{ steps.vars.outputs.tag }} | grep -oP "\d+.\d+.\d+") + echo "content version: $CONTENT_VERSION, set by tag: ${{ steps.vars.outputs.tag }}" + fi + # update build number and version for ESCU + sed -i "s/build = .*$/build = ${{ github.run_number }}/g" dist/escu/default/app.conf + sed -i "s/^version = .*$/version = $CONTENT_VERSION/g" dist/escu/default/app.conf + sed -i "s/\"version\": .*$/\"version\": \"$CONTENT_VERSION\"/g" dist/escu/app.manifest + sed -i "s/version = .*$/version = $CONTENT_VERSION/g" dist/escu/default/content-version.conf + tar -czf content-pack-build-escu.tar.gz dist/escu/* + # update build number and version for ssa + tar -czf content-pack-build-ssa.tar.gz dist/ssa/* + + # create version.json for dist/api + # example: {"version":{"name":"v3.37.1","published_at":"2022-04-04T18:15:38Z"}} + ls -l dist/escu/default/content-version.conf + git branch + printf "\n\n" + git status + printf "\n\n" + echo "git log TS:" + git log -n 1 --pretty=format:%ci -- dist/escu/default/content-version.conf | sed 's/ /_/g' + printf "\n\n" + VERSION_TS=$(git log -n 1 --pretty=format:%ci -- dist/escu/default/content-version.conf | sed 's/ /_/g') + echo "{\"version\":{\"name\":\"$CONTENT_VERSION\",\"published_at\":\"$VERSION_TS\"}}" > dist/api/version.json + + #test + cat dist/api/version.json + ls dist/api + + + build-sources: runs-on: ubuntu-latest needs: validate-content From 2c1597e80f5ee075aa0d8a17a03753d45b5758fa Mon Sep 17 00:00:00 2001 From: Danny Leung Date: Tue, 26 Apr 2022 13:01:41 -0700 Subject: [PATCH 06/17] PEX-63: more debug --- .github/workflows/build-and-validate.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-and-validate.yml b/.github/workflows/build-and-validate.yml index fa5dc6923e..3cf4e3f72c 100644 --- a/.github/workflows/build-and-validate.yml +++ b/.github/workflows/build-and-validate.yml @@ -159,6 +159,10 @@ jobs: cat dist/api/version.json ls dist/api + #debug + echo "FOOO" + git log -n 3 dist/escu/default/content-version.conf + build-sources: From 96f743b705f6d80e7fc7424bb4b2f5c87c32a36d Mon Sep 17 00:00:00 2001 From: Danny Leung Date: Tue, 26 Apr 2022 13:08:04 -0700 Subject: [PATCH 07/17] PEX-63: debug --- .github/workflows/build-and-validate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-validate.yml b/.github/workflows/build-and-validate.yml index 3cf4e3f72c..9b6afe603b 100644 --- a/.github/workflows/build-and-validate.yml +++ b/.github/workflows/build-and-validate.yml @@ -249,7 +249,7 @@ jobs: git status printf "\n\n" echo "git log TS:" - git log -n 1 --pretty=format:%ci -- dist/escu/default/content-version.conf | sed 's/ /_/g' + git log -n 1 --pretty=format:%ci dist/escu/default/content-version.conf | sed 's/ /_/g' printf "\n\n" VERSION_TS=$(git log -n 1 --pretty=format:%ci -- dist/escu/default/content-version.conf | sed 's/ /_/g') echo "{\"version\":{\"name\":\"$CONTENT_VERSION\",\"published_at\":\"$VERSION_TS\"}}" > dist/api/version.json From f975394db87a2f0ec9dfb60dc7e3be95ea89d2b9 Mon Sep 17 00:00:00 2001 From: Danny Leung Date: Tue, 26 Apr 2022 13:17:54 -0700 Subject: [PATCH 08/17] PEX-63: derp --- .github/workflows/build-and-validate.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-validate.yml b/.github/workflows/build-and-validate.yml index 9b6afe603b..e26ab7537b 100644 --- a/.github/workflows/build-and-validate.yml +++ b/.github/workflows/build-and-validate.yml @@ -160,8 +160,8 @@ jobs: ls dist/api #debug - echo "FOOO" - git log -n 3 dist/escu/default/content-version.conf + echo "F001" + git log -n 1 -- "dist/escu/default/content-version.conf" From 342adc31a13714236de784e7e1268f0414ecd917 Mon Sep 17 00:00:00 2001 From: Danny Leung Date: Thu, 28 Apr 2022 13:13:11 -0700 Subject: [PATCH 09/17] PEX-63: debug --- .github/workflows/build-and-validate.yml | 88 ++++++------------------ 1 file changed, 20 insertions(+), 68 deletions(-) diff --git a/.github/workflows/build-and-validate.yml b/.github/workflows/build-and-validate.yml index 86bbc881c1..790c8089ee 100644 --- a/.github/workflows/build-and-validate.yml +++ b/.github/workflows/build-and-validate.yml @@ -116,55 +116,6 @@ jobs: git branch git branch --show-current - build-version-json: - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - with: - ref: ${{ github.event.pull_request.head.sha }} - - name: Update Version and Build number - run : | - # check if tag is set, get build number from the tag if set - if [ -z "${{ steps.vars.outputs.tag }}" ]; then - CONTENT_VERSION=$(grep -oP "(\d+.\d+.\d+$)" dist/escu/default/content-version.conf) - echo "detected content version: $CONTENT_VERSION" - else - CONTENT_VERSION=$(echo ${{ steps.vars.outputs.tag }} | grep -oP "\d+.\d+.\d+") - echo "content version: $CONTENT_VERSION, set by tag: ${{ steps.vars.outputs.tag }}" - fi - # update build number and version for ESCU - sed -i "s/build = .*$/build = ${{ github.run_number }}/g" dist/escu/default/app.conf - sed -i "s/^version = .*$/version = $CONTENT_VERSION/g" dist/escu/default/app.conf - sed -i "s/\"version\": .*$/\"version\": \"$CONTENT_VERSION\"/g" dist/escu/app.manifest - sed -i "s/version = .*$/version = $CONTENT_VERSION/g" dist/escu/default/content-version.conf - tar -czf content-pack-build-escu.tar.gz dist/escu/* - # update build number and version for ssa - tar -czf content-pack-build-ssa.tar.gz dist/ssa/* - - # create version.json for dist/api - # example: {"version":{"name":"v3.37.1","published_at":"2022-04-04T18:15:38Z"}} - ls -l dist/escu/default/content-version.conf - git branch - printf "\n\n" - git status - printf "\n\n" - echo "git log TS:" - git log -n 1 --pretty=format:%ci -- dist/escu/default/content-version.conf | sed 's/ /_/g' - printf "\n\n" - VERSION_TS=$(git log -n 1 --pretty=format:%ci -- dist/escu/default/content-version.conf | sed 's/ /_/g') - echo "{\"version\":{\"name\":\"$CONTENT_VERSION\",\"published_at\":\"$VERSION_TS\"}}" > dist/api/version.json - - #test - cat dist/api/version.json - ls dist/api - - #debug - echo "F001" - git log -n 1 -- "dist/escu/default/content-version.conf" - - - build-sources: runs-on: ubuntu-latest needs: validate-content @@ -240,24 +191,6 @@ jobs: tar -czf content-pack-build-escu.tar.gz dist/escu/* # update build number and version for ssa tar -czf content-pack-build-ssa.tar.gz dist/ssa/* - - # create version.json for dist/api - # example: {"version":{"name":"v3.37.1","published_at":"2022-04-04T18:15:38Z"}} - ls -l dist/escu/default/content-version.conf - git branch - printf "\n\n" - git status - printf "\n\n" - echo "git log TS:" - git log -n 1 --pretty=format:%ci dist/escu/default/content-version.conf | sed 's/ /_/g' - printf "\n\n" - VERSION_TS=$(git log -n 1 --pretty=format:%ci -- dist/escu/default/content-version.conf | sed 's/ /_/g') - echo "{\"version\":{\"name\":\"$CONTENT_VERSION\",\"published_at\":\"$VERSION_TS\"}}" > dist/api/version.json - - #test - cat dist/api/version.json - ls dist/api - - name: Persist to Workspace uses: actions/upload-artifact@v2 @@ -266,7 +199,26 @@ jobs: path: | content-pack-build-escu.tar.gz content-pack-build-ssa.tar.gz - + + build-version-json: + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v2 + - name: Update Version and Build number + run : | + echo "foobar" + pwd + date + CONTENT_VERSION=$(grep -oP "(\d+.\d+.\d+$)" dist/escu/default/content-version.conf) + echo "detected content version: $CONTENT_VERSION" + VERSION_TS=$(git log -n 1 --pretty=format:%ci -- dist/escu/default/content-version.conf | sed 's/ /_/g') + echo "{\"version\":{\"name\":\"$CONTENT_VERSION\",\"published_at\":\"$VERSION_TS\"}}" > dist/api/version.json + + echo "bar" + + cat dist/api/version.json + build-package: runs-on: ubuntu-latest needs: [validate-content, build-sources] From 6f2eb6854d1580a1025c76c2c1eded95051c66eb Mon Sep 17 00:00:00 2001 From: Danny Leung Date: Thu, 28 Apr 2022 14:27:12 -0700 Subject: [PATCH 10/17] PEX-63: move version json to separate job --- .github/workflows/build-and-validate.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-and-validate.yml b/.github/workflows/build-and-validate.yml index 790c8089ee..35646d02d9 100644 --- a/.github/workflows/build-and-validate.yml +++ b/.github/workflows/build-and-validate.yml @@ -207,18 +207,15 @@ jobs: uses: actions/checkout@v2 - name: Update Version and Build number run : | - echo "foobar" - pwd - date - CONTENT_VERSION=$(grep -oP "(\d+.\d+.\d+$)" dist/escu/default/content-version.conf) - echo "detected content version: $CONTENT_VERSION" - VERSION_TS=$(git log -n 1 --pretty=format:%ci -- dist/escu/default/content-version.conf | sed 's/ /_/g') - echo "{\"version\":{\"name\":\"$CONTENT_VERSION\",\"published_at\":\"$VERSION_TS\"}}" > dist/api/version.json - - echo "bar" - + curl -o version-api.json https://api.github.com/repositories/162346001/releases/latest + VERSION_VAL=$(cat version-api.json | jq '.name') + VERSION_TS=$(cat version-api.json | jq '.published_at') + echo "{\"version\":{\"name\":$VERSION_VAL,\"published_at\":$VERSION_TS}}" > dist/api/version.json + ls -ahl dist/api/version.json + echo "contents of version.json:" cat dist/api/version.json + build-package: runs-on: ubuntu-latest needs: [validate-content, build-sources] From 8f5422b7bdcf0cb9e2df8e2c1154eda01d3f0527 Mon Sep 17 00:00:00 2001 From: Danny Leung Date: Thu, 28 Apr 2022 14:37:07 -0700 Subject: [PATCH 11/17] PEX-63: test upload version.json s3 --- .github/workflows/build-and-validate.yml | 26 ++++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-and-validate.yml b/.github/workflows/build-and-validate.yml index 35646d02d9..52bae7a15b 100644 --- a/.github/workflows/build-and-validate.yml +++ b/.github/workflows/build-and-validate.yml @@ -530,9 +530,9 @@ jobs: master-api-update: runs-on: ubuntu-latest - needs: [validate-content, build-sources, build-package, run-appinspect, create-report, update-sources-github, publish-github-release, attack-range-update] + #needs: [validate-content, build-sources, build-package, run-appinspect, create-report, update-sources-github, publish-github-release, attack-range-update] #Only run when tagged - if: startsWith(github.ref, 'refs/tags/') + #if: startsWith(github.ref, 'refs/tags/') steps: - name: Checkout Repo uses: actions/checkout@v2 @@ -570,17 +570,17 @@ jobs: - name: Update API sources run: | - aws s3 rm s3://security-content --recursive --exclude "*" --include "*.yml" - aws s3 cp stories s3://security-content/stories --recursive --exclude "*" --include "*.yml" - aws s3 cp baselines s3://security-content/baselines --recursive --exclude "*" --include "*.yml" - aws s3 cp detections s3://security-content/detections --recursive --exclude "*" --include "*.yml" - aws s3 cp playbooks s3://security-content/playbooks --recursive --exclude "*" --include "*.yml" - aws s3 cp lookups s3://security-content/lookups --recursive --exclude "*" --include "*.yml" - aws s3 cp lookups s3://security-content/lookups --recursive --exclude "*" --include "*.csv" - aws s3 cp lookups s3://security-content/lookups --recursive --exclude "*" --include "*.mlmodel" - aws s3 cp macros s3://security-content/macros --recursive --exclude "*" --include "*.yml" - aws s3 cp deployments s3://security-content/deployments --recursive --exclude "*" --include "*.yml" - aws s3 cp dist/api s3://security-content/json --recursive --exclude "*" --include "*.json" + # aws s3 rm s3://security-content --recursive --exclude "*" --include "*.yml" + # aws s3 cp stories s3://security-content/stories --recursive --exclude "*" --include "*.yml" + # aws s3 cp baselines s3://security-content/baselines --recursive --exclude "*" --include "*.yml" + # aws s3 cp detections s3://security-content/detections --recursive --exclude "*" --include "*.yml" + # aws s3 cp playbooks s3://security-content/playbooks --recursive --exclude "*" --include "*.yml" + # aws s3 cp lookups s3://security-content/lookups --recursive --exclude "*" --include "*.yml" + # aws s3 cp lookups s3://security-content/lookups --recursive --exclude "*" --include "*.csv" + # aws s3 cp lookups s3://security-content/lookups --recursive --exclude "*" --include "*.mlmodel" + # aws s3 cp macros s3://security-content/macros --recursive --exclude "*" --include "*.yml" + # aws s3 cp deployments s3://security-content/deployments --recursive --exclude "*" --include "*.yml" + aws s3 cp dist/api s3://security-content/json --recursive --exclude "*" --include "version.json" - name: Security Content API Smoke Test run: | From a73f7a90773c3b7c02980e943392c537b6f479d8 Mon Sep 17 00:00:00 2001 From: Danny Leung Date: Thu, 28 Apr 2022 14:48:02 -0700 Subject: [PATCH 12/17] PEX-63: debug cp s3 --- .github/workflows/build-and-validate.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-and-validate.yml b/.github/workflows/build-and-validate.yml index 52bae7a15b..efb76dc2f9 100644 --- a/.github/workflows/build-and-validate.yml +++ b/.github/workflows/build-and-validate.yml @@ -580,6 +580,8 @@ jobs: # aws s3 cp lookups s3://security-content/lookups --recursive --exclude "*" --include "*.mlmodel" # aws s3 cp macros s3://security-content/macros --recursive --exclude "*" --include "*.yml" # aws s3 cp deployments s3://security-content/deployments --recursive --exclude "*" --include "*.yml" + echo "ready to copy... dist/api to s3" + ls -ahl dist/api aws s3 cp dist/api s3://security-content/json --recursive --exclude "*" --include "version.json" - name: Security Content API Smoke Test From 2752a930adc2e367ff46736dd41de1f9818b260e Mon Sep 17 00:00:00 2001 From: Danny Leung Date: Thu, 28 Apr 2022 15:03:43 -0700 Subject: [PATCH 13/17] PEX-63: add version build dependency before upload --- .github/workflows/build-and-validate.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-and-validate.yml b/.github/workflows/build-and-validate.yml index efb76dc2f9..aa9629e908 100644 --- a/.github/workflows/build-and-validate.yml +++ b/.github/workflows/build-and-validate.yml @@ -531,6 +531,7 @@ jobs: master-api-update: runs-on: ubuntu-latest #needs: [validate-content, build-sources, build-package, run-appinspect, create-report, update-sources-github, publish-github-release, attack-range-update] + needs: [build-version-json] #Only run when tagged #if: startsWith(github.ref, 'refs/tags/') steps: From bf282e4eeb860f15be695a88e899f908faebae02 Mon Sep 17 00:00:00 2001 From: Danny Leung Date: Thu, 28 Apr 2022 15:18:34 -0700 Subject: [PATCH 14/17] PEX-63: move version generation into API update job --- .github/workflows/build-and-validate.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-validate.yml b/.github/workflows/build-and-validate.yml index aa9629e908..deba53f0df 100644 --- a/.github/workflows/build-and-validate.yml +++ b/.github/workflows/build-and-validate.yml @@ -560,7 +560,18 @@ jobs: run: | source venv/bin/activate python3 contentctl.py --path . generate --product API --output dist/api - + + - name: Generate content version and timestamp JSON + run : | + curl -o version-api.json https://api.github.com/repositories/162346001/releases/latest + VERSION_VAL=$(cat version-api.json | jq '.name') + VERSION_TS=$(cat version-api.json | jq '.published_at') + echo "{\"version\":{\"name\":$VERSION_VAL,\"published_at\":$VERSION_TS}}" > dist/api/version.json + ls -ahl dist/api/version.json + echo "contents of version.json:" + cat dist/api/version.json + + #Official, Verified Amazon-AWS Github Account Provided Action - uses: aws-actions/configure-aws-credentials@v1 with: From 15bcaa9082c95db71ae331a4016b062b5712f05b Mon Sep 17 00:00:00 2001 From: Danny Leung Date: Thu, 28 Apr 2022 15:33:46 -0700 Subject: [PATCH 15/17] PEX-63: debug --- .github/workflows/build-and-validate.yml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.github/workflows/build-and-validate.yml b/.github/workflows/build-and-validate.yml index deba53f0df..e50f098ff2 100644 --- a/.github/workflows/build-and-validate.yml +++ b/.github/workflows/build-and-validate.yml @@ -200,22 +200,6 @@ jobs: content-pack-build-escu.tar.gz content-pack-build-ssa.tar.gz - build-version-json: - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Update Version and Build number - run : | - curl -o version-api.json https://api.github.com/repositories/162346001/releases/latest - VERSION_VAL=$(cat version-api.json | jq '.name') - VERSION_TS=$(cat version-api.json | jq '.published_at') - echo "{\"version\":{\"name\":$VERSION_VAL,\"published_at\":$VERSION_TS}}" > dist/api/version.json - ls -ahl dist/api/version.json - echo "contents of version.json:" - cat dist/api/version.json - - build-package: runs-on: ubuntu-latest needs: [validate-content, build-sources] @@ -531,7 +515,6 @@ jobs: master-api-update: runs-on: ubuntu-latest #needs: [validate-content, build-sources, build-package, run-appinspect, create-report, update-sources-github, publish-github-release, attack-range-update] - needs: [build-version-json] #Only run when tagged #if: startsWith(github.ref, 'refs/tags/') steps: @@ -567,7 +550,6 @@ jobs: VERSION_VAL=$(cat version-api.json | jq '.name') VERSION_TS=$(cat version-api.json | jq '.published_at') echo "{\"version\":{\"name\":$VERSION_VAL,\"published_at\":$VERSION_TS}}" > dist/api/version.json - ls -ahl dist/api/version.json echo "contents of version.json:" cat dist/api/version.json From b0cc63f715d75f4b0ec2bfccb00b45ea7d8ece52 Mon Sep 17 00:00:00 2001 From: Danny Leung Date: Fri, 29 Apr 2022 16:28:07 -0700 Subject: [PATCH 16/17] PEX-63: remove comments --- .github/workflows/build-and-validate.yml | 28 +++++++++++------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build-and-validate.yml b/.github/workflows/build-and-validate.yml index e50f098ff2..cb6f09b7c0 100644 --- a/.github/workflows/build-and-validate.yml +++ b/.github/workflows/build-and-validate.yml @@ -514,9 +514,9 @@ jobs: master-api-update: runs-on: ubuntu-latest - #needs: [validate-content, build-sources, build-package, run-appinspect, create-report, update-sources-github, publish-github-release, attack-range-update] + needs: [validate-content, build-sources, build-package, run-appinspect, create-report, update-sources-github, publish-github-release, attack-range-update] #Only run when tagged - #if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') steps: - name: Checkout Repo uses: actions/checkout@v2 @@ -564,19 +564,17 @@ jobs: - name: Update API sources run: | - # aws s3 rm s3://security-content --recursive --exclude "*" --include "*.yml" - # aws s3 cp stories s3://security-content/stories --recursive --exclude "*" --include "*.yml" - # aws s3 cp baselines s3://security-content/baselines --recursive --exclude "*" --include "*.yml" - # aws s3 cp detections s3://security-content/detections --recursive --exclude "*" --include "*.yml" - # aws s3 cp playbooks s3://security-content/playbooks --recursive --exclude "*" --include "*.yml" - # aws s3 cp lookups s3://security-content/lookups --recursive --exclude "*" --include "*.yml" - # aws s3 cp lookups s3://security-content/lookups --recursive --exclude "*" --include "*.csv" - # aws s3 cp lookups s3://security-content/lookups --recursive --exclude "*" --include "*.mlmodel" - # aws s3 cp macros s3://security-content/macros --recursive --exclude "*" --include "*.yml" - # aws s3 cp deployments s3://security-content/deployments --recursive --exclude "*" --include "*.yml" - echo "ready to copy... dist/api to s3" - ls -ahl dist/api - aws s3 cp dist/api s3://security-content/json --recursive --exclude "*" --include "version.json" + aws s3 rm s3://security-content --recursive --exclude "*" --include "*.yml" + aws s3 cp stories s3://security-content/stories --recursive --exclude "*" --include "*.yml" + aws s3 cp baselines s3://security-content/baselines --recursive --exclude "*" --include "*.yml" + aws s3 cp detections s3://security-content/detections --recursive --exclude "*" --include "*.yml" + aws s3 cp playbooks s3://security-content/playbooks --recursive --exclude "*" --include "*.yml" + aws s3 cp lookups s3://security-content/lookups --recursive --exclude "*" --include "*.yml" + aws s3 cp lookups s3://security-content/lookups --recursive --exclude "*" --include "*.csv" + aws s3 cp lookups s3://security-content/lookups --recursive --exclude "*" --include "*.mlmodel" + aws s3 cp macros s3://security-content/macros --recursive --exclude "*" --include "*.yml" + aws s3 cp deployments s3://security-content/deployments --recursive --exclude "*" --include "*.yml" + aws s3 cp dist/api s3://security-content/json --recursive --exclude "*" --include "*.json" - name: Security Content API Smoke Test run: | From eebb13e0b850353dc1fea6cf9a4f7700a10afdb5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 May 2022 15:59:59 +0000 Subject: [PATCH 17/17] Bump nokogiri from 1.13.3 to 1.13.4 in /docs Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.3 to 1.13.4. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.13.3...v1.13.4) --- updated-dependencies: - dependency-name: nokogiri dependency-type: indirect ... Signed-off-by: dependabot[bot] --- docs/Gemfile.lock | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 00fac264d7..fe8e8133c2 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -244,14 +244,19 @@ GEM rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) mercenary (0.3.6) - mini_portile2 (2.7.1) + mini_portile2 (2.8.0) minima (2.5.1) jekyll (>= 3.5, < 5.0) jekyll-feed (~> 0.9) jekyll-seo-tag (~> 2.1) minitest (5.15.0) multipart-post (2.1.1) - nokogiri (1.13.3-x86_64-linux) + nokogiri (1.13.4) + mini_portile2 (~> 2.8.0) + racc (~> 1.4) + nokogiri (1.13.4-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.13.4-x86_64-linux) racc (~> 1.4) octokit (4.22.0) faraday (>= 0.9)