Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/continuous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@ jobs:
- name: Test
run: npm run test

- name: Generate SBOM
if: github.event_name == 'push'
run: npx cyclonedx-npm --output-format JSON --output-file sbom.cdx.json

- name: Upload SBOM artifact
if: github.event_name == 'push'
uses: actions/upload-artifact@v7
with:
name: sbom
path: sbom.cdx.json
retention-days: 30

- uses: ./.github/workflows/actions/upload-distribution-archives

assembleInformation:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Audit dependencies
run: npm audit --audit-level=high

- name: Build
run: npx turbo run build

Expand Down
182 changes: 158 additions & 24 deletions SECURITY.md

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions STYLE_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This is a quick reference for component code standards. For comprehensive detail
- [Prop Validation](#prop-validation)
- [Quick Reference Table](#quick-reference-table)
- [Full Documentation](#full-documentation)
- [Security](#security)
- [Enforcement](#enforcement)

## Key Rules at a Glance
Expand Down Expand Up @@ -387,6 +388,31 @@ For detailed explanations, examples, and comprehensive guidelines, see:
- **[CONTRIBUTING.md](CONTRIBUTING.md)** — Contribution workflow and testing requirements
- **[ARCHITECTURE.md](ARCHITECTURE.md)** — System design, component patterns, and testing strategy

## Security

These rules enforce the component library's secure-by-default posture and are verified during code review and CodeQL analysis.

**Never use `innerHTML` with unsanitized input.** Any HTML that originates from outside the component (consumer props, fetched content) must be passed through DOMPurify before rendering. The existing `sanitizeSvg` utility in `src/utils/svg.ts` is the pattern to follow.

```ts
// ✅ Correct — sanitize before setting innerHTML
import DOMPurify from 'dompurify'
element.innerHTML = DOMPurify.sanitize(externalHtml)

// ❌ Wrong — direct assignment from untrusted source
element.innerHTML = props.htmlContent
```

**Never use `eval`, `new Function`, or `setTimeout`/`setInterval` with a string argument.** These bypass CSP and open script injection paths. Use typed callbacks instead.

**Never make default network requests.** Components must not initiate `fetch` or `XMLHttpRequest` calls on their own. The only exception is `ds-icon`, which fetches a consumer-provided SVG URL and immediately sanitizes the response with DOMPurify. New network calls require explicit justification and the same sanitization treatment.

**Never write sensitive data to `localStorage` or `sessionStorage`.** The only permitted `localStorage` use is the animation preference flag (`DS_ANIMATION_KEY`), which stores a non-sensitive boolean. Authentication tokens, user identifiers, and PII must never be stored in web storage by design system components.

**Never use inline event handler attributes.** Use `addEventListener` in `connectedCallback` / `disconnectedCallback` pairs. Inline handlers (`onclick="..."`) break CSP `script-src` policies.

**Prefer semantic HTML over ARIA overrides.** A correct element (`<button>`, `<a>`, `<input>`) provides accessibility for free and reduces attack surface compared to a `<div>` with ARIA roles.

## Enforcement

Style violations are caught by:
Expand Down
2 changes: 1 addition & 1 deletion TODOS.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ These improvements help our components work seamlessly across all supported fram
| footer | WC | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| file-upload | WC | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| select | CSS | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| navbar | Hybrid | | | | | | |
| navbar | Hybrid | | | | | | |
| time-input | CSS | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| date | WC | ⬜ | ⬜ | ⬜ | ⬜ | ⬜ | ⬜ |
| dropdown | WC | ⬜ | ⬜ | ⬜ | ⬜ | ⬜ | ⬜ |
Expand Down
268 changes: 0 additions & 268 deletions docs/plan/001-navbar-mobile-drawer.md

This file was deleted.

4 changes: 4 additions & 0 deletions docs/public/.well-known/security.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Contact: https://github.com/baloise/design-system/security/advisories/new
Policy: https://github.com/baloise/design-system/blob/next/SECURITY.md
Preferred-Languages: en, de
Expires: 2027-12-31T00:00:00.000Z
Loading
Loading