Apps agent interface: placement, credential check, and minimal ITSI merge

Open
#124 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
58/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend, cli

Research direction

Start by reading the existing project_hit search code, Splunkbase timeout handling, spa apps download credential precedence, COMMAND_SCHEMA, and spa config merge transaction and validation paths. Check the related tests and template listing before making changes. Done means the placement and timeout responses, credential check, reference update, and itsi-minimal template and merge behavior all match the stated cases, with credentials absent from output.

Written by the indexing model from the issue text.

Description

enhancement

Summary

An agent can see where Splunkbase app 833 belongs, check whether Splunkbase credentials are set without printing them, and apply the minimal ITSI app set with spa config merge itsi-minimal --yes.

Slice of #67: app placement, field-report items 2, 4, 6, and 7. The rest of the skills pack stays on #67.

Placement on search rows

project_hit adds optional placement fields.

  • When the Splunkbase record already has docs_url or documentation, pass that link through as install_docs_url. Leave the HTML unfetched.
  • App id 833 always includes this placement, even when the raw record has no docs link:
    • roles: search_head, indexer, heavy_forwarder, universal_forwarder
    • install_docs_url: https://splunk.github.io/splunk-add-on-for-unix-and-linux/Install/
    • placement_confidence: high
    • placement_source: that same URL
  • Other app ids keep only fields present on the Splunkbase record. A search hit for app 9999 has no roles key.

Splunkbase timeout

Search, snippet, and app-get use a 20 second timeout. A timeout is a retryable failure:

  • ok: false
  • schema_version present
  • error begins with Splunkbase request timed out
  • retryable: true
  • the object has no data key

Download may keep a longer timeout. Search, snippet, and get pass 20 seconds explicitly.

Credential check

spa apps auth check returns only username_set and password_set, using the same precedence as spa apps download. The command reports those two booleans and leaves the values out of stdout, stderr, and errors.

With SPLUNKBASE_PASSWORD set and no username, the JSON is {"username_set": false, "password_set": true}.

Register the action in COMMAND_SCHEMA. Regenerate docs/commands.md only after the drift test fails.

In skills/spa/spa-create-config/references/secrets-handling.md, replace both ${!v} loops with spa apps auth check. This slice edits that secrets-handling reference only.

Minimal ITSI template

Ship examples/templates/itsi-minimal.yml. The first comment line is the spa config templates summary. App ids, in order: 1841 (premium_app: itsi, no target_roles), then 2882, 2890, and 1621 (each source: splunkbase and target_roles: [search_head]).

# Minimal ITSI apps: 1841, 2882, 2890, and 1621. No content library, playbooks, Java, or license files.
splunk_app_deployment:
  apps:
    - name: Splunk IT Service Intelligence
      source: splunkbase
      app_id: 1841
      premium_app: itsi
    - name: Splunk_SA_Scientific_Python_linux_x86_64
      source: splunkbase
      app_id: 2882
      target_roles: [search_head]
    - name: Splunk_ML_Toolkit
      source: splunkbase
      app_id: 2890
      target_roles: [search_head]
    - name: Splunk_SA_CIM
      source: splunkbase
      app_id: 1621
      target_roles: [search_head]

spa config merge applies the fragment in the existing config transaction.

  • spa config merge itsi-minimal --dry-run previews and leaves the file unchanged.
  • Without --yes, a non-interactive human run leaves the file unchanged.
  • spa config merge itsi-minimal --yes writes all four apps in one revision, or writes nothing if validation fails.
  • A second apply leaves the file bytes unchanged.
  • Agent mode already writes spa config mutations without --yes. Leave that gate as it is.
  • The merge command needs no COMMAND_SCHEMA change and no docs/commands.md regen.
  • Merge onto a config that already has search_head, indexer, and license_manager. A config missing one of those roles fails validation and stays unchanged.
  • spa config templates lists itsi-minimal (that summary line) before os-tools, matching sorted template names.

The template and the merged config contain app ids 1841, 2882, 2890, and 1621 only. They omit content-pack id 5391 and omit run_playbook.

Out of scope

  • Content library 5391, customizations, and playbooks.
  • os packages, splunk_license_file, and a new host. Java, license files, and license_manager stay off the fragment: merge matches hosts by name, and ITSI validation already requires search_head, indexer, and license_manager on the target.
  • #52 (credentials / spa auth) and #68 (single-app deploy).
  • Examples, help text, and errors that contain a Splunkbase password.

Related

  • #67 (parent: skills, agents, and runbooks)
  • #59 (Splunkbase search, snippet, download)
  • #76 (config merge)

Notes

Pickup-ready enhancement. Report credential presence only. Leave secret values, PEM material, AWS keys, and license XML out of output.

Dominant language
Python
Stars
138
Forks
51
Avg merge
1h 38m
Merged PRs (30d)
48

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from splunk/splunk-platform-automator

All issues in splunk/splunk-platform-automator

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.