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
10 changes: 10 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Set update schedule for GitHub Actions

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
62 changes: 62 additions & 0 deletions .github/workflows/apply.yaml

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to approach this from a compliance perspective:

  1. How are changes to the various CSVs managed and protected? If I'm reading it right, the new workflows only run when the Terraform files change, so I wasn't sure how CSV changes get applied and logged. (3.4.3)

  2. How long are the Actions logs kept, and do they need to be longer for 800-171 and HIPAA? I believe GitHub caps it at 90 days for a public repo like this one. @knikolla may know offhand. (3.3.1, 3.4.3)

  3. Since a merge to main seems to change the org right away, should there be more controls over who can make changes, such as a required review before merge? Today that's the ops-core team. Is that meant to be the everyday path, or closer to a break-glass capability? And is the intent that this list will change as we approach production? (3.4.5)

  4. Will different environments (Open Science vs. HIPAA, for example) have different sets of approvers?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are changes to the various CSVs managed and protected? If I'm reading it right, the new workflows only run when the Terraform files change, so I wasn't sure how CSV changes get applied and logged. (3.4.3)

Despite your protestations to the contrary, you are an excellent reviewer! That was a good finding and was an error on my part; I have updated the workflows to trigger on changes to the csv files as well.

How long are the Actions logs kept, and do they need to be longer for 800-171 and HIPAA? I believe GitHub caps it at 90 days for a public repo like this one. @knikolla may know offhand. (3.3.1, 3.4.3)

The answer depends on what you're looking for:

  • Information about who authored a change is preserved in the git history. That is preserved indefinitely as part of the repository, barring someone editing history (which we can prevent through appropriate github rulesets).

  • Information about who approved a change is preserved in the pull request, which exists for the lifetime of the repository.

  • Information about who approved a change is also available in the organization audit logs for 180 days.

Since a merge to main seems to change the org right away, should there be more controls over who can make changes, such as a required review before merge? Today that's the ops-core team. Is that meant to be the everyday path, or closer to a break-glass capability? And is the intent that this list will change as we approach production? (3.4.5)

Once this merges, the immediately proximate pull request will be one that adds a branch protection ruleset to this repository requiring two approving reviews before a change can merge. I'm sure this list of approvers will change as we move forward.

Will different environments (Open Science vs. HIPAA, for example) have different sets of approvers?

If they do, we can address that through path-based protection rules in GitHub. This may require some restructuring of the repository (so that different classes of repository are managed in different paths).

Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Apply

on:
workflow_dispatch:
# schedule:
# - cron: "17 */4 * * *"
push:
paths:
- "**/*.tf"
- "**/*.tfvars"
- "**/*.csv"
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: false

permissions:
id-token: write
contents: read

jobs:
apply:
runs-on: ubuntu-latest
env:
TF_CLI_ARGS: "-no-color"
TF_IN_AUTOMATION: "true"
steps:
- uses: actions/checkout@v7

- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v3
with:
client-id: Iv23liMoEs2Rz8MBVfAe
private-key: ${{ secrets.CONFIG_APP_SECRET }}
owner: ${{ github.repository_owner }}

- uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1

- name: Setup OpenTofu
uses: opentofu/setup-opentofu@v2
with:
tofu_wrapper: false

- name: TF init
run: |
tofu init

- name: TF Validate
run: |
tofu validate

- name: TF Apply
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
run: |
tofu apply -concise -auto-approve
52 changes: 52 additions & 0 deletions .github/workflows/plan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Plan

on:
pull_request:
paths:
- "**/*.tf"
- "**/*.tfvars"
- "**/*.csv"

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: false

permissions:
id-token: write
contents: read

jobs:
plan:
# This workflow cannot run on pull requests from forked repositories
# (because we do not want to grant access to our AWS credentials to
# third-party code).
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
env:
TF_CLI_ARGS: "-no-color"
TF_CLI_ARGS_plan: "-lock=false"
TF_IN_AUTOMATION: "true"
steps:
- uses: actions/checkout@v7

- uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1

- name: Setup OpenTofu
uses: opentofu/setup-opentofu@v2
with:
tofu_wrapper: false

- name: TF init
run: |
tofu init

- name: TF Validate
run: |
tofu validate

- name: TF Plan
run: |
tofu plan
23 changes: 23 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Pre-commit

on:
workflow_dispatch:
pull_request:

jobs:
pre-commit:
runs-on: ubuntu-latest
env:
TF_CLI_ARGS: "-no-color"
TF_IN_AUTOMATION: "true"
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.13"
- uses: opentofu/setup-opentofu@v2
with:
tofu_wrapper: false
- uses: pre-commit/action@v3.0.1
with:
extra_args: --all-files
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ terraform.tfstate
terraform.tfstate.backup
.terraform
terraform.tfstate.*.backup
plan.*
29 changes: 29 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: check-merge-conflict
- id: end-of-file-fixer
- id: check-added-large-files
- id: check-case-conflict
- id: check-json
- id: check-symlinks
- id: detect-private-key

- repo: https://github.com/adrienverge/yamllint.git
rev: v1.35.1
hooks:
- id: yamllint
files: \.(yaml|yml)$
types: [file, yaml]
entry: yamllint --strict

- repo: local
hooks:
- id: tofu-fmt
pass_filenames: false
name: tofu-fmt
language: script
files: \.tf$
entry: ./scripts/tofu-local-hook.sh
10 changes: 10 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
extends: default
rules:
line-length: disable
document-start: disable
indentation:
indent-sequences: whatever
hyphens:
max-spaces-after: 4
truthy:
check-keys: false
8 changes: 8 additions & 0 deletions scripts/tofu-local-hook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

export TF_IN_AUTOMATION=true

if ! tofu fmt -check -diff; then
tofu fmt
exit 1
fi
Loading