Skip to content
Merged
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
31 changes: 31 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# CODEOWNERS — review routing for Last State.
#
# Order matters; later matching patterns take precedence.
# Owners must be real GitHub users or teams WITH WRITE ACCESS to the repo.
# No fabricated teams. `@TheusHen` is a public member of `laststate`
# (verified via public API). Org admins should create `@laststate/maintainers`
# and `@laststate/security` teams and update this file. See docs/GOVERNANCE.md
# and docs/HUMAN-CHECKLIST.md.
#
# This file is an org-wide default in `laststate/.github`; individual repos
# may override with their own CODEOWNERS. Scorecard does not score CODEOWNERS
# content; it strengthens Code-Review/Branch-Protection when combined with
# required reviews in org rulesets (human).

# Default owner for everything.
* @TheusHen

# Security-sensitive areas route to security owner + maintainer.
/SECURITY.md @TheusHen
/docs/SECURITY-POLICY.md @TheusHen
/docs/HUMAN-CHECKLIST.md @TheusHen
/security.txt @TheusHen
/.well-known/security.txt @TheusHen
/.github/ @TheusHen
/.github/workflows/ @TheusHen
/.github/CODEOWNERS @TheusHen
/.github/dependabot.yml @TheusHen
/workflow-templates/ @TheusHen

# License / legal-adjacent
/LICENSE @TheusHen
6 changes: 6 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# GitHub Funding.
# Enables the org funding display. This file does NOT create a sponsor account.
# Org admin must enable GitHub Sponsors for `laststate` and verify payout
# details before publishing. No other funding channel is asserted here.
# See docs/HUMAN-CHECKLIST.md. Keep secrets out.
github: [laststate]
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Bug report
description: Report a reproducible bug. NOT for security vulnerabilities (use private reporting).
labels: [bug]
body:
- type: markdown
attributes:
value: |
**Security vulnerability?** Do not file here. See `SECURITY.md`; report privately to security@laststate.io or GitHub Private Vulnerability Reporting.
- type: input
id: repo
attributes:
label: Repository
placeholder: github.com/laststate/...
validations:
required: true
- type: input
id: version
attributes:
label: Version / commit
- type: textarea
id: what
attributes:
label: What happened?
validations:
required: true
- type: textarea
id: repro
attributes:
label: Steps to reproduce / test
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected vs actual
9 changes: 9 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# No blank issues; use templates. Security issues are NOT public.
blank_issues_enabled: false
contact_links:
- name: Report a security vulnerability (PRIVATE)
url: https://github.com/laststate/.github/blob/main/SECURITY.md
about: Do not open a public issue. Use security@laststate.io or GitHub Private Vulnerability Reporting.
- name: Security policy
url: https://github.com/laststate/.github/blob/main/SECURITY.md
about: Read the org-wide security policy.
31 changes: 31 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Pull Request

## Summary

<!-- What changed and why. Link issue. -->

Closes #

## Type

- [ ] Bug fix
- [ ] Feature
- [ ] Docs
- [ ] CI / security hardening
- [ ] Chore

## Security checklist

- [ ] No secrets, tokens, keys, `.env`, or `.pem` added.
- [ ] No secrets in logs / CI output; nothing printed sensitive.
- [ ] Third-party GitHub Actions pinned to full commit SHA (not `@master`/`@v1`).
- [ ] `permissions` minimal (`read-all` top, least per job); `persist-credentials: false`.
- [ ] No `pull_request_target` on untrusted code; untrusted input quoted; no `curl | sh`.
- [ ] `.github/dependabot.yml` keeps `github-actions` updated.
- [ ] Tests added/updated; CI green; not weakened. SBOM/attestation where released.
- [ ] No known vulnerabilities introduced; `actions/dependency-review-action` passes.

## Vulnerability?

If this relates to a security vulnerability, **stop** and report privately via
`security@laststate.io` / GitHub Private Vulnerability Reporting. See `SECURITY.md`.
23 changes: 23 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Dependabot. Satisfies Scorecard Dependency-Update-Tool.
# `github-actions` keeps our pinned-by-SHA workflows updated to new pinned SHAs.
# No package ecosystem is listed for this no-code `.github` repo; add per-repo
# ecosystems (npm, pip, gomod, docker, terraform, cargo, ...) in each repo or
# via org defaults. See templates/dependabot.yml.
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 10
commit-message:
prefix: "ci"
labels:
- "dependencies"
- "github-actions"
# Group action updates to reduce noise; still updates SHAs.
groups:
actions:
patterns:
- "*"
45 changes: 45 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# CodeQL SAST. Pinned. Minimal permissions. No secrets.
# In this no-code `.github` org repo there is no source to scan; this workflow
# is both useful here and a pinned template. Apply org-wide via org ruleset
# "required workflows" (human). `languages` auto-detects; set per repo.
name: CodeQL
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "0 0 * * 1" # weekly
workflow_dispatch:

permissions: {}

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [javascript-typescript]
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Initialize CodeQL
uses: github/codeql-action/init@915412ff23e8b7659517e607487dbeae018f2934 # v4.39.5
with:
languages: ${{ matrix.language }}
# build-mode: none # for languages that don't need build; per repo

# No build step needed for this no-code repo / interpreted languages.
# Compiled languages in other repos add a build here (then build-mode).

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@915412ff23e8b7659517e607487dbeae018f2934 # v4.39.5
24 changes: 24 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Dependency review on PRs. Pinned. Minimal permissions. No secrets.
name: Dependency review
on:
pull_request:
branches: [main]

permissions:
contents: read

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Dependency review
uses: actions/dependency-review-action@bbc44d14a204704ccc493733616cd1e93a0321ec # v5.0.1
with:
fail-on-severity: high
# Deny known-vulnerable / non-allowed licenses where policy wants:
# deny-licenses: GPL-3.0, AGPL-3.0 # per repo policy; not asserted
46 changes: 46 additions & 0 deletions .github/workflows/sbom.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# SBOM generation + attestation. Pinned. Minimal permissions. No secrets.
# Produces SPDX JSON and a GitHub SBOM attestation. In this no-code repo no
# package artifact exists; this is a template for artifact-producing repos.
name: SBOM
on:
push:
branches: [main]
tags: ["*"]
release:
types: [published]
workflow_dispatch:

permissions: {}

jobs:
sbom:
name: Generate SBOM
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # Sigstore/OIDC for attestation
attestations: write
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Generate SPDX SBOM
uses: anchore/sbom-action@dfcb83b97731532d72be422cbc51ee64adb6fd56 # v0.24.4
with:
format: spdx-json
output-file: sbom.spdx.json

- name: Upload SBOM artifact
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: sbom-spdx
path: sbom.spdx.json
if-no-files-found: warn

- name: Attest SBOM
uses: actions/attest-sbom@c604332985a26aa8cf1bdc465b92731239ec6b9e # v4.1.0
with:
subject-path: sbom.spdx.json
sbom-path: sbom.spdx.json
47 changes: 47 additions & 0 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# OpenSSF Scorecard analysis. Pinned. Minimal permissions. No secrets.
# `publish_results: false` because this run is local/org `.github` and we cannot
# verify org admin for published results; set `publish_results: true` +
# `id-token: write` + org setup in production (human; see docs/HUMAN-CHECKLIST.md).
name: OpenSSF Scorecard
on:
branch_protection_rule:
schedule:
- cron: "0 0 * * 0" # weekly
push:
branches: [main]
workflow_dispatch:

# Least privilege at top level; escalate only per job.
permissions: read-all

jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
permissions:
security-events: write # upload SARIF to code scanning
id-token: write # required by ossf/scorecard-action (OIDC); harmless when publish_results=false
actions: read # for workflow introspection
contents: read
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Run Scorecard
uses: ossf/scorecard-action@23f22cd43608bae7a1f1fa2603d7314dee9538a5 # v2.6.0
with:
results_file: results.sarif
results_format: sarif
publish_results: false
# checks: ... # default all
env:
# No PAT. GITHUB_TOKEN auto-injected; not persisted. token not printed.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload SARIF
if: always()
uses: github/codeql-action/upload-sarif@915412ff23e8b7659517e607487dbeae018f2934 # v4.39.5
with:
sarif_file: results.sarif
34 changes: 34 additions & 0 deletions .github/workflows/slsa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# SLSA build provenance. Pinned. Minimal permissions. No secrets.
# `actions/attest-build-provenance` produces SLSA provenance for build outputs.
# In this no-code repo no artifact is built; template for artifact repos.
# `subject-path` should list your real release artifacts (and SBOM).
name: SLSA provenance
on:
push:
tags: ["*"]
release:
types: [published]
workflow_dispatch:

permissions: {}

jobs:
provenance:
name: Build provenance
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # Sigstore/OIDC
attestations: write
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

# Add your build + artifact production here in real repos, then attest.
- name: Attest build provenance
uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
with:
# Replace with real artifact path(s). SBOM path recommended too.
subject-path: "artifacts/*"
6 changes: 6 additions & 0 deletions .well-known/security.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Contact: mailto:security@laststate.io
Contact: https://github.com/laststate/.github/security/advisories/new
Expires: 2027-12-03T00:00:00Z
Preferred-Languages: en
Policy: https://github.com/laststate/.github/blob/main/SECURITY.md
Canonical: https://raw.githubusercontent.com/laststate/.github/main/.well-known/security.txt
Loading
Loading