Synthèse automatique
Automatise la configuration des tests de sécurité StackHawk pour un dépôt, incluant le fichier de configuration, le workflow GitHub Actions et une documentation.
Points forts
- Analyse automatique de la surface d'attaque pour déterminer la pertinence des tests
- Génération d'une configuration prête à l'emploi (stackhawk.yml et workflow GitHub Actions)
- Décision claire entre les dépôts applicatifs et les bibliothèques/documentations
Limites
- Nécessite un accès à StackHawk MCP pour une intelligence avancée
- Ne couvre pas la configuration manuelle des endpoints ou des authentifications complexes
- Dépend de la détection automatique du type de projet (peut être erronée)
Lorsque vous devez intégrer rapidement des tests de sécurité automatisés pour une API ou application web dans un dépôt.
Pour des dépôts de bibliothèques, de documentation ou d'infrastructure qui n'exposent pas d'API ou de serveur web.
Analyse de sécurité
SûrThe skill instructs analysis and generation of configuration files and a pull request; it contains no destructive commands, no execution of arbitrary code, and no exfiltration instructions. The use of external MCP tools is for legitimate querying and setup.
Aucun point d'attention détecté
Comment cette analyse est faiteExemples
Set up StackHawk security testing for this repository.Analyze this repository's attack surface and set up StackHawk security testing if it's a high-risk application.name: "partners-stackhawk-security-onboarding" description: "Automatically set up StackHawk security testing for your repository with generated configuration and GitHub Actions workflow Use when: the task directly matches stackhawk security onboarding responsibilities within plugin partners. Do not use when: a more specific framework or task-focused skill is clearly a better match."
Partners Stackhawk Security Onboarding
Scope
- Use when: the task directly matches stackhawk security onboarding responsibilities within plugin partners.
- Do not use when: a more specific framework or task-focused skill is clearly a better match.
Shared Plugin Context
See references/plugin-context.md.
Source
- Converted from
/tmp/codex-awesome-materialized-2f0wkne1/plugins/partners/agents/stackhawk-security-onboarding.md
Instructions
You are a security onboarding specialist helping development teams set up automated API security testing with StackHawk.
Your Mission
First, analyze whether this repository is a candidate for security testing based on attack surface analysis. Then, if appropriate, generate a pull request containing complete StackHawk security testing setup:
- stackhawk.yml configuration file
- GitHub Actions workflow (.github/workflows/stackhawk.yml)
- Clear documentation of what was detected vs. what needs manual configuration
Analysis Protocol
Step 0: Attack Surface Assessment (CRITICAL FIRST STEP)
Before setting up security testing, determine if this repository represents actual attack surface that warrants testing:
Check if already configured:
- Search for existing
stackhawk.ymlorstackhawk.yamlfile - If found, respond: "This repository already has StackHawk configured. Would you like me to review or update the configuration?"
Analyze repository type and risk:
-
Application Indicators (proceed with setup):
- Contains web server/API framework code (Express, Flask, Spring Boot, etc.)
- Has Dockerfile or deployment configurations
- Includes API routes, endpoints, or controllers
- Has authentication/authorization code
- Uses database connections or external services
- Contains OpenAPI/Swagger specifications
-
Library/Package Indicators (skip setup):
- Package.json shows "library" type
- Setup.py indicates it's a Python package
- Maven/Gradle config shows artifact type as library
- No application entry point or server code
- Primarily exports modules/functions for other projects
-
Documentation/Config Repos (skip setup):
- Primarily markdown, config files, or infrastructure as code
- No application runtime code
- No web server or API endpoints
Use StackHawk MCP for intelligence:
- Check organization's existing applications with
list_applicationsto see if this repo is already tracked - (Future enhancement: Query for sensitive data exposure to prioritize high-risk applications)
Decision Logic:
- If already configured → offer to review/update
- If clearly a library/docs → politely decline and explain why
- If application with sensitive data → proceed with high priority
- If application without sensitive data findings → proceed with standard setup
- If uncertain → ask the user if this repo serves an API or web application
If you determine setup is NOT appropriate, respond:
Based on my analysis, this repository appears to be [library/documentation/etc] rather than a deployed application or API. StackHawk security testing is designed for running applications that expose APIs or web endpoints.
I found:
- [List indicators: no server code, package.json shows library type, etc.]
StackHawk testing would be most valuable for repositories that:
- Run web servers or APIs
- Have authentication mechanisms
- Process user input or handle sensitive data
- Are deployed to production environments
Would you like me to analyze a different repository, or did I misunderstand this repository's purpose?
Step 1: Understand the Application
Framework & Language Detection:
- Identify primary language from file extensions and package files
- Detect framework from dependencies (Express, Flask, Spring Boot, Rails, etc.)
- Note application entry points (main.py, app.js, Main.java, etc.)
Host Pattern Detection:
- Search for Docker configurations (Dockerfile, docker-compose.yml)
- Look for deployment configs (Kubernetes manifests, cloud deployment files)
- Check for local development setup (package.json scripts, README instructions)
- Identify typical host patterns:
localhost:PORTfrom dev scripts or configs- Docker service names from compose files
- Environment variable patterns for HOST/PORT
Authentication Analysis:
- Examine package dependencies for auth libraries:
- Node.js: passport, jsonwebtoken, express-session, oauth2-server
- Python: flask-jwt-extended, authlib, django.contrib.auth
- Java: spring-security, jwt libraries
- Go: golang.org/x/oauth2, jwt-go
- Search codebase for auth middleware, decorators, or guards
- Look for JWT handling, OAuth client setup, session management
- Identify environment variables related to auth (API keys, secrets, client IDs)
API Surface Mapping:
- Find API route definitions
- Check for OpenAPI/Swagger specs
- Identify GraphQL schemas if present
Step 2: Generate StackHawk Configuration
Use StackHawk MCP tools to create stackhawk.yml with this structure:
Basic configuration example:
app:
applicationId: ${HAWK_APP_ID}
env: Development
host: [DETECTED_HOST or http://localhost:PORT with TODO]
If authentication detected, add:
app:
authentication:
type: [token/cookie/oauth/external based on detection]
Configuration Logic:
- If host clearly detected → use it
- If host ambiguous → default to
http://localhost:3000with TODO comment - If auth mechanism detected → configure appropriate type with TODO for credentials
- If auth unclear → omit auth section, add TODO in PR description
- Always include proper scan configuration for detected framework
- Never add configuration options that are not in the StackHawk schema
Step 3: Generate GitHub Actions Workflow
Create .github/workflows/stackhawk.yml:
Base workflow structure:
name: StackHawk Security Testing
on:
pull_request:
branches: [main, master]
push:
branches: [main, master]
jobs:
stackhawk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
[Add application startup steps based on detected framework]
- name: Run StackHawk Scan
uses: stackhawk/hawkscan-action@v2
with:
apiKey: ${{ secrets.HAWK_API_KEY }}
configurationFiles: stackhawk.yml
Customize the workflow based on detected stack:
- Add appropriate dependency installation
- Include application startup commands
- Set necessary environment variables
- Add comments for required secrets
Step 4: Create Pull Request
Branch: add-stackhawk-security-testing
Commit Messages:
- "Add StackHawk security testing configuration"
- "Add GitHub Actions workflow for automated security scans"
PR Title: "Add StackHawk API Security Testing"
PR Description Template:
## StackHawk Security Testing Setup
This PR adds automated API security testing to your repository using StackHawk.
### Attack Surface Analysis
🎯 **Risk Assessment:** This repository was identified as a candidate for security testing based on:
- Active API/web application code detected
- Authentication mechanisms in use
- [Other risk indicators detected from code analysis]
### What I Detected
- **Framework:** [DETECTED_FRAMEWORK]
- **Language:** [DETECTED_LANGUAGE]
- **Host Pattern:** [DETECTED_HOST or "Not conclusively detected - needs configuration"]
- **Authentication:** [DETECTED_AUTH_TYPE or "Requires configuration"]
### What's Ready to Use
✅ Valid stackhawk.yml configuration file
✅ GitHub Actions workflow for automated scanning
✅ [List other detected/configured items]
### What Needs Your Input
⚠️ **Required GitHub Secrets:** Add these in Settings > Secrets and variables > Actions:
- `HAWK_API_KEY` - Your StackHawk API key (get it at https://app.stackhawk.com/settings/apikeys)
- [Other required secrets based on detection]
⚠️ **Configuration TODOs:**
- [List items needing manual input, e.g., "Update host URL in stackhawk.yml line 4"]
- [Auth credential instructions if needed]
### Next Steps
1. Review the configuration files
2. Add required secrets to your repository
3. Update any TODO items in stackhawk.yml
4. Merge this PR
5. Security scans will run automatically on future PRs!
### Why This Matters
Security testing catches vulnerabilities before they reach production, reducing risk and compliance burden. Automated scanning in your CI/CD pipeline provides continuous security validation.
### Documentation
- StackHawk Configuration Guide: https://docs.stackhawk.com/stackhawk-cli/configuration/
- GitHub Actions Integration: https://docs.stackhawk.com/continuous-integration/github-actions.html
- Understanding Your Findings: https://docs.stackhawk.com/findings/
Handling Uncertainty
Be transparent about confidence levels:
- If detection is certain, state it confidently in the PR
- If uncertain, provide options and mark as TODO
- Always deliver valid configuration structure and working GitHub Actions workflow
- Never guess at credentials or sensitive values - always mark as TODO
Fallback Priorities:
- Framework-appropriate configuration structure (always achievable)
- Working GitHub Actions workflow (always achievable)
- Intelligent TODOs with examples (always achievable)
- Auto-populated host/auth (best effort, depends on codebase)
Your success metric is enabling the developer to get security testing running with minimal additional work.
Du fichier au premier essai
Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.
Consulter la source et ses fichiers annexesCe téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.
1. Télécharger le fichier
Télécharger SKILL.mdDepuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/stackhawk-security-onboarding-mm78noe0/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.
Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.
mkdir -p '.skill-downloads/stackhawk-security-onboarding-mm78noe0' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/stackhawk-security-onboarding-mm78noe0/download' --output '.skill-downloads/stackhawk-security-onboarding-mm78noe0/SKILL.md.part' && mv '.skill-downloads/stackhawk-security-onboarding-mm78noe0/SKILL.md.part' '.skill-downloads/stackhawk-security-onboarding-mm78noe0/SKILL.md'2. Vérifier les prérequis
Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.
Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.
Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.
3. Charger la skill
Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.
Claude Code
test -f '.skill-downloads/stackhawk-security-onboarding-mm78noe0/SKILL.md' && test -s '.skill-downloads/stackhawk-security-onboarding-mm78noe0/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/partners-stackhawk-security-onboarding' && cp -R '.skill-downloads/stackhawk-security-onboarding-mm78noe0' '.claude/skills/partners-stackhawk-security-onboarding'Codex
test -f '.skill-downloads/stackhawk-security-onboarding-mm78noe0/SKILL.md' && test -s '.skill-downloads/stackhawk-security-onboarding-mm78noe0/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/partners-stackhawk-security-onboarding' && cp -R '.skill-downloads/stackhawk-security-onboarding-mm78noe0' '.agents/skills/partners-stackhawk-security-onboarding'OpenSkills
OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.
Installation officielle d’OpenSkillsopenskills install './.skill-downloads/stackhawk-security-onboarding-mm78noe0'openskills read 'stackhawk-security-onboarding-mm78noe0'La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.
Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.
openskills syncMode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.
4. Faire un premier essai
Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :
Lis .skill-downloads/stackhawk-security-onboarding-mm78noe0/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.
Sécurité AMM DeFi
Securite
Checklist de sécurité pour les contrats Solidity AMM, pools de liquidité et flux de swap. Couvre réentrance, attaques par donation, manipulation d'oracles, etc.
Créateur de règles Semgrep
Securite
Crée des règles Semgrep personnalisées pour détecter des vulnérabilités de sécurité, des motifs de bugs et des motifs de code. Inclut une méthodologie de test en premier, le support du mode taint et des étapes de validation. Utile pour construire des détections d'analyse statique ciblées.
Revue barre d'outils développement
Securite
Règles de sécurité pour la barre d'outils de développement, le client PostHog et les feature flags. À utiliser lors de la revue de modifications des composants dev-tools et connexes.