Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ocp-admin/skills/cluster-report/docs/multi-cluster-auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ If you're currently logged into all the clusters you would like to get a report

```bash
# Step 1: Setup — applies RBAC to each cluster, extracts SA tokens
python3 ocp-admin/scripts/cluster-report/build-kubeconfig.py setup --all-contexts
python3 scripts/build-kubeconfig.py setup --all-contexts

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I identify two issues:

  1. the build-kubeconfig.py file doesn't exist in the scripts directory, so it will fail
  2. I'm missing the SCRIPTS_DIR validation like in the rest of the skills
SCRIPTS_DIR="scripts"
test -f "$SCRIPTS_DIR/validate_input.py" || { echo "Error: Scripts directory not found at $SCRIPTS_DIR"; exit 1; }


# Step 2: Build — assembles a merged kubeconfig from the inventory
python3 ocp-admin/scripts/cluster-report/build-kubeconfig.py \
python3 scripts/build-kubeconfig.py \
build --clusters ~/.ocp-clusters/clusters.json --verify

# Step 3: Use — export and run the skill
Expand Down Expand Up @@ -105,7 +105,7 @@ Set permissions: `chmod 600 ~/.ocp-clusters/clusters.json`
### 4. Build Kubeconfig

```bash
python3 ocp-admin/scripts/cluster-report/build-kubeconfig.py \
python3 scripts/build-kubeconfig.py \
build --clusters ~/.ocp-clusters/clusters.json --output ~/.kube/cluster-report-kubeconfig
```

Expand Down
4 changes: 2 additions & 2 deletions rh-basic/skills/red-hat-product-lifecycle/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ When the user asks about lifecycle status, support phases, or EOL dates for any
1. Identify product and version from the user message.
2. Run the lifecycle script via Bash:
```
python rh-basic/skills/red-hat-product-lifecycle/scripts/rh_lifecycle.py "Product Name Version"
python scripts/rh_lifecycle.py "Product Name Version"
```
The script queries `https://access.redhat.com/product-life-cycles/api/v1/products` and returns JSON to stdout.
Errors are on stderr (JSON with `"error"` key); exit code 1 on failure.
Expand All @@ -48,7 +48,7 @@ Dates are `YYYY-MM-DD`; `"N/A"` means no date; `"Ongoing"` means open-ended.

## Dependencies

Script: `rh-basic/skills/red-hat-product-lifecycle/scripts/rh_lifecycle.py`
Script: `scripts/rh_lifecycle.py`

## Lifecycle Phase Reference

Expand Down
10 changes: 5 additions & 5 deletions rh-sre/skills/cve-impact/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: |

NOT for remediation (use `/remediation`).

System-level: FIRST reply = pagination prompt (Step -1). Parsing: references/01-cve-response-parser.py.
System-level: FIRST reply = pagination prompt (Step -1). Parsing: scripts/01-cve-response-parser.py.
model: inherit
color: blue
license: Apache-2.0
Expand Down Expand Up @@ -321,7 +321,7 @@ Check if automated playbook or manual steps are available.

| File | Use When |
|------|----------|
| [01-cve-response-parser.py](references/01-cve-response-parser.py) | Parse/filter MCP vulnerability responses |
| [01-cve-response-parser.py](scripts/01-cve-response-parser.py) | Parse/filter MCP vulnerability responses |
| [02-cve-parsing-guide.md](references/02-cve-parsing-guide.md) | Parser invocation, filter options |
| [03-output-templates.md](references/03-output-templates.md) | Report format |
| [04-examples.md](references/04-examples.md) | Query-type examples |
Expand All @@ -335,9 +335,9 @@ Check if automated playbook or manual steps are available.
**Do NOT generate inline Python** to aggregate multiple page files—the parser accepts multiple file paths and produces aggregated reports.

**Read** [references/02-cve-parsing-guide.md](references/02-cve-parsing-guide.md) for:
- Parser location: `references/01-cve-response-parser.py`
- Single page: `python3 rh-sre/skills/cve-impact/references/01-cve-response-parser.py <response.json>`
- Multiple pages: `python3 .../01-cve-response-parser.py page1.json page2.json page3.json ...` (merges, dedupes, aggregated report)
- Parser location: `scripts/01-cve-response-parser.py`
- Single page: `python3 scripts/01-cve-response-parser.py <response.json>`
- Multiple pages: `python3 scripts/01-cve-response-parser.py page1.json page2.json page3.json ...` (merges, dedupes, aggregated report)
- Filter options: `FILTER_REMEDIATABLE=1`, `FILTER_IMPACT=Critical,Important`
- Report format: `OUTPUT=report`, `SYSTEM_NAME=hostname` for aggregated multi-page reports

Expand Down
26 changes: 13 additions & 13 deletions rh-sre/skills/cve-impact/references/02-cve-parsing-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
## Parser Location

```
rh-sre/skills/cve-impact/references/01-cve-response-parser.py
scripts/01-cve-response-parser.py
```

From workspace root: `rh-sre/skills/cve-impact/references/01-cve-response-parser.py`
Skill-relative path: `scripts/01-cve-response-parser.py`

## How to Invoke

Expand All @@ -32,21 +32,21 @@ From workspace root: `rh-sre/skills/cve-impact/references/01-cve-response-parser
Save the MCP tool result to a file, then run:

```bash
python3 rh-sre/skills/cve-impact/references/01-cve-response-parser.py /path/to/response.json
python3 scripts/01-cve-response-parser.py /path/to/response.json
```

### Option 2: stdin

```bash
python3 rh-sre/skills/cve-impact/references/01-cve-response-parser.py < /path/to/response.json
python3 scripts/01-cve-response-parser.py < /path/to/response.json
```

### Option 3: From MCP tool result file

When the MCP tool writes to a file (e.g. `tool-results/toolu_xxx.txt`):

```bash
python3 rh-sre/skills/cve-impact/references/01-cve-response-parser.py /path/to/tool-results/toolu_xxx.txt
python3 scripts/01-cve-response-parser.py /path/to/tool-results/toolu_xxx.txt
```

### Option 4: Multiple page files (aggregated report)
Expand All @@ -55,7 +55,7 @@ When you have multiple paginated responses (e.g. pages 1–5 from `vulnerability

```bash
FILTER_REMEDIATABLE=1 FILTER_IMPACT=Critical,Important OUTPUT=report SYSTEM_NAME=ip-172-31-32-201.eu-west-3.compute.internal \
python3 rh-sre/skills/cve-impact/references/01-cve-response-parser.py page1.json page2.json page3.json page4.json page5.json
python3 scripts/01-cve-response-parser.py page1.json page2.json page3.json page4.json page5.json
```

**Do NOT generate inline Python** to loop over page files—use the parser with multiple paths.
Expand All @@ -75,28 +75,28 @@ FILTER_REMEDIATABLE=1 FILTER_IMPACT=Critical,Important OUTPUT=report SYSTEM_NAME

**Remediatable CVEs only:**
```bash
FILTER_REMEDIATABLE=1 python3 rh-sre/skills/cve-impact/references/01-cve-response-parser.py response.json
FILTER_REMEDIATABLE=1 python3 scripts/01-cve-response-parser.py response.json
```

**Critical/Important only:**
```bash
FILTER_IMPACT=Critical,Important python3 rh-sre/skills/cve-impact/references/01-cve-response-parser.py response.json
FILTER_IMPACT=Critical,Important python3 scripts/01-cve-response-parser.py response.json
```

**Remediatable + Critical/Important:**
```bash
FILTER_REMEDIATABLE=1 FILTER_IMPACT=Critical,Important python3 rh-sre/skills/cve-impact/references/01-cve-response-parser.py response.json
FILTER_REMEDIATABLE=1 FILTER_IMPACT=Critical,Important python3 scripts/01-cve-response-parser.py response.json
```

**Aggregated report from multiple pages:**
```bash
FILTER_REMEDIATABLE=1 FILTER_IMPACT=Critical,Important OUTPUT=report SYSTEM_NAME=ip-172-31-32-201.eu-west-3.compute.internal \
python3 rh-sre/skills/cve-impact/references/01-cve-response-parser.py page1.json page2.json page3.json page4.json page5.json
python3 scripts/01-cve-response-parser.py page1.json page2.json page3.json page4.json page5.json
```

**JSON output (for further processing):**
```bash
OUTPUT=json python3 rh-sre/skills/cve-impact/references/01-cve-response-parser.py response.json
OUTPUT=json python3 scripts/01-cve-response-parser.py response.json
```

## Response Structure (Lightspeed MCP)
Expand Down Expand Up @@ -142,6 +142,6 @@ Key fields:
1. Call MCP tool (`vulnerability__get_system_cves` or `vulnerability__get_cves`) — one or more times (paginated)
2. Save each response to file (MCP may write to `tool-results/` or you save from result)
3. **Run parser** (required—do not use jq or inline Python):
- Single page: `python3 rh-sre/skills/cve-impact/references/01-cve-response-parser.py <file>`
- Multiple pages: `python3 rh-sre/skills/cve-impact/references/01-cve-response-parser.py page1.json page2.json ...`
- Single page: `python3 scripts/01-cve-response-parser.py <file>`
- Multiple pages: `python3 scripts/01-cve-response-parser.py page1.json page2.json ...`
4. Use parser output for summary tables and user-facing reports
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ vulnerability__get_cves(

## Step 4: After Listing

- **Parse response** (if needed): Use [references/01-cve-response-parser.py](../references/01-cve-response-parser.py). Do NOT use jq or inline Python. See [02-cve-parsing-guide.md](../references/02-cve-parsing-guide.md).
- **Parse response** (if needed): Use [scripts/01-cve-response-parser.py](../../scripts/01-cve-response-parser.py). Do NOT use jq or inline Python. See [02-cve-parsing-guide.md](../02-cve-parsing-guide.md).
- Sort by CVSS score (highest first) or by affected system count
- Provide summary table: CVE ID, severity, affected systems count, remediation availability
- Offer to analyze a specific CVE (see [SKILL.md](../SKILL.md) — Step 2: CVE Information Retrieval)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,6 @@ while (strategy allows):

## Step 6: After Retrieval

- **Parse response**: Use [references/01-cve-response-parser.py](../references/01-cve-response-parser.py). Do NOT use jq or inline Python. See [02-cve-parsing-guide.md](../references/02-cve-parsing-guide.md).
- **Parse response**: Use [scripts/01-cve-response-parser.py](../../scripts/01-cve-response-parser.py). Do NOT use jq or inline Python. See [02-cve-parsing-guide.md](../02-cve-parsing-guide.md).
- Sort by CVSS score (highest first)
- Provide summary table; offer to analyze specific CVEs or create remediation plan (`/remediation` skill)
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,6 @@ After filtering for remediatable, optionally filter by severity:

## Step 6: After Retrieval

- **Parse response**: Use [references/01-cve-response-parser.py](../references/01-cve-response-parser.py) with `FILTER_REMEDIATABLE=1`. Do NOT use jq or inline Python. See [02-cve-parsing-guide.md](../references/02-cve-parsing-guide.md).
- **Parse response**: Use [scripts/01-cve-response-parser.py](../../scripts/01-cve-response-parser.py) with `FILTER_REMEDIATABLE=1`. Do NOT use jq or inline Python. See [02-cve-parsing-guide.md](../02-cve-parsing-guide.md).
- Sort by CVSS score (highest first)
- Provide summary table; offer to analyze specific CVEs or create remediation plan (`/remediation` skill)