rails_template_18f 0.8.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/Gemfile.lock +58 -28
  4. data/README.md +5 -5
  5. data/Rakefile +12 -0
  6. data/SECURITY.md +18 -0
  7. data/lib/generators/rails_template18f/active_storage/active_storage_generator.rb +2 -9
  8. data/lib/generators/rails_template18f/active_storage/templates/oscal/component-definitions/active_storage/component-definition.json +69 -0
  9. data/lib/generators/rails_template18f/circleci/circleci_generator.rb +3 -3
  10. data/lib/generators/rails_template18f/circleci/templates/bin/ci-server-start +1 -1
  11. data/lib/generators/rails_template18f/circleci/templates/circleci/config.yml.tt +59 -16
  12. data/lib/generators/rails_template18f/circleci/templates/docker-compose.ci.yml +1 -0
  13. data/lib/generators/rails_template18f/circleci/templates/oscal/component-definitions/circleci/component-definition.json.tt +310 -0
  14. data/lib/generators/rails_template18f/github_actions/github_actions_generator.rb +7 -12
  15. data/lib/generators/rails_template18f/github_actions/templates/github/actions/setup-languages/action.yml.tt +1 -1
  16. data/lib/generators/rails_template18f/github_actions/templates/github/actions/setup-project/action.yml.tt +1 -0
  17. data/lib/generators/rails_template18f/github_actions/templates/github/actions/trestle-cmd/action.yml +20 -0
  18. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/assemble-ssp.yml.tt +26 -0
  19. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/brakeman-analysis.yml +6 -2
  20. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/dependency-scans.yml +4 -4
  21. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-production.yml.tt +14 -25
  22. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-staging.yml.tt +14 -25
  23. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/owasp-daily-scan.yml.tt +8 -3
  24. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/owasp-scan.yml.tt +4 -3
  25. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/pa11y.yml.tt +6 -2
  26. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/rspec.yml.tt +1 -1
  27. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/terraform-production.yml +20 -58
  28. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/terraform-staging.yml +20 -58
  29. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/validate-ssp.yml.tt +46 -0
  30. data/lib/generators/rails_template18f/github_actions/templates/oscal/component-definitions/github_actions/component-definition.json.tt +310 -0
  31. data/lib/generators/rails_template18f/i18n/i18n_generator.rb +7 -6
  32. data/lib/generators/rails_template18f/i18n/templates/config/locales/en.yml.tt +1 -0
  33. data/lib/generators/rails_template18f/i18n/templates/config/locales/es.yml +2 -0
  34. data/lib/generators/rails_template18f/i18n/templates/config/locales/fr.yml +2 -0
  35. data/lib/generators/rails_template18f/i18n/templates/config/locales/zh.yml +2 -0
  36. data/lib/generators/rails_template18f/newrelic/newrelic_generator.rb +2 -37
  37. data/lib/generators/rails_template18f/newrelic/templates/oscal/component-definitions/newrelic/component-definition.json.tt +113 -0
  38. data/lib/generators/rails_template18f/oscal/oscal_generator.rb +55 -17
  39. data/lib/generators/rails_template18f/oscal/templates/bin/trestle.tt +10 -0
  40. data/lib/generators/rails_template18f/oscal/templates/doc/compliance/oscal/trestle-config.yaml.tt +6 -0
  41. data/lib/generators/rails_template18f/sidekiq/sidekiq_generator.rb +2 -2
  42. data/lib/generators/rails_template18f/terraform/templates/terraform/README.md.tt +1 -1
  43. data/lib/generators/rails_template18f/terraform/templates/terraform/production/main.tf.tt +4 -4
  44. data/lib/generators/rails_template18f/terraform/templates/terraform/production/providers.tf.tt +0 -1
  45. data/lib/generators/rails_template18f/terraform/templates/terraform/staging/main.tf.tt +4 -4
  46. data/lib/generators/rails_template18f/terraform/templates/terraform/staging/providers.tf.tt +0 -1
  47. data/lib/rails_template18f/generators/base.rb +9 -24
  48. data/lib/rails_template18f/generators/pipeline_options.rb +0 -172
  49. data/lib/rails_template18f/version.rb +1 -1
  50. data/rails-template-18f.gemspec +6 -6
  51. data/railsrc +1 -0
  52. data/railsrc-hotwire +1 -0
  53. data/template.rb +48 -44
  54. data/templates/Brewfile +2 -2
  55. data/templates/README.md.tt +3 -4
  56. data/templates/app/assets/stylesheets/uswds-components.scss +6 -0
  57. data/templates/app/assets/stylesheets/uswds-overrides/_index.scss +2 -0
  58. data/templates/app/assets/stylesheets/uswds-overrides/_override-usa-banner.scss +13 -0
  59. data/templates/app/assets/stylesheets/uswds-overrides/_override-usa-language-selector.scss +38 -0
  60. data/templates/app/views/application/_header.html.erb +6 -5
  61. data/templates/app/views/application/_language_selector.html.erb +35 -0
  62. data/templates/app/views/application/_usa_banner.html.erb +21 -16
  63. data/templates/bin/owasp-scan +3 -3
  64. data/templates/bin/pa11y-scan +1 -1
  65. data/templates/config/environments/ci.rb +1 -0
  66. data/templates/pa11y.js +12 -0
  67. data/templates/pa11yci.js +8 -0
  68. metadata +31 -16
  69. data/templates/pa11yci +0 -9
  70. /data/lib/generators/rails_template18f/circleci/templates/{Dockerfile.tt → Dockerfile.ci.tt} +0 -0
@@ -28,7 +28,7 @@ jobs:
28
28
  POSTGRES_PASSWORD: postgres
29
29
 
30
30
  steps:
31
- - uses: actions/checkout@v2
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.6.1
41
+ uses: zaproxy/action-baseline@v0.12.0
42
42
  with:
43
- docker_name: 'owasp/zap2docker-weekly'
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'
@@ -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@v2
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()
@@ -21,7 +21,7 @@ jobs:
21
21
  POSTGRES_PASSWORD: postgres
22
22
 
23
23
  steps:
24
- - uses: actions/checkout@v2
24
+ - uses: actions/checkout@v4
25
25
 
26
26
  - id: setup
27
27
  uses: ./.github/actions/setup-project
@@ -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
- defaults:
9
- run:
10
- working-directory: terraform/production
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@v2
20
+ uses: actions/checkout@v4
20
21
 
21
- - name: Terraform format
22
- id: format
23
- run: terraform fmt -check
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: Terraform validate
33
- id: validation
34
- run: terraform validate -no-color
27
+ - name: terraform fmt
28
+ uses: dflook/terraform-fmt-check@v1
29
+ with:
30
+ path: terraform/production
35
31
 
36
- - name: Terraform plan
37
- id: plan
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
- script: |
59
- const output = `Terraform Format and Style: ${{ steps.format.outcome }}
60
- Terraform Initialization: ${{ steps.init.outcome }}
61
- Terraform Validation: ${{ steps.validation.outcome }}
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
- defaults:
9
- run:
10
- working-directory: terraform/staging
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@v2
20
+ uses: actions/checkout@v4
20
21
 
21
- - name: Terraform format
22
- id: format
23
- run: terraform fmt -check
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: Terraform validate
33
- id: validation
34
- run: terraform validate -no-color
27
+ - name: terraform fmt
28
+ uses: dflook/terraform-fmt-check@v1
29
+ with:
30
+ path: terraform/staging
35
31
 
36
- - name: Terraform plan
37
- id: plan
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
- script: |
59
- const output = `Terraform Format and Style: ${{ steps.format.outcome }}
60
- Terraform Initialization: ${{ steps.init.outcome }}
61
- Terraform Validation: ${{ steps.validation.outcome }}
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 }}
@@ -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
+ });
@@ -0,0 +1,310 @@
1
+ {
2
+ "component-definition": {
3
+ "uuid": "b804945e-c0cb-4254-bebf-2c599f61c7a4",
4
+ "metadata": {
5
+ "title": "GitHub Actions Component Definition.",
6
+ "last-modified": "2024-06-10T21:22:51.617878+00:00",
7
+ "version": "0.0.1",
8
+ "oscal-version": "1.1.2"
9
+ },
10
+ "components": [
11
+ {
12
+ "uuid": "d86c09e8-8003-4223-8070-a87b83e8b118",
13
+ "type": "service",
14
+ "title": "GitHub Actions",
15
+ "description": "GitHub Actions CI/CD Pipeline",
16
+ "props": [
17
+ {
18
+ "name": "Rule_Id",
19
+ "value": "properly-configured",
20
+ "remarks": "rule-config"
21
+ },
22
+ {
23
+ "name": "Rule_Description",
24
+ "value": "System Owner has configured the system to properly utilize CI/CD for all tests, scans, and deployments",
25
+ "remarks": "rule-config"
26
+ },
27
+ {
28
+ "name": "Rule_Id",
29
+ "value": "branch-protections",
30
+ "remarks": "rule-branch"
31
+ },
32
+ {
33
+ "name": "Rule_Description",
34
+ "value": "System Owner has configured GitHub branch protections as described in control",
35
+ "remarks": "rule-branch"
36
+ }
37
+ ],
38
+ "control-implementations": [
39
+ {
40
+ "uuid": "aa42c844-500d-4072-b92e-53e063a635bd",
41
+ "source": "trestle://profiles/lato/profile.json",
42
+ "description": "",
43
+ "implemented-requirements": [
44
+ {
45
+ "uuid": "e0fa131a-1139-4a17-ab7f-8cf52a345288",
46
+ "control-id": "ca-7",
47
+ "description": "",
48
+ "statements": [
49
+ {
50
+ "statement-id": "ca-7_smt.a",
51
+ "uuid": "6d113e20-3fc5-4937-8ff3-61c1bb1af2d0",
52
+ "description": "* <%= app_name %> DevOps staff review OWASP and Dependency scans every build, or at least weekly.\n* <%= app_name %> DevOps staff and the GSA ISSO review Web Application vulnerability scans on a weekly basis.\n* <%= app_name %> Administrators and DevOps staff review changes for potential security impact and engage the <%= app_name %> ISSO and ISSM who will review or engage assessment staff as needed.",
53
+ "props": [
54
+ {
55
+ "name": "Rule_Id",
56
+ "value": "properly-configured"
57
+ },
58
+ {
59
+ "name": "implementation-status",
60
+ "value": "partial"
61
+ }
62
+ ]
63
+ }
64
+ ]
65
+ },
66
+ {
67
+ "uuid": "624e1e20-4c20-4a5c-a3c0-2ef603090498",
68
+ "control-id": "cm-2.2",
69
+ "description": "The <%= app_name %> team develops, documents, and maintains a current baseline for the <%= app_name %> application\ncomponents under configuration control, managed via git and github.com, and orchestrated using GitHub Actions\nand the cloud.gov Cloud Foundry CLI.\n\nNote: All cloud.gov brokered services (including databases) are fully managed by the cloud.gov platform.\nDue to this, the configuration and security of these services are not included in the <%= app_name %> configuration baseline.",
70
+ "props": [
71
+ {
72
+ "name": "Rule_Id",
73
+ "value": "properly-configured"
74
+ },
75
+ {
76
+ "name": "implementation-status",
77
+ "value": "implemented"
78
+ }
79
+ ]
80
+ },
81
+ {
82
+ "uuid": "8906821c-bf90-4cc9-afda-db61d2e8a212",
83
+ "control-id": "cm-3.1",
84
+ "description": "",
85
+ "statements": [
86
+ {
87
+ "statement-id": "cm-3.1_smt.f",
88
+ "uuid": "4b5c5828-16b9-4cf1-a329-f447726bbcef",
89
+ "description": "GitHub Actions is used to execute proposed changes to the information system.\nAdministrators and Developers for <%= app_name %> are automatically notified of\nthe success or failure of the change execution via the GitHub notification system.",
90
+ "props": [
91
+ {
92
+ "name": "Rule_Id",
93
+ "value": "properly-configured"
94
+ },
95
+ {
96
+ "name": "implementation-status",
97
+ "value": "implemented"
98
+ }
99
+ ]
100
+ }
101
+ ]
102
+ },
103
+ {
104
+ "uuid": "db085642-8b08-476f-9d08-fe4c71cb2e40",
105
+ "control-id": "ra-5",
106
+ "description": "",
107
+ "statements": [
108
+ {
109
+ "statement-id": "ra-5_smt.a",
110
+ "uuid": "30d6c6fc-0e55-484e-8832-35d9c4c511f9",
111
+ "description": "Any vulnerabilities in <%= app_name %> would have to be introduced at time of deployment because <%= app_name %>\nis a set of cloud.gov managed applications with SSH disabled in Production. <%= app_name %> monitors for\nvulnerabilities by ensuring that scans for vulnerabilities in the information system and hosted applications occur\ndaily and when new code is deployed.\n\nOWASP ZAP scans are built into the GitHub Actions CI/CD pipeline and runs a series of web vulnerability scans before\na successful deploy can be made to cloud.gov. Any issues or alerts caused by the scan are documented by <%= app_name %>\nOperations and cause the deployment to fail. Issues are tracked in GitHub. The issue posted will provide information\non which endpoints are vulnerable and the level of vulnerability, ranging from **False Positive** to **High**.\nThe issue also provides a detailed report formatted in html, json, and markdown.\n\nSystem Administrators are responsible for reporting any new vulnerabilities reported by the OWASP ZAP scan to the <%= app_name %> ISSO.",
112
+ "props": [
113
+ {
114
+ "name": "Rule_Id",
115
+ "value": "properly-configured"
116
+ },
117
+ {
118
+ "name": "implementation-status",
119
+ "value": "implemented"
120
+ }
121
+ ]
122
+ },
123
+ {
124
+ "statement-id": "ra-5_smt.b",
125
+ "uuid": "71880ff9-0d82-440c-ab8d-29f0abab0045",
126
+ "description": "1. Alerts from each ZAP vulnerability scan are automatically reported in GitHub as an issue on the <%= app_name %> repository. This issue will enumerate each finding and detail the type and severity of the vulnerability. <%= app_name %> Developers and <%= app_name %> Administrators receive automated alerts via GitHub of the issues to remediate. Scan results are sent to the <%= app_name %> System Owner by <%= app_name %> Administrators. The vulnerabilities are analyzed and prioritized within GitHub based on input from the System Owner and ISSO.\n1. The ZAP report contains vulnerabilities grouped by type and by risk level. The report also provides a detailed report formatted in html, json, and markdown. The reported issues also include the CVE item associated with the vulnerability.\n1. Vulnerabilities are classified by ZAP under a level range from **False Positive** to **High**. The impact level is used to drive the priority of the effort to remediate.",
127
+ "props": [
128
+ {
129
+ "name": "Rule_Id",
130
+ "value": "properly-configured"
131
+ },
132
+ {
133
+ "name": "implementation-status",
134
+ "value": "implemented"
135
+ }
136
+ ]
137
+ },
138
+ {
139
+ "statement-id": "ra-5_smt.c",
140
+ "uuid": "6ab6f84e-5a5d-4cf5-94fa-569be0f1fa61",
141
+ "description": "The ZAP vulnerability report contains information about how the attack was made and suggested solutions for each vulnerability found. Any static code analysis findings identified during automation as part of the GitHub pull request process must be reviewed, analyzed, and resolved by the <%= app_name %> Developer before the team can merge the pull request.",
142
+ "props": [
143
+ {
144
+ "name": "Rule_Id",
145
+ "value": "properly-configured"
146
+ },
147
+ {
148
+ "name": "Rule_Id",
149
+ "value": "branch-protections"
150
+ },
151
+ {
152
+ "name": "implementation-status",
153
+ "value": "planned"
154
+ }
155
+ ]
156
+ }
157
+ ]
158
+ },
159
+ {
160
+ "uuid": "75fba3a0-30f6-4fb0-9929-99627252560a",
161
+ "control-id": "sa-11.1",
162
+ "description": "The CI/CD pipeline utilizes multiple tools to perform static code analysis for security and privacy:\n\n* **Brakeman** is a static code scanner designed to find security issues in Ruby on Rails code. It can flag potential SQL injection,\nCommand Injection, open redirects, and other common vulnerabilities.\n* **bundle-audit** checks Ruby dependencies against a database of known CVE numbers.\n* **yarn audit** checks Javascript dependencies against a database of known CVE numbers.\n* **OWASP ZAP** is a dynamic security scanner that can simulate actual attacks on a running server.\n\nAn additional RAILS_ENV has been created called ci. It inherits from production to ensure that the system being tested is as close as possible to production while allowing for overrides such as bypassing authentication in a secure way.",
163
+ "props": [
164
+ {
165
+ "name": "Rule_Id",
166
+ "value": "properly-configured"
167
+ },
168
+ {
169
+ "name": "implementation-status",
170
+ "value": "implemented"
171
+ }
172
+ ]
173
+ },
174
+ {
175
+ "uuid": "674c916f-ffef-4751-8073-2533e37d046f",
176
+ "control-id": "sa-22",
177
+ "description": "",
178
+ "statements": [
179
+ {
180
+ "statement-id": "sa-22_smt.a",
181
+ "uuid": "14ab85ab-1746-47d1-9ccb-21a736013899",
182
+ "description": "The <%= app_name %> application is built and supported by the <%= app_name %> DevOps staff.\n\nThe application utilizes public open source Ruby and NodeJS components.\n\nThe application utilizes dependency scanning tools Bundle Audit and Yarn Audit to find vulnerable or insecure dependencies.\n\nIf a vulnerable or insecure dependency is found it will be upgraded or replaced. Additionally the <%= app_name %> team code review processes include a review of the health (up to date, supported, many individuals involved) of direct open source dependencies.",
183
+ "props": [
184
+ {
185
+ "name": "Rule_Id",
186
+ "value": "properly-configured"
187
+ },
188
+ {
189
+ "name": "implementation-status",
190
+ "value": "implemented"
191
+ }
192
+ ]
193
+ },
194
+ {
195
+ "statement-id": "sa-22_smt.b",
196
+ "uuid": "44646913-4919-4725-bd26-7647213a6469",
197
+ "description": "There are currently no unsupported system components within <%= app_name %>. In case an unsupported system component is required to maintain <%= app_name %>, the <%= app_name %> System Owner will be consulted to make a determination in coordination with the <%= app_name %> ISSO and ISSM.",
198
+ "props": [
199
+ {
200
+ "name": "Rule_Id",
201
+ "value": "properly-configured"
202
+ },
203
+ {
204
+ "name": "implementation-status",
205
+ "value": "implemented"
206
+ }
207
+ ]
208
+ }
209
+ ]
210
+ },
211
+ {
212
+ "uuid": "001779d3-01b4-4f5b-a9ee-5b78a32d9b9f",
213
+ "control-id": "sc-28.1",
214
+ "description": "As an additional layer of protection, all PII data is encrypted using [Active Record Encryption — Ruby on Rails Guides](https://guides.rubyonrails.org/active_record_encryption.html).\nThis encryption is implemented in a using non-deterministic AES-256-GCM through Ruby's openssl library with a 256-bit key and a random initialization vector {rails crypto module}.\n\nThe Data Encryption Key is stored in the credentials.yml file in an encrypted format by Ruby's openssl library using the AES-128-GCM cipher,\nand is built into the application package.\n\nThe credentials.yml decryption key is stored in GitHub Actions and injected into the running application as an environmental variable. The application then uses this key\nto decrypt the credentials.yml file and obtain the Data Encryption Key.\n\nA backup of the key is stored by the Lead Developer and System Owner within a keepass database stored in Google Drive.",
215
+ "props": [
216
+ {
217
+ "name": "Rule_Id",
218
+ "value": "properly-configured"
219
+ },
220
+ {
221
+ "name": "implementation-status",
222
+ "value": "partial"
223
+ }
224
+ ]
225
+ },
226
+ {
227
+ "uuid": "0feeb621-8ce2-49f9-96a9-366e7e2ebee4",
228
+ "control-id": "si-2",
229
+ "description": "",
230
+ "statements": [
231
+ {
232
+ "statement-id": "si-2_smt.a",
233
+ "uuid": "9545b50e-f930-4875-afef-f5e5c566be74",
234
+ "description": "Flaw and vulnerability checks are built into the <%= app_name %> CI/CD pipeline and automated to ensure compliance. Dynamic vulnerability scans are performed against <%= app_name %> before a successful deployment and reports issues after every scan.\n\nCompliance is documented in sections SA-11 and RA-5. The <%= app_name %> DevOps team uses GitHub as the Product Backlog to track and prioritize issues related to system flaws.\n\nThe responsibility of remediating flaws and vulnerabilities (once a remediation is available) falls on the <%= app_name %> Developer, who updates the <%= app_name %> code and deploys fixes as part of the normal development and CI/CD process.",
235
+ "props": [
236
+ {
237
+ "name": "Rule_Id",
238
+ "value": "properly-configured"
239
+ },
240
+ {
241
+ "name": "Rule_Id",
242
+ "value": "branch-protections"
243
+ },
244
+ {
245
+ "name": "implementation-status",
246
+ "value": "implemented"
247
+ }
248
+ ]
249
+ },
250
+ {
251
+ "statement-id": "si-2_smt.b",
252
+ "uuid": "f2713c7a-6ae5-41d6-98a8-f39519e68ec1",
253
+ "description": "Any flaws or vulnerabilities resolved in <%= app_name %> result in a GitHub issue for triage via the <%= app_name %> CM Configuration Control process described in CM-2(2). After resolving a vulnerability or flaw in <%= app_name %>, unit tests and integration tests are updated to prevent further inclusion of similar flaws.\n\n* All GitHub tickets have accompanying Acceptance Criteria that are used to create unit tests.\n* Unit tests are run on the Development environment when new code is pushed.\n* Integration tests are run on the Test environment when the remediation is deployed via the CI/CD process to ensure that the production environment does not suffer from any side effects of the vulnerability remediation.\n* Integration tests are run on the Prod environment when the remediation is deployed via the CI/CD process to validate the remediation and application functionality.\n* All findings that are not remediated immediately are tracked in the #{app_name} Plan of Action and Milestones (POAM) by <%= app_name %> Operations and the <%= app_name %> ISSO.",
254
+ "props": [
255
+ {
256
+ "name": "Rule_Id",
257
+ "value": "properly-configured"
258
+ },
259
+ {
260
+ "name": "implementation-status",
261
+ "value": "implemented"
262
+ }
263
+ ]
264
+ }
265
+ ]
266
+ },
267
+ {
268
+ "uuid": "d9305c54-588b-4e58-8bb6-2dcfa9d50c9f",
269
+ "control-id": "si-10",
270
+ "description": "All inputs from the end user are parameterized prior to use to avoid potential sql injection.\n\nBrakeman scanner is impelmented within GitHub Actions which further identifies coding practices\nthat may lead to application vulnerabilities that are a result of improper input validation.",
271
+ "props": [
272
+ {
273
+ "name": "Rule_Id",
274
+ "value": "properly-configured"
275
+ },
276
+ {
277
+ "name": "implementation-status",
278
+ "value": "partial"
279
+ }
280
+ ]
281
+ },
282
+ {
283
+ "uuid": "68820fd8-8a19-4074-aedb-9dbb9e175339",
284
+ "control-id": "sr-3",
285
+ "description": "",
286
+ "statements": [
287
+ {
288
+ "statement-id": "sr-3_smt.b",
289
+ "uuid": "e265c455-ccec-4c34-afda-952498c79118",
290
+ "description": "A complete Software Bill of Materials (SBOM) for all Ruby dependencies is automatically\ngenerated by GitHub Actions on each push to GitHub as well as on a nightly basis. These can be downloaded\nfrom the applicable artifact section for each CI job.",
291
+ "props": [
292
+ {
293
+ "name": "Rule_Id",
294
+ "value": "properly-configured"
295
+ },
296
+ {
297
+ "name": "implementation-status",
298
+ "value": "partial"
299
+ }
300
+ ]
301
+ }
302
+ ]
303
+ }
304
+ ]
305
+ }
306
+ ]
307
+ }
308
+ ]
309
+ }
310
+ }
@@ -36,6 +36,7 @@ module RailsTemplate18f
36
36
  end
37
37
 
38
38
  def install_translations
39
+ app_name # reference app_name here so the instance var is set before entering the "inside" block
39
40
  inside "config/locales" do
40
41
  template "en.yml"
41
42
  languages.each do |lang|
@@ -56,12 +57,12 @@ module RailsTemplate18f
56
57
 
57
58
  def install_nav_helper
58
59
  inject_into_module "app/helpers/application_helper.rb", "ApplicationHelper", indent(<<~'EOH')
59
- def format_active_locale(locale_string)
60
- link_classes = "usa-nav__link"
61
- if locale_string.to_sym == I18n.locale
62
- link_classes = "#{link_classes} usa-current"
63
- end
64
- link_to t("shared.languages.#{locale_string}"), root_path(locale: locale_string), class: link_classes
60
+ def active_locale?(locale_string)
61
+ locale_string.to_sym == I18n.locale
62
+ end
63
+
64
+ def language_span(locale_string)
65
+ content_tag :span, t("shared.languages.#{locale_string}"), lang: locale_string, "xml:lang": locale_string
65
66
  end
66
67
  EOH
67
68
  end
@@ -21,5 +21,6 @@ en:
21
21
  en: English
22
22
  es: Español
23
23
  fr: Français
24
+ selector: Languages
24
25
  zh: 中文
25
26
  skip_link: Skip to main content
@@ -16,4 +16,6 @@ es:
16
16
  demo_banner: SITIO DE PRUEBA - No utilice información personal real (sólo para propósitos de demostración) - SITIO DE PRUEBA
17
17
  menu: Menú
18
18
  primary: Navegacion primaria
19
+ languages:
20
+ selector: Idiomas
19
21
  skip_link: Salte al contenido principal