Skip to content
Closed
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
41 changes: 41 additions & 0 deletions .github/workflows/deploy-with-opa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1602,6 +1602,30 @@ jobs:
--offering ../data/cds/offering.json --profile ../data/system-profile.json \
--overview certification-overview-package.json --ksi-signal ksi-signal.json

# Significant Change Notifications (SCN-CSO-HIS/HRM/NOM/INF) and the
# append-only evaluation log (SCN-CSO-MAR). The builder fails if this build
# would drop or rewrite anything the previous published copies hold, so they
# are fetched first: a 404 means nothing has been published yet, any other
# failure stops the deploy rather than restarting the record.
- name: Build Significant Change Notifications and the evaluation log
working-directory: infrastructure
env:
GH_TOKEN: ${{ github.token }}
run: |
fetch() {
code=$(curl -sSL -o "$2" -w '%{http_code}' "https://samaydlette.com/.well-known/$1") \
|| { echo "::error::cannot fetch the published $1"; exit 1; }
case "$code" in
200) ;;
404) rm -f "$2"; echo "$1 not published yet" ;;
*) echo "::error::fetching the published $1 returned HTTP $code"; exit 1 ;;
esac
}
fetch significant-change-notifications.json previous-scn-index.json
fetch scn-evaluations.json previous-scn-evaluations.json
python3 ../scripts/build-scn.py --previous-index previous-scn-index.json \
--previous-log previous-scn-evaluations.json --commit "$GITHUB_SHA"

# The authorization-boundary map the trust center draws: the inventory's
# components placed by docs/boundary/boundary-classification.json, connected
# by what Terraform state says references what, with the data-flow table
Expand Down Expand Up @@ -1694,6 +1718,10 @@ jobs:
cosign sign-blob --yes --new-bundle-format --bundle policy-index.bundle policy-index.json
cosign sign-blob --yes --new-bundle-format --bundle security-decision-record.bundle security-decision-record.json
cosign sign-blob --yes --new-bundle-format --bundle certification-package-overview.bundle certification-package-overview.json
for a in significant-change-notifications scn-evaluations; do
cosign sign-blob --yes --new-bundle-format --bundle "$a.bundle" "$a.json"
done
cosign sign-blob --yes --new-bundle-format --bundle significant-change-notifications.atom.bundle significant-change-notifications.atom

- name: Sign trust-center artifacts (boundary map, gate report, trust center)
working-directory: infrastructure
Expand Down Expand Up @@ -1722,6 +1750,8 @@ jobs:
for a in vdr-detail-report vdr-accepted-vulnerabilities; do files="$files $a.md"; done
files="$files ongoing-certification-report.json ongoing-certification-report.md"
for a in certification-overview-package availability policy-index security-decision-record certification-package-overview; do files="$files $a.json $a.md"; done
for a in significant-change-notifications scn-evaluations; do files="$files $a.json $a.md"; done
files="$files significant-change-notifications.atom"
for a in boundary-map reconcile-report trust-center conformance-results boundary-corroboration; do
[ -f "$a.json" ] || continue
files="$files $a.json"
Expand Down Expand Up @@ -1781,6 +1811,14 @@ jobs:
aws s3 cp "$a.bundle" "s3://$BUCKET_NAME/.well-known/$a.bundle" --content-type application/json --cache-control "public, max-age=300"
aws s3 cp "$a.md" "s3://$BUCKET_NAME/.well-known/$a.md" --content-type "text/markdown; charset=utf-8" --cache-control "public, max-age=300"
done
# Significant Change Notifications + evaluation log (SCN-*) + bundles + human-readable, and the Atom feed
for a in significant-change-notifications scn-evaluations; do
aws s3 cp "$a.json" "s3://$BUCKET_NAME/.well-known/$a.json" --content-type application/json --cache-control "public, max-age=300"
aws s3 cp "$a.bundle" "s3://$BUCKET_NAME/.well-known/$a.bundle" --content-type application/json --cache-control "public, max-age=300"
aws s3 cp "$a.md" "s3://$BUCKET_NAME/.well-known/$a.md" --content-type "text/markdown; charset=utf-8" --cache-control "public, max-age=300"
done
aws s3 cp significant-change-notifications.atom "s3://$BUCKET_NAME/.well-known/significant-change-notifications.atom" --content-type "application/atom+xml; charset=utf-8" --cache-control "public, max-age=300"
aws s3 cp significant-change-notifications.atom.bundle "s3://$BUCKET_NAME/.well-known/significant-change-notifications.atom.bundle" --content-type application/json --cache-control "public, max-age=300"
# Trust center: the generated boundary map, the gate's own report (it exists
# only because the gate above passed) and the trust center's data.
for a in boundary-map reconcile-report trust-center conformance-results boundary-corroboration; do
Expand Down Expand Up @@ -1871,6 +1909,9 @@ jobs:
check policy-index.json .well-known/policy-index.json
check security-decision-record.json .well-known/security-decision-record.json
check certification-package-overview.json .well-known/certification-package-overview.json
check significant-change-notifications.json .well-known/significant-change-notifications.json
check significant-change-notifications.atom .well-known/significant-change-notifications.atom
check scn-evaluations.json .well-known/scn-evaluations.json
check iiw.csv .well-known/iiw.csv
check boundary-map.json .well-known/boundary-map.json
check reconcile-report.json .well-known/reconcile-report.json
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/scn-deadlines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# =============================================================================
# SCN DEADLINE CHECK (SCN-ADP-NTF, SCN-TRF-NAF/NAV/UPD, SCN-CSO-EMG)
# =============================================================================
# Once a business day, compares the published evaluation log and notification
# index with the register on main and fails on anything late and outstanding:
# a change named as adaptive/transformative/emergency with no record by its
# deadline, a notice not yet published after its deadline, or a transformative
# change's documentation not updated within 30 business days. The rules are in
# scripts/_scn.py (tests/test_scn.py). A failure raises or updates one GitHub
# issue, the same paper trail the evidence nightly uses.
#
# Reads only public URLs and this checkout: no AWS credentials, no writes
# outside the issue.
# =============================================================================

name: SCN Deadlines

on:
schedule:
- cron: "17 13 * * 1-5"
workflow_dispatch:

permissions:
contents: read

jobs:
deadlines:
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
result: ${{ steps.check.outcome }}
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Check SCN deadlines
id: check
run: python3 scripts/check-scn-deadlines.py

alert:
name: Raise the overdue-SCN issue
runs-on: ubuntu-latest
needs: [deadlines]
if: always() && needs.deadlines.result == 'failure'
permissions:
issues: write
steps:
- name: Raise or update the overdue-SCN issue
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const TITLE = 'Significant Change Notification overdue';
const runUrl = `${context.payload.repository.html_url}/actions/runs/${context.runId}`;
const body = [
'The scheduled SCN deadline check failed: a significant change has a record or notice past its deadline.',
'',
`The "Check SCN deadlines" step in [this run](${runUrl}) names each item. Add the record to docs/scn/scn-register.csv and deploy, which publishes it; a notice is given when the deploy publishes it.`,
].join('\n');
const open = (await github.paginate(github.rest.issues.listForRepo, {
owner: context.repo.owner, repo: context.repo.repo, state: 'open', per_page: 100,
})).filter(i => i.title === TITLE && !i.pull_request);
if (open.length) {
await github.rest.issues.createComment({
owner: context.repo.owner, repo: context.repo.repo, issue_number: open[0].number, body,
});
} else {
await github.rest.issues.create({ owner: context.repo.owner, repo: context.repo.repo, title: TITLE, body });
}
67 changes: 31 additions & 36 deletions .github/workflows/scn-tag.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# =============================================================================
# SCN TAG VALIDATOR
# SCN EVALUATION GATE (SCN-CSO-EVA)
# =============================================================================
# Enforces FedRAMP 20x Significant Change Notification rules SCN-CSO-EVA and
# SCN-CSO-MAR by reading the SCN-Type tag from either the PR description (on
# pull_request events) or the commit message (on push events). The git history
# is the SCN audit record (SCN-CSO-MAR), and this gate ensures every entry in
# that record carries a recognized SCN-Type categorization.
# Every change carries an explicit significant-change evaluation: an SCN-Type
# line, a one-line SCN-Rationale and, for adaptive, transformative and emergency
# changes, the SCN-Record it will be documented in. The pull request's
# description is read on pull_request events; on a push to main, the merged
# pull request's description (or the commit message for a direct push).
#
# Categorization defaults to routine-recurring per docs/policies/cm-policy.md
# when no SCN-Type line is present. The validator only fails on a malformed
# SCN-Type value; missing tags are treated as the default. Operators must
# explicitly upgrade the categorization for Adaptive or Transformative changes.
# There is no default. A missing type, a missing or placeholder rationale, or an
# unrecognized value fails. class-change always fails: it is a new
# certification, not a significant change. A transformative change fails until
# its initial and final plans have been published 30 and 10 business days
# (SCN-TRF-NIP/NFP). The rules live in scripts/_scn.py and are unit-tested in
# tests/test_scn.py; the deploy writes every merged evaluation to the
# append-only log at /.well-known/scn-evaluations.json (SCN-CSO-MAR).
# =============================================================================

name: SCN Tag
Expand All @@ -28,41 +31,33 @@ permissions:
jobs:
scn-tag:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Validate SCN-Type tag
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

# Untrusted text (a PR description, a commit message) reaches the script
# only through the environment, never by ${{ }} interpolation into shell.
- name: Validate the SCN evaluation
env:
PR_BODY: ${{ github.event.pull_request.body }}
COMMIT_MSG: ${{ github.event.head_commit.message }}
EVENT_NAME: ${{ github.event_name }}
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
run: |
set -euo pipefail
if [ "${EVENT_NAME}" = "pull_request" ]; then
content="${PR_BODY:-}"
SCN_TEXT="${PR_BODY:-}"
source_label="PR description"
else
content="${COMMIT_MSG:-}"
SCN_TEXT="${COMMIT_MSG:-}"
source_label="commit message"
pr=$(printf '%s\n' "${SCN_TEXT}" | head -n1 | sed -nE 's/^Merge pull request #([0-9]+) from .*/\1/p')
if [ -n "${pr}" ]; then
SCN_TEXT=$(gh api "repos/${REPO}/pulls/${pr}" --jq '.body // ""')
source_label="description of merged PR #${pr}"
fi
fi
# Extract the SCN-Type line if present. Match optional leading hashes
# (Markdown heading) and case-insensitive 'SCN-Type:' prefix.
tag=$(printf '%s\n' "${content}" | grep -iE '^[[:space:]]*##?[[:space:]]*SCN-Type:' | head -n1 | sed -E 's/^[[:space:]]*##?[[:space:]]*SCN-Type:[[:space:]]*//I' | tr -d '[:space:]' || true)
case "${tag}" in
adaptive|routine-recurring|transformative)
echo "SCN-Type: ${tag} (from ${source_label})"
;;
emergency)
# Emergency-change procedure per CR26 SCN-CSO-EMG. The change itself
# is permitted to bypass the formal SCN flow; the retroactive
# documentation is required per the IR runbook.
echo "::warning::SCN-Type: emergency (from ${source_label}). Emergency-change procedure invoked per SCN-CSO-EMG; retroactive SCN documentation required within 5 business days. See docs/incident-response.md."
;;
"")
# Per CM policy default: missing tag = routine-recurring. This is the
# documented default for sole-operator direct pushes; do not fail.
echo "::notice::No SCN-Type line in ${source_label}; defaulting to routine-recurring per docs/policies/cm-policy.md."
;;
*)
echo "::error::SCN-Type '${tag}' in ${source_label} is not a recognized value. Must be one of: adaptive | routine-recurring | transformative | emergency. See SCN-CSO-EVA / SCN-CSO-EMG in docs/policies/cm-policy.md."
exit 1
;;
esac
export SCN_TEXT
python3 scripts/scn-evaluate.py --text-env SCN_TEXT --source "${source_label}"
Loading
Loading