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
62 changes: 62 additions & 0 deletions .github/workflows/backstage_techdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Generate and Publish Backstage Technical Documentation

on:
push:
branches:
- main
paths:
- 'docs/**'
- 'documentation/**'
- 'mkdocs.yml'
workflow_dispatch:

env:
AWS_ACCOUNT: ${{ secrets.AWS_S3_TECHDOCS_ACCOUNT }}
AWS_REGION: ca-central-1

permissions:
id-token: write
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0.0
with:
python-version: '3.11'

- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '18'

- name: Get Entity Details from Catalog Info
id: get_entity
run: |
ENTITY_INFO=$(.github/workflows/scripts/get_entity_info.sh)
echo "ENTITY_INFO=${ENTITY_INFO}" >> $GITHUB_OUTPUT

- name: Install dependencies
run: |
npm install -g @techdocs/cli
pip install "mkdocs-techdocs-core==1.3.3"

- name: Configure AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@b47578312673ae6fa5b5096b330d9fbac3d116df # v4.2.1
with:
role-to-assume: arn:aws:iam::${{env.AWS_ACCOUNT}}:role/gh_techdocs_role
role-session-name: gh_techdocs_role
aws-region: ${{env.AWS_REGION}}

- name: Build and publish documentation
run: |
# Generate with verbose output for better error messages
npx techdocs-cli generate --no-docker --verbose

# Publish
npx techdocs-cli publish --publisher-type awsS3 --storage-name ${{ secrets.AWS_S3_TECHDOCS_BUCKET }} --entity ${{ steps.get_entity.outputs.ENTITY_INFO }}
21 changes: 21 additions & 0 deletions .github/workflows/scripts/get_entity_info.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

set -e pipefail

if [ ! -f "catalog-info.yaml" ]; then
echo "Error: catalog-info.yaml not found"
exit 1
fi

# Parse catalog-info.yaml
KIND=$(grep '^kind:' catalog-info.yaml | cut -d':' -f2 | sed 's/ //g')
NAME=$(grep '^ name:' catalog-info.yaml | cut -d':' -f2 | sed 's/ //g')
NAMESPACE=$(grep '^ namespace:' catalog-info.yaml | cut -d':' -f2 | sed 's/ //g')

# Use default namespace if not specified
if [ -z "$NAMESPACE" ]; then
NAMESPACE="default"
fi

# return the kind, name and namespace in a format <Namespace/Kind/Name>
echo "$NAMESPACE/$KIND/$NAME"
17 changes: 17 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Automatic website scanning

The purpose of this repository is to coordinate the automatic scanning of CDS websites for security vulnerabilities and accessibility issues. Issues are automatically exported to Azure Sentinel for visualization and triage.


| Site | [A11yWatch](https://github.com/a11ywatch/github-actions) | [Lighthouse](https://github.com/treosh/lighthouse-ci-action) | [Nuclei](https://github.com/projectdiscovery/nuclei-action) | [OWASP-Zap](https://github.com/zaproxy/action-full-scan) |
|---|---|---|---|---|
|[https://digital.canada.ca/](https://digital.canada.ca/)|βœ…|βœ…|βœ…|⭕️|
|[https://numerique.canada.ca/](https://numerique.canada.ca/)|βœ…|βœ…|βœ…|⭕️|
|[https://encrypted-message.cdssandbox.xyz/](https://encrypted-message.cdssandbox.xyz/)|βœ…|βœ…|βœ…|βœ…|
|[https://articles.cdssandbox.xyz](https://articles.cdssandbox.xyz/)|βœ…|βœ…|βœ…|⭕️|
|[https://staging.notification.cdssandbox.xyz](https://staging.notification.cdssandbox.xyz)|βœ…|βœ…|βœ…|βœ…|
|[https://forms-staging.cdssandbox.xyz](https://forms-staging.cdssandbox.xyz)|⭕️|βœ…|βœ…|⭕️|
|[https://design-system.alpha.canada.ca/en/](https://design.alpha.canada.ca/en/)|βœ…|βœ…|βœ…|⭕️|
|[https://app.gc-signin.cdssandbox.xyz/](https://app.gc-signin.cdssandbox.xyz/)|βœ…|βœ…|βœ…|βœ…|
|[https://gc-signin.cdssandbox.xyz/](https://gc-signin.cdssandbox.xyz/en/)|βœ…|βœ…|βœ…|βœ…|
|[https://superset.cdssandbox.xyz/](https://superset.cdssandbox.xyz/)|⭕️|⭕️|βœ…|βœ…|
7 changes: 7 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
site_name: "automatic-website-scanning"

plugins:
- techdocs-core

nav:
- Home: index.md