rails_template_18f 0.8.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/Gemfile.lock +58 -28
- data/README.md +5 -5
- data/Rakefile +12 -0
- data/SECURITY.md +18 -0
- data/lib/generators/rails_template18f/active_storage/active_storage_generator.rb +2 -9
- data/lib/generators/rails_template18f/active_storage/templates/oscal/component-definitions/active_storage/component-definition.json +69 -0
- data/lib/generators/rails_template18f/auditree/auditree_generator.rb +84 -0
- data/lib/generators/rails_template18f/auditree/templates/bin/auditree.tt +29 -0
- data/lib/generators/rails_template18f/auditree/templates/github/actions/auditree-cmd/action.yml.tt +31 -0
- data/lib/generators/rails_template18f/auditree/templates/github/workflows/auditree-validation.yml.tt +42 -0
- data/lib/generators/rails_template18f/circleci/circleci_generator.rb +3 -3
- data/lib/generators/rails_template18f/circleci/templates/bin/ci-server-start +1 -1
- data/lib/generators/rails_template18f/circleci/templates/circleci/config.yml.tt +59 -16
- data/lib/generators/rails_template18f/circleci/templates/docker-compose.ci.yml +1 -0
- data/lib/generators/rails_template18f/circleci/templates/oscal/component-definitions/circleci/component-definition.json.tt +310 -0
- data/lib/generators/rails_template18f/github_actions/github_actions_generator.rb +7 -12
- data/lib/generators/rails_template18f/github_actions/templates/github/actions/setup-languages/action.yml.tt +1 -1
- data/lib/generators/rails_template18f/github_actions/templates/github/actions/setup-project/action.yml.tt +1 -0
- data/lib/generators/rails_template18f/github_actions/templates/github/actions/trestle-cmd/action.yml +20 -0
- data/lib/generators/rails_template18f/github_actions/templates/github/workflows/assemble-ssp.yml.tt +26 -0
- data/lib/generators/rails_template18f/github_actions/templates/github/workflows/brakeman-analysis.yml +6 -2
- data/lib/generators/rails_template18f/github_actions/templates/github/workflows/dependency-scans.yml +4 -4
- data/lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-production.yml.tt +14 -25
- data/lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-staging.yml.tt +14 -25
- data/lib/generators/rails_template18f/github_actions/templates/github/workflows/owasp-daily-scan.yml.tt +8 -3
- data/lib/generators/rails_template18f/github_actions/templates/github/workflows/owasp-scan.yml.tt +4 -3
- data/lib/generators/rails_template18f/github_actions/templates/github/workflows/pa11y.yml.tt +6 -2
- data/lib/generators/rails_template18f/github_actions/templates/github/workflows/rspec.yml.tt +1 -1
- data/lib/generators/rails_template18f/github_actions/templates/github/workflows/terraform-production.yml +20 -58
- data/lib/generators/rails_template18f/github_actions/templates/github/workflows/terraform-staging.yml +20 -58
- data/lib/generators/rails_template18f/github_actions/templates/github/workflows/validate-ssp.yml.tt +46 -0
- data/lib/generators/rails_template18f/github_actions/templates/oscal/component-definitions/github_actions/component-definition.json.tt +310 -0
- data/lib/generators/rails_template18f/i18n/i18n_generator.rb +7 -6
- data/lib/generators/rails_template18f/i18n/templates/config/locales/en.yml.tt +1 -0
- data/lib/generators/rails_template18f/i18n/templates/config/locales/es.yml +2 -0
- data/lib/generators/rails_template18f/i18n/templates/config/locales/fr.yml +2 -0
- data/lib/generators/rails_template18f/i18n/templates/config/locales/zh.yml +2 -0
- data/lib/generators/rails_template18f/newrelic/newrelic_generator.rb +2 -37
- data/lib/generators/rails_template18f/newrelic/templates/oscal/component-definitions/newrelic/component-definition.json.tt +113 -0
- data/lib/generators/rails_template18f/oscal/oscal_generator.rb +55 -17
- data/lib/generators/rails_template18f/oscal/templates/bin/trestle.tt +10 -0
- data/lib/generators/rails_template18f/oscal/templates/doc/compliance/oscal/trestle-config.yaml.tt +6 -0
- data/lib/generators/rails_template18f/sidekiq/sidekiq_generator.rb +2 -2
- data/lib/generators/rails_template18f/terraform/templates/terraform/README.md.tt +1 -1
- data/lib/generators/rails_template18f/terraform/templates/terraform/production/main.tf.tt +4 -4
- data/lib/generators/rails_template18f/terraform/templates/terraform/production/providers.tf.tt +0 -1
- data/lib/generators/rails_template18f/terraform/templates/terraform/staging/main.tf.tt +4 -4
- data/lib/generators/rails_template18f/terraform/templates/terraform/staging/providers.tf.tt +0 -1
- data/lib/rails_template18f/generators/base.rb +9 -24
- data/lib/rails_template18f/generators/pipeline_options.rb +0 -172
- data/lib/rails_template18f/version.rb +1 -1
- data/rails-template-18f.gemspec +6 -6
- data/railsrc +1 -0
- data/railsrc-hotwire +1 -0
- data/template.rb +56 -44
- data/templates/Brewfile +2 -2
- data/templates/README.md.tt +3 -4
- data/templates/app/assets/stylesheets/uswds-components.scss +6 -0
- data/templates/app/assets/stylesheets/uswds-overrides/_index.scss +2 -0
- data/templates/app/assets/stylesheets/uswds-overrides/_override-usa-banner.scss +13 -0
- data/templates/app/assets/stylesheets/uswds-overrides/_override-usa-language-selector.scss +38 -0
- data/templates/app/views/application/_header.html.erb +6 -5
- data/templates/app/views/application/_language_selector.html.erb +35 -0
- data/templates/app/views/application/_usa_banner.html.erb +21 -16
- data/templates/bin/owasp-scan +3 -3
- data/templates/bin/pa11y-scan +1 -1
- data/templates/config/environments/ci.rb +1 -0
- data/templates/manifest.yml.tt +0 -1
- data/templates/pa11y.js +12 -0
- data/templates/pa11yci.js +8 -0
- metadata +35 -16
- data/templates/pa11yci +0 -9
- /data/lib/generators/rails_template18f/circleci/templates/{Dockerfile.tt → Dockerfile.ci.tt} +0 -0
@@ -7,47 +7,36 @@ on:
|
|
7
7
|
- 'doc/**'
|
8
8
|
- 'README.md'
|
9
9
|
|
10
|
+
permissions:
|
11
|
+
contents: read
|
12
|
+
pull-requests: write
|
13
|
+
|
10
14
|
jobs:
|
11
15
|
deploy:
|
12
16
|
name: Deploy to production
|
13
17
|
runs-on: ubuntu-latest
|
14
18
|
environment: production
|
19
|
+
env:
|
20
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
15
21
|
steps:
|
16
|
-
- uses: actions/checkout@
|
17
|
-
with:
|
18
|
-
fetch-depth: 2
|
22
|
+
- uses: actions/checkout@v4
|
19
23
|
<% if terraform? %>
|
20
|
-
- name: Check for changes to Terraform
|
21
|
-
id: changed-terraform-files
|
22
|
-
uses: tj-actions/changed-files@v1.1.2
|
23
|
-
with:
|
24
|
-
files: |
|
25
|
-
terraform/shared
|
26
|
-
terraform/production
|
27
|
-
- name: Terraform init
|
28
|
-
if: steps.changed-terraform-files.outputs.any_changed == 'true'
|
29
|
-
working-directory: terraform/production
|
30
|
-
env:
|
31
|
-
AWS_ACCESS_KEY_ID: ${{ secrets.TERRAFORM_STATE_ACCESS_KEY }}
|
32
|
-
AWS_SECRET_ACCESS_KEY: ${{ secrets.TERRAFORM_STATE_SECRET_ACCESS_KEY }}
|
33
|
-
run: terraform init
|
34
24
|
- name: Terraform apply
|
35
|
-
|
36
|
-
working-directory: terraform/production
|
25
|
+
uses: dflook/terraform-apply@v1
|
37
26
|
env:
|
38
|
-
AWS_ACCESS_KEY_ID: ${{ secrets.TERRAFORM_STATE_ACCESS_KEY }}
|
39
|
-
AWS_SECRET_ACCESS_KEY: ${{ secrets.TERRAFORM_STATE_SECRET_ACCESS_KEY }}
|
40
27
|
TF_VAR_cf_user: ${{ secrets.CF_USERNAME }}
|
41
28
|
TF_VAR_cf_password: ${{ secrets.CF_PASSWORD }}
|
42
|
-
|
29
|
+
with:
|
30
|
+
path: terraform/production
|
31
|
+
backend_config: >
|
32
|
+
access_key=${{ secrets.TERRAFORM_STATE_ACCESS_KEY }}
|
33
|
+
secret_key=${{ secrets.TERRAFORM_STATE_SECRET_ACCESS_KEY }}
|
43
34
|
<% end %>
|
44
35
|
- name: Deploy app
|
45
36
|
uses: cloud-gov/cg-cli-tools@main
|
46
|
-
env:
|
47
|
-
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
|
48
37
|
with:
|
49
38
|
cf_username: ${{ secrets.CF_USERNAME }}
|
50
39
|
cf_password: ${{ secrets.CF_PASSWORD }}
|
51
40
|
cf_org: <%= cloud_gov_organization %>
|
52
41
|
cf_space: <%= cloud_gov_production_space %>
|
53
|
-
cf_command: push
|
42
|
+
cf_command: push --vars-file config/deployment/production.yml --var rails_master_key="${{ secrets.RAILS_MASTER_KEY }}" --strategy rolling
|
@@ -7,47 +7,36 @@ on:
|
|
7
7
|
- 'doc/**'
|
8
8
|
- 'README.md'
|
9
9
|
|
10
|
+
permissions:
|
11
|
+
contents: read
|
12
|
+
pull-requests: write
|
13
|
+
|
10
14
|
jobs:
|
11
15
|
deploy:
|
12
16
|
name: Deploy to staging
|
13
17
|
runs-on: ubuntu-latest
|
14
18
|
environment: staging
|
19
|
+
env:
|
20
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
15
21
|
steps:
|
16
|
-
- uses: actions/checkout@
|
17
|
-
with:
|
18
|
-
fetch-depth: 2
|
22
|
+
- uses: actions/checkout@v4
|
19
23
|
<% if terraform? %>
|
20
|
-
- name: Check for changes to Terraform
|
21
|
-
id: changed-terraform-files
|
22
|
-
uses: tj-actions/changed-files@v1.1.2
|
23
|
-
with:
|
24
|
-
files: |
|
25
|
-
terraform/shared
|
26
|
-
terraform/staging
|
27
|
-
- name: Terraform init
|
28
|
-
if: steps.changed-terraform-files.outputs.any_changed == 'true'
|
29
|
-
working-directory: terraform/staging
|
30
|
-
env:
|
31
|
-
AWS_ACCESS_KEY_ID: ${{ secrets.TERRAFORM_STATE_ACCESS_KEY }}
|
32
|
-
AWS_SECRET_ACCESS_KEY: ${{ secrets.TERRAFORM_STATE_SECRET_ACCESS_KEY }}
|
33
|
-
run: terraform init
|
34
24
|
- name: Terraform apply
|
35
|
-
|
36
|
-
working-directory: terraform/staging
|
25
|
+
uses: dflook/terraform-apply@v1
|
37
26
|
env:
|
38
|
-
AWS_ACCESS_KEY_ID: ${{ secrets.TERRAFORM_STATE_ACCESS_KEY }}
|
39
|
-
AWS_SECRET_ACCESS_KEY: ${{ secrets.TERRAFORM_STATE_SECRET_ACCESS_KEY }}
|
40
27
|
TF_VAR_cf_user: ${{ secrets.CF_USERNAME }}
|
41
28
|
TF_VAR_cf_password: ${{ secrets.CF_PASSWORD }}
|
42
|
-
|
29
|
+
with:
|
30
|
+
path: terraform/staging
|
31
|
+
backend_config: >
|
32
|
+
access_key=${{ secrets.TERRAFORM_STATE_ACCESS_KEY }}
|
33
|
+
secret_key=${{ secrets.TERRAFORM_STATE_SECRET_ACCESS_KEY }}
|
43
34
|
<% end %>
|
44
35
|
- name: Deploy app
|
45
36
|
uses: cloud-gov/cg-cli-tools@main
|
46
|
-
env:
|
47
|
-
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
|
48
37
|
with:
|
49
38
|
cf_username: ${{ secrets.CF_USERNAME }}
|
50
39
|
cf_password: ${{ secrets.CF_PASSWORD }}
|
51
40
|
cf_org: <%= cloud_gov_organization %>
|
52
41
|
cf_space: <%= cloud_gov_staging_space %>
|
53
|
-
cf_command: push
|
42
|
+
cf_command: push --vars-file config/deployment/staging.yml --var rails_master_key="${{ secrets.RAILS_MASTER_KEY }}" --strategy rolling
|
@@ -6,6 +6,10 @@ on:
|
|
6
6
|
# this will run at noon UTC every day (7am EST / 8am EDT)
|
7
7
|
- cron: '0 12 * * *'
|
8
8
|
|
9
|
+
permissions:
|
10
|
+
contents: read
|
11
|
+
issues: write
|
12
|
+
|
9
13
|
jobs:
|
10
14
|
owasp-scan:
|
11
15
|
name: OWASP ZAP Scan
|
@@ -25,7 +29,7 @@ jobs:
|
|
25
29
|
POSTGRES_PASSWORD: postgres
|
26
30
|
|
27
31
|
steps:
|
28
|
-
- uses: actions/checkout@
|
32
|
+
- uses: actions/checkout@v4
|
29
33
|
|
30
34
|
- id: setup
|
31
35
|
uses: ./.github/actions/setup-project
|
@@ -35,9 +39,10 @@ jobs:
|
|
35
39
|
database_url: ${{ steps.setup.outputs.database_url }}
|
36
40
|
|
37
41
|
- name: Run OWASP Full Scan
|
38
|
-
uses: zaproxy/action-full-scan@v0.
|
42
|
+
uses: zaproxy/action-full-scan@v0.10.0
|
39
43
|
with:
|
40
|
-
|
44
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
45
|
+
docker_name: 'ghcr.io/zaproxy/zaproxy:weekly'
|
41
46
|
target: 'http://localhost:3000/'
|
42
47
|
fail_action: true
|
43
48
|
rules_file_name: 'zap.conf'
|
data/lib/generators/rails_template18f/github_actions/templates/github/workflows/owasp-scan.yml.tt
CHANGED
@@ -28,7 +28,7 @@ jobs:
|
|
28
28
|
POSTGRES_PASSWORD: postgres
|
29
29
|
|
30
30
|
steps:
|
31
|
-
- uses: actions/checkout@
|
31
|
+
- uses: actions/checkout@v4
|
32
32
|
|
33
33
|
- id: setup
|
34
34
|
uses: ./.github/actions/setup-project
|
@@ -38,10 +38,11 @@ jobs:
|
|
38
38
|
database_url: ${{ steps.setup.outputs.database_url }}
|
39
39
|
|
40
40
|
- name: Run OWASP Baseline Scan
|
41
|
-
uses: zaproxy/action-baseline@v0.
|
41
|
+
uses: zaproxy/action-baseline@v0.12.0
|
42
42
|
with:
|
43
|
-
docker_name: '
|
43
|
+
docker_name: 'ghcr.io/zaproxy/zaproxy:weekly'
|
44
44
|
target: 'http://localhost:3000/'
|
45
45
|
fail_action: true
|
46
|
+
allow_issue_writing: false
|
46
47
|
rules_file_name: 'zap.conf'
|
47
48
|
cmd_options: '-I'
|
data/lib/generators/rails_template18f/github_actions/templates/github/workflows/pa11y.yml.tt
CHANGED
@@ -2,6 +2,10 @@ name: pa11y tests
|
|
2
2
|
|
3
3
|
on: [pull_request]
|
4
4
|
|
5
|
+
permissions:
|
6
|
+
contents: read
|
7
|
+
pull-requests: write
|
8
|
+
|
5
9
|
jobs:
|
6
10
|
pa11y_scan:
|
7
11
|
name: Pa11y Scan
|
@@ -21,7 +25,7 @@ jobs:
|
|
21
25
|
POSTGRES_PASSWORD: postgres
|
22
26
|
|
23
27
|
steps:
|
24
|
-
- uses: actions/checkout@
|
28
|
+
- uses: actions/checkout@v4
|
25
29
|
|
26
30
|
- id: setup
|
27
31
|
uses: ./.github/actions/setup-project
|
@@ -34,7 +38,7 @@ jobs:
|
|
34
38
|
shell: bash
|
35
39
|
run: |
|
36
40
|
set -o pipefail
|
37
|
-
yarn run pa11y-ci 2>&1 | tee pa11y_output.txt
|
41
|
+
yarn run pa11y-ci -c pa11yci.js 2>&1 | tee pa11y_output.txt
|
38
42
|
|
39
43
|
- name: Read pa11y_output file.
|
40
44
|
if: failure()
|
@@ -3,77 +3,39 @@ name: Run Terraform plan in production
|
|
3
3
|
on:
|
4
4
|
pull_request:
|
5
5
|
branches: [ production ]
|
6
|
-
paths: [ 'terraform/**' ]
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
permissions:
|
8
|
+
contents: read
|
9
|
+
pull-requests: write
|
11
10
|
|
12
11
|
jobs:
|
13
12
|
terraform:
|
14
13
|
name: Terraform plan
|
15
14
|
runs-on: ubuntu-latest
|
16
15
|
environment: production
|
16
|
+
env:
|
17
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
17
18
|
steps:
|
18
19
|
- name: Checkout
|
19
|
-
uses: actions/checkout@
|
20
|
+
uses: actions/checkout@v4
|
20
21
|
|
21
|
-
- name:
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
- name: Terraform init
|
26
|
-
id: init
|
27
|
-
env:
|
28
|
-
AWS_ACCESS_KEY_ID: ${{ secrets.TERRAFORM_STATE_ACCESS_KEY }}
|
29
|
-
AWS_SECRET_ACCESS_KEY: ${{ secrets.TERRAFORM_STATE_SECRET_ACCESS_KEY }}
|
30
|
-
run: terraform init
|
22
|
+
- name: terraform validate
|
23
|
+
uses: dflook/terraform-validate@v1
|
24
|
+
with:
|
25
|
+
path: terraform/production
|
31
26
|
|
32
|
-
- name:
|
33
|
-
|
34
|
-
|
27
|
+
- name: terraform fmt
|
28
|
+
uses: dflook/terraform-fmt-check@v1
|
29
|
+
with:
|
30
|
+
path: terraform/production
|
35
31
|
|
36
|
-
- name:
|
37
|
-
|
32
|
+
- name: terraform plan
|
33
|
+
uses: dflook/terraform-plan@v1
|
38
34
|
env:
|
39
|
-
AWS_ACCESS_KEY_ID: ${{ secrets.TERRAFORM_STATE_ACCESS_KEY }}
|
40
|
-
AWS_SECRET_ACCESS_KEY: ${{ secrets.TERRAFORM_STATE_SECRET_ACCESS_KEY }}
|
41
35
|
TF_VAR_cf_user: ${{ secrets.CF_USERNAME }}
|
42
36
|
TF_VAR_cf_password: ${{ secrets.CF_PASSWORD }}
|
43
|
-
run: terraform plan -no-color -input=false 2>&1 | tee plan_output.txt
|
44
|
-
|
45
|
-
- name: Read Terraform plan output file
|
46
|
-
id: terraform_output
|
47
|
-
uses: juliangruber/read-file-action@v1
|
48
|
-
if: ${{ always() }}
|
49
|
-
with:
|
50
|
-
path: ./terraform/production/plan_output.txt
|
51
|
-
|
52
|
-
# inspiration: https://learn.hashicorp.com/tutorials/terraform/github-actions#review-actions-workflow
|
53
|
-
- name: Update PR
|
54
|
-
uses: actions/github-script@v4
|
55
|
-
# we would like to update the PR even when a prior step failed
|
56
|
-
if: ${{ always() }}
|
57
37
|
with:
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
Terraform Plan: ${{ steps.plan.outcome }}
|
63
|
-
|
64
|
-
<details><summary>Show Plan</summary>
|
65
|
-
|
66
|
-
\`\`\`\n
|
67
|
-
${{ steps.terraform_output.outputs.content }}
|
68
|
-
\`\`\`
|
69
|
-
|
70
|
-
</details>
|
71
|
-
|
72
|
-
*Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`*`;
|
73
|
-
|
74
|
-
github.issues.createComment({
|
75
|
-
issue_number: context.issue.number,
|
76
|
-
owner: context.repo.owner,
|
77
|
-
repo: context.repo.repo,
|
78
|
-
body: output
|
79
|
-
})
|
38
|
+
path: terraform/production
|
39
|
+
backend_config: >
|
40
|
+
access_key=${{ secrets.TERRAFORM_STATE_ACCESS_KEY }}
|
41
|
+
secret_key=${{ secrets.TERRAFORM_STATE_SECRET_ACCESS_KEY }}
|
@@ -3,77 +3,39 @@ name: Run Terraform plan in staging
|
|
3
3
|
on:
|
4
4
|
pull_request:
|
5
5
|
branches: [ main ]
|
6
|
-
paths: [ 'terraform/**' ]
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
permissions:
|
8
|
+
contents: read
|
9
|
+
pull-requests: write
|
11
10
|
|
12
11
|
jobs:
|
13
12
|
terraform:
|
14
13
|
name: Terraform plan
|
15
14
|
runs-on: ubuntu-latest
|
16
15
|
environment: staging
|
16
|
+
env:
|
17
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
17
18
|
steps:
|
18
19
|
- name: Checkout
|
19
|
-
uses: actions/checkout@
|
20
|
+
uses: actions/checkout@v4
|
20
21
|
|
21
|
-
- name:
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
- name: Terraform init
|
26
|
-
id: init
|
27
|
-
env:
|
28
|
-
AWS_ACCESS_KEY_ID: ${{ secrets.TERRAFORM_STATE_ACCESS_KEY }}
|
29
|
-
AWS_SECRET_ACCESS_KEY: ${{ secrets.TERRAFORM_STATE_SECRET_ACCESS_KEY }}
|
30
|
-
run: terraform init
|
22
|
+
- name: terraform validate
|
23
|
+
uses: dflook/terraform-validate@v1
|
24
|
+
with:
|
25
|
+
path: terraform/staging
|
31
26
|
|
32
|
-
- name:
|
33
|
-
|
34
|
-
|
27
|
+
- name: terraform fmt
|
28
|
+
uses: dflook/terraform-fmt-check@v1
|
29
|
+
with:
|
30
|
+
path: terraform/staging
|
35
31
|
|
36
|
-
- name:
|
37
|
-
|
32
|
+
- name: terraform plan
|
33
|
+
uses: dflook/terraform-plan@v1
|
38
34
|
env:
|
39
|
-
AWS_ACCESS_KEY_ID: ${{ secrets.TERRAFORM_STATE_ACCESS_KEY }}
|
40
|
-
AWS_SECRET_ACCESS_KEY: ${{ secrets.TERRAFORM_STATE_SECRET_ACCESS_KEY }}
|
41
35
|
TF_VAR_cf_user: ${{ secrets.CF_USERNAME }}
|
42
36
|
TF_VAR_cf_password: ${{ secrets.CF_PASSWORD }}
|
43
|
-
run: terraform plan -no-color -input=false 2>&1 | tee plan_output.txt
|
44
|
-
|
45
|
-
- name: Read Terraform plan output file
|
46
|
-
id: terraform_output
|
47
|
-
uses: juliangruber/read-file-action@v1
|
48
|
-
if: ${{ always() }}
|
49
|
-
with:
|
50
|
-
path: ./terraform/staging/plan_output.txt
|
51
|
-
|
52
|
-
# inspiration: https://learn.hashicorp.com/tutorials/terraform/github-actions#review-actions-workflow
|
53
|
-
- name: Update PR
|
54
|
-
uses: actions/github-script@v4
|
55
|
-
# we would like to update the PR even when a prior step failed
|
56
|
-
if: ${{ always() }}
|
57
37
|
with:
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
Terraform Plan: ${{ steps.plan.outcome }}
|
63
|
-
|
64
|
-
<details><summary>Show Plan</summary>
|
65
|
-
|
66
|
-
\`\`\`\n
|
67
|
-
${{ steps.terraform_output.outputs.content }}
|
68
|
-
\`\`\`
|
69
|
-
|
70
|
-
</details>
|
71
|
-
|
72
|
-
*Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`*`;
|
73
|
-
|
74
|
-
github.issues.createComment({
|
75
|
-
issue_number: context.issue.number,
|
76
|
-
owner: context.repo.owner,
|
77
|
-
repo: context.repo.repo,
|
78
|
-
body: output
|
79
|
-
})
|
38
|
+
path: terraform/staging
|
39
|
+
backend_config: >
|
40
|
+
access_key=${{ secrets.TERRAFORM_STATE_ACCESS_KEY }}
|
41
|
+
secret_key=${{ secrets.TERRAFORM_STATE_SECRET_ACCESS_KEY }}
|
data/lib/generators/rails_template18f/github_actions/templates/github/workflows/validate-ssp.yml.tt
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
name: Validate OSCAL Assembly
|
2
|
+
|
3
|
+
on: [pull_request]
|
4
|
+
|
5
|
+
permissions:
|
6
|
+
contents: read
|
7
|
+
pull-requests: write
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
validate_ssp:
|
11
|
+
name: Validate SSP format
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@v4
|
15
|
+
|
16
|
+
- name: Validate SSP
|
17
|
+
uses: ./.github/actions/trestle-cmd
|
18
|
+
with:
|
19
|
+
cmd: trestle validate -f system-security-plans/<%= app_name %>/system-security-plan.json
|
20
|
+
|
21
|
+
check_ssp:
|
22
|
+
name: Check assembly is current
|
23
|
+
runs-on: ubuntu-latest
|
24
|
+
steps:
|
25
|
+
- uses: actions/checkout@v4
|
26
|
+
|
27
|
+
- name: Check assembly
|
28
|
+
uses: ./.github/actions/trestle-cmd
|
29
|
+
with:
|
30
|
+
cmd: assemble-ssp-json 2> /dev/null | grep "^No changes to assembled ssp"
|
31
|
+
|
32
|
+
- name: Comment on pull request
|
33
|
+
if: failure()
|
34
|
+
uses: actions/github-script@v4
|
35
|
+
with:
|
36
|
+
script: |
|
37
|
+
const output = `SSP assembly detected changes that aren't checked in.
|
38
|
+
|
39
|
+
Run \`bin/trestle assemble-ssp-json\` to ensure markdown changes are reflected in your SSP`;
|
40
|
+
|
41
|
+
github.issues.createComment({
|
42
|
+
issue_number: context.issue.number,
|
43
|
+
owner: context.repo.owner,
|
44
|
+
repo: context.repo.repo,
|
45
|
+
body: output
|
46
|
+
});
|