Skip to content
Back to skills

1 Secure Token Storage

BSecurity

Sub-skill of communication: 1. Secure Token Storage (+4).

  • 17 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 9, 2026
testinggobash

Security analysis

B88/100
  • criticalSends environment variables or credentials to an external URL

Pro shows the line behind each finding and how to fix it

Scanned September 9, 2026

npx -y skills add vamseeachanta/workspace-hub --skill 1-secure-token-storage --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 1 Secure Token Storage?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 1 Secure Token Storage
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/vamseeachanta-1-secure-token-storage/badge)](https://www.skillsdirectory.com/skills/vamseeachanta-1-secure-token-storage)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: communication-1-secure-token-storage
description: 'Sub-skill of communication: 1. Secure Token Storage (+4).'
version: 1.0.0
category: business
type: reference
scripts_exempt: true
---

# 1. Secure Token Storage (+4)

## 1. Secure Token Storage

```bash
# Use environment variables or secret managers
export SLACK_BOT_TOKEN=$(vault kv get -field=token secret/slack)

# Rotate tokens regularly
rotate_token() {
    local new_token=$(generate_new_token)
    vault kv put secret/slack token="$new_token"
}
```


## 2. Message Formatting

```bash
# Escape special characters for Slack
escape_slack() {
    local text="$1"
    text="${text//&/&}"
    text="${text//</&lt;}"
    text="${text//>/&gt;}"
    echo "$text"
}

# Format mentions
format_mention() {
    local user_id="$1"
    echo "<@$user_id>"
}

# Format channel link
format_channel() {
    local channel_id="$1"
    echo "<#$channel_id>"
}
```


## 3. Idempotent Operations

```bash
# Prevent duplicate messages
SENT_MESSAGES_FILE="/tmp/sent_messages.txt"

send_once() {
    local message_hash=$(echo "$1" | md5sum | cut -d' ' -f1)

    if grep -q "$message_hash" "$SENT_MESSAGES_FILE" 2>/dev/null; then
        echo "Message already sent" >&2
        return 0
    fi

    if send_message "$1"; then
        echo "$message_hash" >> "$SENT_MESSAGES_FILE"
    fi
}
```


## 4. Webhook Verification

```bash
# Verify Slack signature
verify_slack_signature() {
    local timestamp="$1"
    local body="$2"
    local signature="$3"

    local base="v0:$timestamp:$body"
    local computed=$(echo -n "$base" | openssl dgst -sha256 -hmac "$SLACK_SIGNING_SECRET" | sed 's/.*= //')

    [ "v0=$computed" = "$signature" ]
}
```


## 5. Graceful Degradation

```bash
# Fallback when primary channel fails
notify() {
    local message="$1"

    if ! send_slack_message "$message"; then
        echo "Slack failed, trying Teams..." >&2
        if ! send_teams_message "$message"; then
            echo "Teams failed, sending email..." >&2
            send_email "$message"
        fi
    fi
}
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.