saas-security-posture – skill Bảo mật cho agent AI
Kiểm tra và củng cố bảo mật cho bộ công cụ SaaS của bạn
Cài skill saas-security-posture bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/saas-security-posture-3871e.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /saas-security-posture – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/saas-security-posture-3871e.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $saas-security-posture – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/saas-security-posture-3871e.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /saas-security-posture – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/saas-security-posture-3871e.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /saas-security-posture – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
SaaS Security Posture Management for Startups
Secure every SaaS tool your company relies on with practical, command-driven hardening.
When to Use This Skill
- SOC 2 preparation — auditors need evidence of MFA, access controls, and OAuth governance.
- Suspicious OAuth app — an employee authorized a third-party app with broad scopes.
- SaaS sprawl — teams sign up for tools with company email and nobody tracks them.
- Post-incident hardening — after phishing or credential leaks, tighten every surface.
Start with authorized read-only inventory. Broad MFA/OAuth/SSO/retention/SCP changes can lock out users, destroy retained evidence or stop services. Record exact targets and existing state, validate recovery, and apply only approved changes in staged scope. Export files may contain sensitive grants/identifiers: use restrictive permissions and minimize/redact output. Before branch-protection PUT, fetch and merge existing settings rather than replacing required checks or actor restrictions with this example.
2. SaaS Inventory Audit
Google Workspace — OAuth Grants
gam all users show tokens > oauth_tokens_audit.csvGitHub — Installed Apps
gh api /orgs/{ORG}/installations --paginate \
--jq '.installations[] | {app: .app_slug, permissions: .permissions, created: .created_at}'
gh api /orgs/{ORG}/credential-authorizations --paginate \
--jq '.[] | {login: .login, credential_type: .credential_type}'Slack — Approved and Pending Apps
curl -s -H "Authorization: Bearer ${SLACK_ADMIN_TOKEN}" \
"https://slack.com/api/admin.apps.approved.list" | jq '.approved_apps[] | {name: .app.name, id: .app.id}'
curl -s -H "Authorization: Bearer ${SLACK_ADMIN_TOKEN}" \
"https://slack.com/api/admin.apps.requests.list" | jq '.app_requests[]'AWS — IAM Credential Report
aws iam generate-credential-report
aws iam get-credential-report --output text --query 'Content' | base64 -d > iam_credential_report.csvMaster Inventory Template
tools:
- name: Google Workspace
owner: [email protected]
sso: true
mfa: enforced
- name: GitHub Enterprise
owner: [email protected]
sso: true
mfa: enforced
- name: Slack Business+
owner: [email protected]
sso: true
app_approval: required
- name: AWS Organizations
owner: [email protected]
sso: true
scp_enforced: true---
3. GitHub Security Hardening
# Enforce 2FA and find non-compliant members
gh api -X PATCH /orgs/{ORG} -F two_factor_requirement_enabled=true
gh api "/orgs/{ORG}/members?filter=2fa_disabled" --paginate --jq '.[].login'
# Verify SAML SSO identities
gh api /orgs/{ORG}/credential-authorizations --paginate \
--jq '.[] | {login: .login, saml_name_id: .saml_name_id}'
# Review the org IP allow list in supported enterprise settings or GraphQL.
# The REST /orgs/{ORG}/ip-allow-list endpoint is not supplied here.
# Branch protection on main
gh api -X PUT /repos/{ORG}/{REPO}/branches/main/protection \
-H "Accept: application/vnd.github+json" --input - <<'EOF'
{
"required_status_checks": {"strict": true, "contexts": ["ci/build","ci/test"]},
"enforce_admins": true,
"required_pull_request_reviews": {
"required_approving_review_count": 2,
"dismiss_stale_reviews": true,
"require_code_owner_reviews": true
},
"restrictions": null,
"allow_force_pushes": false,
"allow_deletions": false
}
EOF
# Audit PATs and revoke stale tokens
gh api /orgs/{ORG}/personal-access-tokens --paginate \
--jq '.[] | {owner: .owner.login, name: .token_name, expires: .token_expires_at}'
gh api -X DELETE /orgs/{ORG}/personal-access-tokens/{PAT_ID}
# Audit deploy keys and webhooks
for repo in $(gh repo list {ORG} --limit 500 --json name -q '.[].name'); do
gh api /repos/{ORG}/${repo}/keys --jq '.[] | {title: .title, read_only: .read_only}'
done
gh api /orgs/{ORG}/hooks --jq '.[] | {url: .config.url, events: .events, active: .active}'---
4. Slack Security
Use the supported admin console to review app approval, session duration, retention and export permissions for the actual plan; do not invent admin Web API methods for these settings. Record current values, stage the proposed changes and verify them after authorized application. Retention changes can delete evidence and require the organization's approved policy.
For Enterprise workspace discoverability, the supported admin.teams.settings.setDiscoverability method accepts team_id and one of open, invite_only, closed or unlisted; it requires an org-installed admin token with the documented scope. Always check the JSON ok field, not just HTTP200. Discoverability is not a substitute for access policy.
5. Google Workspace Hardening
Use the Admin console and the installed GAM version's documented commands; the generic gam update org ... settings examples are not a validated GAM interface. Review and stage:
1. 2-Step Verification enrollment/enforcement for the intended organizational unit, with recovery access verified first.
2. Third-party OAuth app access and explicitly trusted client IDs.
3. External Drive sharing, transfer and group membership policies.
4. Device management/lock/encryption requirements on managed devices. A wipe is destructive; verify exact device, ownership and approved recovery before issuing it.
5. SPF, DKIM and DMARC records for the actual sending domain; do not enforce reject before authorized senders and reports are validated.
6. AWS Account Security
# Root account lockdown — verify MFA, remove access keys
aws iam get-account-summary --query 'SummaryMap.AccountMFAEnabled'
aws iam get-account-summary --query 'SummaryMap.AccountAccessKeysPresent'
# SSO permission set with least privilege
aws sso-admin create-permission-set --instance-arn "${SSO_INSTANCE_ARN}" \
--name "DeveloperAccess" --session-duration "PT8H"
aws sso-admin attach-managed-policy-to-permission-set \
--instance-arn "${SSO_INSTANCE_ARN}" --permission-set-arn "${PERMISSION_SET_ARN}" \
--managed-policy-arn "arn:aws:iam::aws:policy/ReadOnlyAccess"Service Control Policies
{
"Version": "2012-10-17",
"Statement": [
{"Sid": "DenyRootActions", "Effect": "Deny", "Action": "*", "Resource": "*",
"Condition": {"StringLike": {"aws:PrincipalArn": "arn:aws:iam::*:root"}}},
{"Sid": "DenyLeaveOrg", "Effect": "Deny",
"Action": "organizations:LeaveOrganization", "Resource": "*"}
]
}aws organizations create-policy --name "DenyRootActions" \
--type SERVICE_CONTROL_POLICY --content file://deny-root-actions.json
aws organizations attach-policy --policy-id "${POLICY_ID}" --target-id "${ORG_ROOT_ID}"
# Organization-wide CloudTrail
aws cloudtrail create-trail --name org-security-trail \
--s3-bucket-name company-cloudtrail-logs \
--is-multi-region-trail --is-organization-trail --enable-log-file-validation
aws cloudtrail start-logging --name org-security-trail---
7. OAuth App Review
Identify High-Risk Grants
# Google — find apps with dangerous scopes
gam all users show tokens | grep -E "(drive|gmail|admin)" > high_risk_oauth.txt
# GitHub — find apps with write access
gh api /orgs/{ORG}/installations --paginate \
--jq '.installations[] | select(.permissions.contents == "write") | {app: .app_slug}'Revoke Dangerous Grants
gam user [email protected] delete token clientid APP_CLIENT_ID # single app
gam user [email protected] delete tokens # all apps
gh api -X DELETE /orgs/{ORG}/installations/{INSTALLATION_ID} # GitHub app
curl -s -X POST -H "Authorization: Bearer ${SLACK_ADMIN_TOKEN}" \
-H "Content-Type: application/json" \
"https://slack.com/api/admin.apps.uninstall" -d '{"app_id": "A0XXXXXXX"}'Scope Risk Classification
CRITICAL — revoke unless justified:
Google: mail.google.com, admin.directory.user | GitHub: admin:org, repo | Slack: admin
HIGH — review carefully:
Google: googleapis.com/auth/drive | GitHub: contents:write | Slack: channels:read
LOW — generally safe:
Google: userinfo.email | GitHub: read:org | Slack: identity.basic---
8. Admin Account Protection
Create dedicated least-privilege admin identities through the supported identity provider. Never pass passwords as CLI arguments (including generated command substitutions); use the supported secret-manager or secure interactive provisioning path. Verify recovery before enforcing hardware-backed MFA. Maintain an authorized break-glass process with restricted credential storage, tested recovery, audited use and post-use rotation.
MFA policies must account for IAM-user sessions, service roles and federated/SSO identities. A blanket deny based on a missing aws:MultiFactorAuthPresent key can block automation or federation; test scoped policies and recovery in a nonproduction account before attachment.
9. Data Loss Prevention
# Google Dr… (nội dung đầy đủ có trong gói tải về)
Skill liên quan
- sast-configuration – Thiết lập, cấu hình công cụ SAST (Static Application Security Testing) và tạo quy tắc…
- sast-scanning – Thực hiện kiểm thử bảo mật ứng dụng tĩnh bằng các công cụ như Semgrep, CodeQL và…
- scanning-tools – Thành thạo các công cụ quét bảo mật thiết yếu cho khám phá mạng, đánh giá lỗ hổng, kiểm…
- security-and-hardening – Tăng cường bảo mật mã nguồn chống lại lỗ hổng. Dùng khi xử lý input người dùng, xác…
- security-arsenal – Payload bảo mật, bảng bypass, wordlist, tên pattern gf, danh sách lỗi luôn bị từ chối và…
- security-audit – Quy trình kiểm toán bảo mật toàn diện, bao gồm kiểm thử ứng dụng web, bảo mật API, kiểm…
- security-auditor – Chuyên gia kiểm toán bảo mật chuyên về DevSecOps, an ninh mạng toàn diện và các khung…
- security-automation – Tự động hóa quy trình bảo mật và khắc phục. Xây dựng pipeline bảo mật, tự động kiểm tra…