agentsclimarketplace

Security by design

Skill valdomirosouza/agent-skills/skills/security-by-design

Embeds security as a structural property of systems from the spec phase — covering threat modeling (STRIDE/LINDDUN), Secure by Default, Defense in Depth, Privacy by Design (LGPD/GDPR), and Attack Surface Reduction. Use when reviewing or writing a spec for security completeness, performing threat modeling, designing access control, evaluating privacy impact (DPIA), or verifying that a system follows Security by Design principles. Also use when asked about fail-safe defaults, blast radius, CSP headers, or DPIA.From its SKILL.md

Install
npx -y skills add valdomirosouza/agent-skills --skill security-by-design

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

6.3 KB, ~1.4k tokens by cl100k_base, as published. Nobody here has run it

Security by Design

Security is a structural property — not a layer added after coding. This skill governs the security architecture phase that precedes DevSecOps tooling.

Contents

  • Secure SDLC: security gates per development phase
  • Threat Modeling (STRIDE) → threat-modeling.md
  • Secure by Default (fail-safe, deny-all, HTTP headers)
  • Defense in Depth (8-layer model)
  • Privacy by Design + DPIA → privacy-by-design.md
  • Attack Surface Reduction
  • Spec approval checklist

Secure SDLC — Gates per Phase

PhaseSecurity activityArtifact
Spec DraftThreat modeling, PII classificationSecurity section in spec
Tech ReviewThreat model + controls validatedSpec with security sign-off
ImplementationSecure coding, SAST pre-commit, no hardcoded secretsCode with traceability header
Harness / TestsAuthorization tests, negative testsSecurity tests in harness
CI/CDSAST, SCA, secret scan, container scanSecurity report in PR
StagingDAST, TLS/mTLS validationDAST report
ProductionArtifact signature verified, SBOM validatedSigned deploy evidence
OperationsAnomaly monitoring, log review, SIEMMonthly security reports
DeprecationCredential revocation, data sanitizationDecommission checklist

Secure by Default

Fail-safe principle: On failure, deny access — never permit by omission.

Examples:
  Auth middleware fails?    → HTTP 500, NOT bypass
  Vault unavailable?        → Service does NOT start (no hardcoded fallback)
  Feature flag unavailable? → Feature OFF, not ON
  Circuit breaker open?     → Return error, do NOT retry infinitely

Deny-all defaults:

  • Kubernetes NetworkPolicy: deny-all ingress/egress by default; explicit allowlist
  • Security Groups: deny-all; allow by specific port and source
  • WAF: block mode for OWASP Core Rule Set
  • All routes require explicit permission — no public routes by default

Mandatory HTTP security headers:

Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
Content-Security-Policy: [defined restrictive policy]
Referrer-Policy: strict-origin-when-cross-origin
Permissions-Policy: [restrict unused browser APIs]

Cookies: Secure; HttpOnly; SameSite=Strict (or Lax when required)

CORS: Explicit origin allowlist — never wildcard (*) in production


Defense in Depth — 8 Layers

Layer 8: People & Process    → Training, blameless postmortem, threat intel
Layer 7: Data                → Encryption at rest, PII anonymization, DLP, retention/purge
Layer 6: Application         → Input validation, authn/authz, SAST, DAST, SCA
Layer 5: Identity            → MFA, RBAC, JIT access, session management, Zero Trust
Layer 4: Endpoint/Workload   → Container hardening, EDR, Falco, admission controllers
Layer 3: Network             → mTLS, NetworkPolicy, WAF, API Gateway, egress filtering
Layer 2: Perimeter           → Firewall, VPC, Security Groups, ZTNA
Layer 1: Physical/Cloud      → Cloud provider shared responsibility model

Design rule: For every critical security control, ask:

  • "What happens if this control fails?"
  • "Is there an independent control that still protects?"
  • "Is the failure of this control detectable and alerted?"

Threat Modeling

Mandatory for: services with L1/L2 data, external API exposure, architectural changes.

STRIDE quick reference:

ThreatControl
SpoofingStrong authentication (OAuth 2.0/OIDC, mTLS)
TamperingTLS 1.3, digital signatures, checksums
RepudiationImmutable and audited logging (SIEM)
Information DisclosureEncryption, PII masking, RBAC
Denial of ServiceRate limiting, circuit breaker, auto-scaling
Elevation of PrivilegeLeast Privilege, per-operation authorization

Full process, DFD template, and LINDDUN for privacy → threat-modeling.md


Attack Surface Reduction

AreaKey rules
CodeRemove unused dependencies; disable beta features in production
NetworkExpose only necessary ports; egress allowlist for external calls
APIVersion and deprecate old endpoints; no bulk endpoints without auth + rate limiting
DependenciesAudit each new dependency; no open version ranges in production
InfrastructureRemove unused cloud resources; monthly IAM permission audit

Security by Design — Spec Approval Checklist

Before approving any spec with new service, data access, or architecture change:

### Threat Modeling
- [ ] STRIDE applied to main components
- [ ] DFD with trust boundaries documented
- [ ] High-risk threats have mapped controls
- [ ] LINDDUN applied if PII involved (or DPIA initiated)
- [ ] Residual risks accepted and documented

### Secure by Default
- [ ] System initial state is maximally restrictive
- [ ] Fail-safe defined for each critical failure point
- [ ] Security HTTP headers configured
- [ ] Debug/admin interfaces disabled in production
- [ ] Timeouts defined for all integrations

### Defense in Depth
- [ ] For each critical control: independent backup control exists?
- [ ] Control failure is detectable and alerted?
- [ ] No single point of security failure

### Privacy by Design
- [ ] Data collected is minimal for the purpose
- [ ] Legal basis (LGPD/GDPR) identified for each data type
- [ ] Retention policy defined
- [ ] Data subject rights implemented (DSAR, erasure, portability)
- [ ] DPIA completed if applicable

### Approval
| Reviewer | Role | Date | Status |
|----------|------|------|--------|
| | Engineer | | |
| | SecOps | | |
| | DPO (if L1/L2 PII) | | |

What ships with it: 2 files

5.9 KB alongside SKILL.md

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.