mcpField
S
senhasegura

senhasegura

github.com/julianobarbosaSecurity1459 installsUpdated 2d ago
Repository

About senhasegura

An integration skill for senhasegura (Segura) Privileged Access Management, covering authentication, credential and SSH key APIs, secrets delivery, and related workflows. It also documents an opt-in MCP server integration for Claude Code.

Key features

  1. 01A2A OAuth 2.0 setup
  2. 02PAM credential and SSH key APIs
  3. 03DSM secrets for CI/CD
  4. 04Kubernetes secrets synchronization
  5. 05Password rotation workflows
  6. 06MCP integration reference

Use cases

  1. 01Set up an OAuth client
  2. 02Fetch secrets in a CI/CD pipeline
  3. 03Sync DSM secrets to Kubernetes
  4. 04Register or rotate SSH keys

MCP support

Documents an opt-in MCP server integration for Claude Code and points to its reference and implementation file.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/julianobarbosa/claude-code-skills --skill senhasegura

After installing, type/senhasegurain Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

Authentication.md
Dsm.md
Integrations.md
PamApi.md
Troubleshooting.md
References/
AzurePipelinesExample.yaml
DsmConfigExample.yaml
ExternalSecretExample.yaml
GithubActionsExample.yaml
GitlabCiExample.yaml
MappingExample.json
McpIntegration.md
OAuth1Legacy.md
PythonClient.py
PythonSdk.md
SecretStoreExample.yaml
TypescriptClient.ts
Tools/
SenhaseguraMcpServer.ts
Workflows/
InjectCiCdSecrets.md
RegisterSshKey.md
RotatePasswords.md
SetupA2A.md
SyncKubernetesSecrets.md

Details

From the project README

Senhasegura

Skill Type: Library/API Reference (Type 1) + Data Fetching (Type 3).

Practical integration guide for the senhasegura (Segura) Privileged Access Management platform. Covers A2A OAuth 2.0 auth, PAM Core credential and SSH key APIs, DevOps Secret Manager (DSM) for CI/CD, External Secrets Operator for Kubernetes, MySafe, and an opt-in MCP server.

Voice Notification (on invocation)

curl -s -X POST http://localhost:31337/notify \
  -H "Content-Type: application/json" \
  -d '{"message": "Running the Senhasegura skill"}' \
  > /dev/null 2>&1 &

Workflow Routing

TriggerWorkflow
"set up A2A", "create senhasegura application", first-time OAuth clientWorkflows/SetupA2A.md
"sync secrets to Kubernetes", ESO + senhasegura DSMWorkflows/SyncKubernetesSecrets.md
"rotate password", schedule rotation, Executions moduleWorkflows/RotatePasswords.md
"fetch secrets in pipeline", DSM runb in CI/CDWorkflows/InjectCiCdSecrets.md
"register SSH key", manage SSH key rotationWorkflows/RegisterSshKey.md

Reference Routing

TopicFile
OAuth 2.0 flow, A2A application creation, token cachingAuthentication.md
PAM Core endpoints — credentials, custody, SSH keysPamApi.md
DSM CLI, runb, mapping.json, External Secrets OperatorDsm.md
MySafe, Python/TypeScript clients, CI/CD pipeline templatesIntegrations.md
Errors, debug mode, rate limits, common failure modesTroubleshooting.md
MCP server (opt-in Claude Code integration)References/McpIntegration.md + Tools/SenhaseguraMcpServer.ts
Legacy OAuth 1.0 referenceReferences/OAuth1Legacy.md
Python SDK reference (PAI standard is TypeScript+Bun)References/PythonSdk.md

Gotchas

These are non-obvious senhasegura behaviors that bite users. Add new entries as they're discovered.

#Gotcha
1GET /iso/coe/senha?credentialId=N auto-locks the credential into custody. You MUST DELETE /iso/pam/credential/custody/N after, or the credential is held until manual release. Concurrent jobs deadlock on the second fetch.
2OAuth 2.0 access token TTL is 3600s. Cache and refresh at expiry minus 60s buffer, not on 401 retry. 401 retry storms hammer the IDP and trigger rate limits.
3/iso/coe/senha is the legacy A2A v1 password retrieval path; /api/pam/credential/{id} returns metadata only. The legacy path is current — do not refactor it away.
4A2A authorization IP restriction is matched against the HTTP source IP as seen by senhasegura — for Kubernetes, that's the egress NAT, not the pod IP. Whitelist the cluster egress. ESO failures surface as a generic "could not get provider client".
5DSM runb writes secrets to .runb.vars in the current working directory. If cwd is the repo root, it can be accidentally committed. Always run from a tmpdir or set SENHASEGURA_SECRETS_FILE=/tmp/runb.$$.vars.
6External Secrets Operator provider key is senhasegura (lowercase) and module is DSM (uppercase). Mixed case = silent provider-not-found; ESO just fails to reconcile with no clear error.
7dsm runb --tool-name <X> accepts github, azure-devops, gitlab, linux. Using linux outside Linux containers (Windows runners, unspecified) prevents masking of secret values in CI logs — secrets leak into log output.
8The Python and TypeScript clients in References/ do not auto-release custody on raw getPassword. Use the provided withPassword(...) / password_context(...) helpers, which wrap try/finally.
9The token endpoint is /iso/oauth2/token — note /iso/, not /api/. Senhasegura's path scheme mixes /iso/ (legacy/console) and /api/ (newer REST) inconsistently.
10Most enterprise installs use internal CAs. Reach for ignoreSslCertificate: true / SENHASEGURA_INSECURE: true only for local debugging. The proper path is mounting the CA bundle into ESO via the ca field.

Quick Reference

# 1. Get token (1h TTL)
TOKEN=$(curl -s -X POST "$SENHASEGURA_URL/iso/oauth2/token" \
  -d "grant_type=client_credentials" \
  -d "client_id=$SENHASEGURA_CLIENT_ID" \
  -d "client_secret=$SENHASEGURA_CLIENT_SECRET" | jq -r '.access_token')

# 2. List credentials
curl -H "Authorization: Bearer $TOKEN" "$SENHASEGURA_URL/api/pam/credential"

# 3. Get password (auto-locks custody — see Gotcha #1)
curl -H "Authorization: Bearer $TOKEN" \
  "$SENHASEGURA_URL/iso/coe/senha?credentialId=123"

# 4. Release custody (REQUIRED after step 3)
curl -X DELETE -H "Authorization: Bearer $TOKEN" \
  "$SENHASEGURA_URL/iso/pam/credential/custody/123"

# 5. DSM secret fetch via CLI
dsm runb --tool-name github \
  --application my-app --system production --environment prod
source .runb.vars && rm -f .runb.vars

Environment Variables

SENHASEGURA_URL="https://senhasegura.example.com"
SENHASEGURA_CLIENT_ID="oauth2-client-id"
SENHASEGURA_CLIENT_SECRET="oauth2-client-secret"

# DSM CLI optionals
SENHASEGURA_CONFIG_FILE="/path/to/config.yaml"
SENHASEGURA_MAPPING_FILE="/path/to/mapping.json"
SENHASEGURA_SECRETS_FILE="/tmp/runb.$$.vars"   # don't write into repo root
SENHASEGURA_TIMEOUT="30"
# SENHASEGURA_INSECURE — local debug only; mount the CA bundle in prod

Documentation Links

Execution Log

Append after every workflow run:

echo '{"ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","skill":"Senhasegura","workflow":"WORKFLOW_USED","input":"8_WORD_SUMMARY","status":"ok|error","duration_s":SECONDS}' \
  >> ~/.claude/PAI/MEMORY/SKILLS/execution.jsonl

Comments

Markdown supported