From 8074e598e60de192301a38f83688c8405050f4e6 Mon Sep 17 00:00:00 2001 From: coreymbe Date: Mon, 22 Apr 2024 14:52:16 -0700 Subject: [PATCH] (PIE-1089) Splunk Add-on Builder updates --- .github/workflows/release.yml | 16 +++++++++++----- .github/workflows/validation.yml | 17 ++++++++++------- README.md | 4 ++-- TA-puppet-alert-orchestrator/README.md | 15 ++++++--------- TA-puppet-alert-orchestrator/app.manifest | 2 +- .../appserver/static/js/build/common.js | 2 +- .../default/addon_builder.conf | 4 ++-- TA-puppet-alert-orchestrator/default/app.conf | 2 +- .../readme/CHANGELOG.md | 12 ++++++++++++ .../readme/PUBLISHING.md | 2 +- 10 files changed, 47 insertions(+), 29 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e23e5d1..dfb05fb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,20 +8,26 @@ on: jobs: package-app: runs-on: ubuntu-latest - container: ghcr.io/coreymbe/splunk-appinspect:v2 + container: ghcr.io/coreymbe/splunk-appinspect:v3 steps: - uses: actions/checkout@v4 - name: Set Version ID id: version-tag - run: echo ::set-output name=version::${GITHUB_REF#refs/*/} + run: echo "version=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT + + - name: Set App Name + id: repo-name + run: | + repo_name=$(basename ${{ github.repository }}) + echo "splunk_app=$repo_name" >> $GITHUB_OUTPUT - name: Build and Package App - run: slim package TA-puppet-alert-orchestrator + run: slim package ${{ steps.repo-name.outputs.splunk_app }} - name: Upload App Build uses: actions/upload-artifact@v4 with: - name: TA-puppet-alert-orchestrator-${{ steps.version-tag.outputs.version }} - path: TA-puppet-alert-orchestrator-*.tar.gz + name: ${{ steps.repo-name.outputs.splunk_app }}-${{ steps.version-tag.outputs.version }} + path: ${{ steps.repo-name.outputs.splunk_app }}-*.tar.gz diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 672fa6a..2dbe81a 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -8,28 +8,31 @@ on: jobs: appinspect: runs-on: ubuntu-latest - container: ghcr.io/coreymbe/splunk-appinspect:v2 + container: ghcr.io/coreymbe/splunk-appinspect:v3 steps: - uses: actions/checkout@v4 - - name: Install JQ - run: apt update && apt install -y jq + - name: Set App Name + id: repo-name + run: | + repo_name=$(basename ${{ github.repository }}) + echo "splunk_app=$repo_name" >> $GITHUB_OUTPUT - name: Run AppInspect - run: splunk-appinspect inspect TA-puppet-alert-orchestrator --output-file appinspect_result.json --mode precert + run: splunk-appinspect inspect ${{ steps.repo-name.outputs.splunk_app }} --output-file appinspect_result.json --mode precert --included-tags cloud - name: Check AppInspect Errors id: appinspect-errors run: | error_check=$(jq '.summary.error' appinspect_result.json) - echo "::set-output name=error_count::$error_check" + echo "error_count=$error_check" >> $GITHUB_OUTPUT - name: Check AppInspect Failures id: appinspect-failures run: | fail_check=$(jq '.summary.failure' appinspect_result.json) - echo "::set-output name=fail_count::$fail_check" + echo "fail_count=$fail_check" >> $GITHUB_OUTPUT - name: AppInspect Errors if: ${{ steps.appinspect-errors.outputs.error_count > 0 }} @@ -46,5 +49,5 @@ jobs: - name: Upload AppInspect Results uses: actions/upload-artifact@v4 with: - name: AppInspect_TA-puppet-alert-orchestrator + name: AppInspect_${{ steps.repo-name.outputs.splunk_app }} path: appinspect_result.json diff --git a/README.md b/README.md index f68c779..554882f 100644 --- a/README.md +++ b/README.md @@ -13,11 +13,11 @@ This Splunk add-on can be used to trigger Puppet Enterprise Orchestration actions such as plan or task execution; as well as generating detailed Puppet report data. -This add-on is intended to be used alongside the [Puppet Report Viewer](https://splunkbase.splunk.com/app/4413/), with data provided by the [splunk_hec](https://forge.puppet.com/puppetlabs/splunk_hec) report processor available on the Puppet Forge. +This add-on is intended to be used alongside the [Puppet Report Viewer app for Splunk](https://splunkbase.splunk.com/app/4413/), with data provided by the [splunk_hec](https://forge.puppet.com/puppetlabs/splunk_hec) report processor available on the Puppet Forge. ## Configuration -After installing and configuring both the `splunk_hec` Puppet module and the Puppet Report Viewer app for Splunk; follow the steps below to configure the [Puppet Alert Orchestrator add-on for Splunk](https://splunkbase.splunk.com/app/4928/): +After installing and configuring both the `splunk_hec` Puppet module and the Puppet Report Viewer app for Splunk; follow the steps below to configure the [Puppet Alert Orchestrator add-on for Splunk](https://splunkbase.splunk.com/app/7318/): ### Configuration Tabs diff --git a/TA-puppet-alert-orchestrator/README.md b/TA-puppet-alert-orchestrator/README.md index 85cd02e..7042912 100644 --- a/TA-puppet-alert-orchestrator/README.md +++ b/TA-puppet-alert-orchestrator/README.md @@ -13,7 +13,7 @@ This Splunk add-on can be used to trigger Puppet Enterprise Orchestration actions such as plan or task execution; as well as generating detailed Puppet report data. -This add-on is intended to be used alongside the [Puppet Report Viewer](https://splunkbase.splunk.com/app/4413/), with data provided by the [splunk_hec](https://forge.puppet.com/puppetlabs/splunk_hec) report processor available on the Puppet Forge. +This add-on is intended to be used alongside the [Puppet Report Viewer app for Splunk](https://splunkbase.splunk.com/app/4413/), with data provided by the [splunk_hec](https://forge.puppet.com/puppetlabs/splunk_hec) report processor available on the Puppet Forge. ## Configuration @@ -30,14 +30,12 @@ Add account details for multiple PE RBAC users. * **Password**: Password _or_ PE RBAC Token * Check the `pe_token` checkbox if you provide a PE RBAC Token instead of a password. -![Account](readme/img/account_config.png) +![Account](322b0a10-fceb-11ee-aed0-9ac19b020734.png) #### Logging Default log level is `INFO`. -![Logging](readme/img/logging_config.png) - #### Add-on settings The following are required fields. @@ -49,7 +47,7 @@ The following are required fields. **Note**: See the [Splunk HEC Documentation](https://docs.splunk.com/Documentation/Splunk/latest/Data/UsetheHTTPEventCollector) for details on determining the correct URL for your HEC endpoint. -![Settings](readme/img/settings_config.png) +![Settings](cd719d1e-fcea-11ee-91e6-52042cae3bc7.png) **Note**: Once the add-on has been configured, Splunk will need to be restarted. @@ -57,7 +55,6 @@ The following are required fields. The Orchestrator Actions dashboard is powered by a custom input script which utilizes the configured account credentials to query Puppet Enterprise for Tasks and Plans available to that particular RBAC user. -![Actions](readme/img/orchestrator_actions.png) #### Splunk Cloud @@ -91,15 +88,15 @@ Once the add-on has been properly configured you can begin creating new Alerts t 1. Create a Splunk search: - ![Splunk Search](readme/img/splunk_search.png) + ![Splunk Search](d08e551e-fcea-11ee-83a8-92aa9ede6029.png) 2. Save the search as an Alert: - ![Save Splunk Search](readme/img/save_as_alert.png) + ![Save Splunk Search](caa740c0-fcea-11ee-95bf-8a4951598e2a.png) 3. Configure the Alert Actions: - ![Alert Action Configuration](readme/img/alert_options.png) + ![Alert Action Configuration](c5c4b83a-fcea-11ee-93e7-9ac19b020734.png) ## Example Searches diff --git a/TA-puppet-alert-orchestrator/app.manifest b/TA-puppet-alert-orchestrator/app.manifest index a3551a4..d880320 100644 --- a/TA-puppet-alert-orchestrator/app.manifest +++ b/TA-puppet-alert-orchestrator/app.manifest @@ -5,7 +5,7 @@ "id": { "group": null, "name": "TA-puppet-alert-orchestrator", - "version": "1.0.0" + "version": "1.0.1" }, "author": [ { diff --git a/TA-puppet-alert-orchestrator/appserver/static/js/build/common.js b/TA-puppet-alert-orchestrator/appserver/static/js/build/common.js index 9bfa890..bd55de1 100644 --- a/TA-puppet-alert-orchestrator/appserver/static/js/build/common.js +++ b/TA-puppet-alert-orchestrator/appserver/static/js/build/common.js @@ -131,7 +131,7 @@ levels:r}}()}),i.define("/lib/utils.js",function(e,t,n,i,r){/*!*/ _shouldAutoLogin:function(){return this.username&&this.password&&this.autologin},/*!*/ _requestWrapper:function(e,t){t=t||function(){};var n=this,i=null,r=function(r){i.wasAborted||(r&&401===r.status&&n._shouldAutoLogin()?(n.sessionKey=null,n.login(function(n,r){i.wasAborted||(n?t(n):e(t))})):t.apply(null,arguments))};return i=!this._shouldAutoLogin()||this.sessionKey?e(r):this.login(function(n,r){i.wasAborted||(n?t(n):e(t))})},fullpath:function(e,t){if(t=t||{},s.startsWith(e,"/"))return e;if(!t.app&&!this.app&&t.sharing!==a.Sharing.SYSTEM)return"/services/"+e;var n=t.owner||this.owner||"-",i=t.app||this.app||"-";return t.sharing=(t.sharing||"").toLowerCase(),t.sharing===a.Sharing.APP||t.sharing===a.Sharing.GLOBAL?n="nobody":t.sharing===a.Sharing.SYSTEM&&(n="nobody",i="system"),s.trim("/servicesNS/"+encodeURIComponent(n)+"/"+encodeURIComponent(i)+"/"+e)},urlify:function(e){return this.prefix+this.fullpath(e)},login:function(e){var t=this,n=this.paths.login,i={username:this.username,password:this.password};e=e||function(){};var r=function(n,i){var r=!(n||!i.data||!i.data.sessionKey);n||!r?e(n||"No session key available",!1):(t.sessionKey=i.data.sessionKey,e(null,!0))};return this.http.post(this.urlify(n),this._headers(),i,this.timeout,r)},get:function(e,t,n){var i=this,r=function(n){return i.http.get(i.urlify(e),i._headers(),t,i.timeout,n)};return this._requestWrapper(r,n)},del:function(e,t,n){var i=this,r=function(n){return i.http.del(i.urlify(e),i._headers(),t,i.timeout,n)};return this._requestWrapper(r,n)},post:function(e,t,n){var i=this,r=function(n){return i.http.post(i.urlify(e),i._headers(),t,i.timeout,n)};return this._requestWrapper(r,n)},request:function(e,t,n,i,r,o,s){var a=this,l=function(s){return a.http.request(a.urlify(e),{method:t,headers:a._headers(o),query:n,post:i,body:r,timeout:a.timeout},s)};return this._requestWrapper(l,s)},versionCompare:function(e){var t=this.version;"default"===t&&(t="5.0");for(var n=t.split("."),i=e.split("."),r=Math.max(n.length,i.length),o=0;oa)return 1}return 0}}),/*!*/ a.Sharing={USER:"user",APP:"app",GLOBAL:"global",SYSTEM:"system"}}()}),i.define("/lib/paths.js",function(e,t,n,i,r){/*!*/ -!function(){"use strict";var e=n||this;e.Paths={apps:"/services/apps/local",capabilities:"authorization/capabilities",configurations:"configs",dataModels:"datamodel/model",deploymentClient:"deployment/client",deploymentServers:"deployment/server",deploymentServerClasses:"deployment/serverclass",deploymentTenants:"deployment/tenants",eventTypes:"saved/eventtypes",firedAlerts:"alerts/fired_alerts",indexes:"data/indexes",info:"/services/server/info",inputs:null,jobs:"search/jobs",licenseGroups:"licenser/groups",licenseMessages:"licenser/messages",licensePools:"licenser/pools",licenseSlaves:"licenser/slaves",licenseStacks:"licenser/stacks",licenses:"licenser/licenses",loggers:"server/logger",login:"/services/auth/login",messages:"messages",passwords:"admin/passwords",parser:"search/parser",pivot:"datamodel/pivot",properties:"properties",roles:"authorization/roles",savedSearches:"saved/searches",settings:"server/settings",storagePasswords:"storage/passwords",users:"/services/authentication/users",typeahead:"search/typeahead",views:"data/ui/views",currentUser:"/services/authentication/current-context",submitEvent:"/services/receivers/simple"}}()}),i.define("/lib/jquery.class.js",function(e,t,n,i,r){/*! Simple JavaScript Inheritance +!function(){"use strict";var e=n||this;e.Paths={apps:"/services/apps/local",capabilities:"authorization/capabilities",configurations:"configs",dataModels:"datamodel/model",deploymentClient:"deployment/client",deploymentServers:"deployment/server",deploymentServerClasses:"deployment/serverclass",deploymentTenants:"deployment/tenants",eventTypes:"saved/eventtypes",firedAlerts:"alerts/fired_alerts",indexes:"data/indexes",info:"/services/server/info",inputs:null,jobs:"search/v2/jobs",licenseGroups:"licenser/groups",licenseMessages:"licenser/messages",licensePools:"licenser/pools",licenseSlaves:"licenser/slaves",licenseStacks:"licenser/stacks",licenses:"licenser/licenses",loggers:"server/logger",login:"/services/auth/login",messages:"messages",passwords:"admin/passwords",parser:"search/v2/parser",pivot:"datamodel/pivot",properties:"properties",roles:"authorization/roles",savedSearches:"saved/searches",settings:"server/settings",storagePasswords:"storage/passwords",users:"/services/authentication/users",typeahead:"search/typeahead",views:"data/ui/views",currentUser:"/services/authentication/current-context",submitEvent:"/services/receivers/simple"}}()}),i.define("/lib/jquery.class.js",function(e,t,n,i,r){/*! Simple JavaScript Inheritance * By John Resig http://ejohn.org/ * MIT Licensed. * Inspired by base2 and Prototype diff --git a/TA-puppet-alert-orchestrator/default/addon_builder.conf b/TA-puppet-alert-orchestrator/default/addon_builder.conf index 5962b1c..92ed308 100644 --- a/TA-puppet-alert-orchestrator/default/addon_builder.conf +++ b/TA-puppet-alert-orchestrator/default/addon_builder.conf @@ -1,7 +1,7 @@ # this file is generated by add-on builder automatically # please do not edit it [base] -builder_version = 4.1.1 +builder_version = 4.2.0 builder_build = 0 -is_edited = 1 +is_edited = 0 diff --git a/TA-puppet-alert-orchestrator/default/app.conf b/TA-puppet-alert-orchestrator/default/app.conf index 9c6241a..e9bccb3 100644 --- a/TA-puppet-alert-orchestrator/default/app.conf +++ b/TA-puppet-alert-orchestrator/default/app.conf @@ -7,7 +7,7 @@ build = 5 [launcher] author = Puppet, Inc. -version = 1.0.0 +version = 1.0.1 description = Collection of alert actions specifically for Puppet Enterprise. [ui] diff --git a/TA-puppet-alert-orchestrator/readme/CHANGELOG.md b/TA-puppet-alert-orchestrator/readme/CHANGELOG.md index 86668ef..8ab8d38 100644 --- a/TA-puppet-alert-orchestrator/readme/CHANGELOG.md +++ b/TA-puppet-alert-orchestrator/readme/CHANGELOG.md @@ -1,5 +1,13 @@ # Release Notes +### Puppet Alert Orchestrator add-on for Splunk + +## Version 1.0.1 + +**Fixes**: + + * Updated add-on for compatibility with [Splunk Add-on Builder v4.2.0](https://splunkbase.splunk.com/app/2962). + ## Version 1.0.0 **Breaking Changes**: @@ -18,6 +26,10 @@ * "Run a Puppet Task" **Action**. * When configuring the action, the Task name is populated with the same data as the Orchestrator Actions dashboard. +--- + +### Puppet Alert Actions + ## Version 0.6.0 **Fixes**: diff --git a/TA-puppet-alert-orchestrator/readme/PUBLISHING.md b/TA-puppet-alert-orchestrator/readme/PUBLISHING.md index aa65472..91697ca 100644 --- a/TA-puppet-alert-orchestrator/readme/PUBLISHING.md +++ b/TA-puppet-alert-orchestrator/readme/PUBLISHING.md @@ -11,7 +11,7 @@ First open a release prep PR to update the following files: * `README.md` * `readme/CHANGELOG.md` -Tagging the release in GitHub will trigger the [release workflow](https://github.com/puppetlabs/TA-puppet-alert-actions/workflows/release.yml) to build the app package. +Tagging the release in GitHub will trigger the [release workflow](https://github.com/puppetlabs/TA-puppet-alert-orchestrator/actions/workflows/release.yml) to build the app package. Tag the release with the appropriate version ID and push the tag upstream: