rails_template_18f 0.8.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -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/auditree/auditree_generator.rb +84 -0
  10. data/lib/generators/rails_template18f/auditree/templates/bin/auditree.tt +29 -0
  11. data/lib/generators/rails_template18f/auditree/templates/github/actions/auditree-cmd/action.yml.tt +31 -0
  12. data/lib/generators/rails_template18f/auditree/templates/github/workflows/auditree-validation.yml.tt +42 -0
  13. data/lib/generators/rails_template18f/circleci/circleci_generator.rb +3 -3
  14. data/lib/generators/rails_template18f/circleci/templates/bin/ci-server-start +1 -1
  15. data/lib/generators/rails_template18f/circleci/templates/circleci/config.yml.tt +59 -16
  16. data/lib/generators/rails_template18f/circleci/templates/docker-compose.ci.yml +1 -0
  17. data/lib/generators/rails_template18f/circleci/templates/oscal/component-definitions/circleci/component-definition.json.tt +310 -0
  18. data/lib/generators/rails_template18f/github_actions/github_actions_generator.rb +7 -12
  19. data/lib/generators/rails_template18f/github_actions/templates/github/actions/setup-languages/action.yml.tt +1 -1
  20. data/lib/generators/rails_template18f/github_actions/templates/github/actions/setup-project/action.yml.tt +1 -0
  21. data/lib/generators/rails_template18f/github_actions/templates/github/actions/trestle-cmd/action.yml +20 -0
  22. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/assemble-ssp.yml.tt +26 -0
  23. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/brakeman-analysis.yml +6 -2
  24. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/dependency-scans.yml +4 -4
  25. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-production.yml.tt +14 -25
  26. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-staging.yml.tt +14 -25
  27. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/owasp-daily-scan.yml.tt +8 -3
  28. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/owasp-scan.yml.tt +4 -3
  29. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/pa11y.yml.tt +6 -2
  30. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/rspec.yml.tt +1 -1
  31. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/terraform-production.yml +20 -58
  32. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/terraform-staging.yml +20 -58
  33. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/validate-ssp.yml.tt +46 -0
  34. data/lib/generators/rails_template18f/github_actions/templates/oscal/component-definitions/github_actions/component-definition.json.tt +310 -0
  35. data/lib/generators/rails_template18f/i18n/i18n_generator.rb +7 -6
  36. data/lib/generators/rails_template18f/i18n/templates/config/locales/en.yml.tt +1 -0
  37. data/lib/generators/rails_template18f/i18n/templates/config/locales/es.yml +2 -0
  38. data/lib/generators/rails_template18f/i18n/templates/config/locales/fr.yml +2 -0
  39. data/lib/generators/rails_template18f/i18n/templates/config/locales/zh.yml +2 -0
  40. data/lib/generators/rails_template18f/newrelic/newrelic_generator.rb +2 -37
  41. data/lib/generators/rails_template18f/newrelic/templates/oscal/component-definitions/newrelic/component-definition.json.tt +113 -0
  42. data/lib/generators/rails_template18f/oscal/oscal_generator.rb +55 -17
  43. data/lib/generators/rails_template18f/oscal/templates/bin/trestle.tt +10 -0
  44. data/lib/generators/rails_template18f/oscal/templates/doc/compliance/oscal/trestle-config.yaml.tt +6 -0
  45. data/lib/generators/rails_template18f/sidekiq/sidekiq_generator.rb +2 -2
  46. data/lib/generators/rails_template18f/terraform/templates/terraform/README.md.tt +1 -1
  47. data/lib/generators/rails_template18f/terraform/templates/terraform/production/main.tf.tt +4 -4
  48. data/lib/generators/rails_template18f/terraform/templates/terraform/production/providers.tf.tt +0 -1
  49. data/lib/generators/rails_template18f/terraform/templates/terraform/staging/main.tf.tt +4 -4
  50. data/lib/generators/rails_template18f/terraform/templates/terraform/staging/providers.tf.tt +0 -1
  51. data/lib/rails_template18f/generators/base.rb +9 -24
  52. data/lib/rails_template18f/generators/pipeline_options.rb +0 -172
  53. data/lib/rails_template18f/version.rb +1 -1
  54. data/rails-template-18f.gemspec +6 -6
  55. data/railsrc +1 -0
  56. data/railsrc-hotwire +1 -0
  57. data/template.rb +56 -44
  58. data/templates/Brewfile +2 -2
  59. data/templates/README.md.tt +3 -4
  60. data/templates/app/assets/stylesheets/uswds-components.scss +6 -0
  61. data/templates/app/assets/stylesheets/uswds-overrides/_index.scss +2 -0
  62. data/templates/app/assets/stylesheets/uswds-overrides/_override-usa-banner.scss +13 -0
  63. data/templates/app/assets/stylesheets/uswds-overrides/_override-usa-language-selector.scss +38 -0
  64. data/templates/app/views/application/_header.html.erb +6 -5
  65. data/templates/app/views/application/_language_selector.html.erb +35 -0
  66. data/templates/app/views/application/_usa_banner.html.erb +21 -16
  67. data/templates/bin/owasp-scan +3 -3
  68. data/templates/bin/pa11y-scan +1 -1
  69. data/templates/config/environments/ci.rb +1 -0
  70. data/templates/manifest.yml.tt +0 -1
  71. data/templates/pa11y.js +12 -0
  72. data/templates/pa11yci.js +8 -0
  73. metadata +35 -16
  74. data/templates/pa11yci +0 -9
  75. /data/lib/generators/rails_template18f/circleci/templates/{Dockerfile.tt → Dockerfile.ci.tt} +0 -0
@@ -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
@@ -16,4 +16,6 @@ fr:
16
16
  demo_banner: SITE DE TEST - N’utilisez pas de véritables données personnelles (il s’agit d’une démonstration seulement) - SITE DE TEST
17
17
  menu: Menu
18
18
  primary: Navigation primaire
19
+ languages:
20
+ selector: Langages
19
21
  skip_link: Passer au contenu principal
@@ -13,4 +13,6 @@ zh:
13
13
  us_flag: 美国国旗
14
14
  header:
15
15
  primary: 主导航
16
+ languages:
17
+ selector: 语言
16
18
  skip_link: 跳转到主要内容
@@ -24,7 +24,7 @@ module RailsTemplate18f
24
24
 
25
25
  def install_gem
26
26
  return if gem_installed?("newrelic_rpm")
27
- gem "newrelic_rpm", "~> 8.4"
27
+ gem "newrelic_rpm", "~> 9.10"
28
28
  bundle_install
29
29
  end
30
30
 
@@ -58,42 +58,7 @@ EOB
58
58
  end
59
59
 
60
60
  def update_oscal_doc
61
- if oscal_dir_exists?
62
- insert_into_oscal "si-4.md", <<~EOS, after: "## Implementation a.\n"
63
- New Relic is used for the purposes of monitoring and analyzing #{app_name} application data. New Relic monitors each application within #{app_name} for
64
- basic container utilization (CPU, memory, disk) as a baseline of provided metrics. New Relic dashboards are used by #{app_name} operations to obtain
65
- near real-time views into the metrics obtained from each application. New Relic provides application metrics that give insight into request/response rates,
66
- failure rates, etc. New Relic uses this data to detect anomalies (such as potential unauthorized activity) and alerts the #{app_name} team via <<INSERT NOTIFICATION CHANNEL>>
67
- in the GSA Slack. Example: a spike in failed requests may indicate an unauthorized user has entered the system and is attempting to phish for PII.
68
-
69
- 1. A subset of relevant specific metrics #{app_name} is constantly monitoring include:
70
- * Abnormal cpu, memory, and disk utilization (defined in New Relic alerting rules)
71
- * Number of incoming requests
72
- * Request response time
73
- * Application crashes (for any reason)
74
- * Response status codes (high numbers of failing requests would be abnormal)
75
- * Applications (by name)
76
- * Abnormally high request rates
77
- 1. Metrics that can be audited within #{app_name} include:
78
- * SSH Sessions (disabled in production under normal circumstances)
79
- 1. A subset of relevant incidents #{app_name} will use these metrics to protect against include:
80
- * Unauthorized Access / Intrusion to #{app_name} as an Administrator
81
- * Denial of Service (DoS)
82
- * Improper Usage
83
- * Malicious Code
84
- * System Uptime
85
- * High Resource Usage
86
-
87
- When suspicious activity is encountered #{app_name} Operations audit the event through the cloud.gov logs provided at logs.fr.cloud.gov
88
- (a Kibana instance allowing users to access, filter, and search their cloud.gov logs. These logs are retained automatically by cloud.gov for 180 days after creation.
89
- EOS
90
- insert_into_oscal "si-4.md", "The #{app_name} application logs events to stdout and stderr which are ingested by cloud.gov and New Relic.", after: "## Implementation c.\n"
91
- insert_into_oscal "si-4.md", "#{app_name} Operations are responsible for monitoring the New Relic dashboards that report on specific application events and performing follow-up investigations where necessary.", after: "## Implementation d.\n"
92
- insert_into_oscal "si-4.2.md", <<~EOS
93
- #{app_name} is monitored using New Relic Application Performance Monitoring (APM),
94
- Synthetics and Logs, which detects and alerts on abnormal responses from #{app_name} applications.
95
- EOS
96
- end
61
+ copy_oscal_component "newrelic"
97
62
  end
98
63
 
99
64
  no_tasks do
@@ -0,0 +1,113 @@
1
+ {
2
+ "component-definition": {
3
+ "uuid": "7bbcdbff-c3d8-497f-a0fc-3ec96f4acc2d",
4
+ "metadata": {
5
+ "title": "New Relic System Monitoring Component Definition.",
6
+ "last-modified": "2024-06-11T12:51:11.662524+00:00",
7
+ "version": "0.0.1",
8
+ "oscal-version": "1.1.2"
9
+ },
10
+ "components": [
11
+ {
12
+ "uuid": "8eb58925-2761-4de3-86cb-72af189fe378",
13
+ "type": "service",
14
+ "title": "New Relic",
15
+ "description": "New Relic Application Performance Monitoring",
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 New Relic",
25
+ "remarks": "rule-config"
26
+ }
27
+ ],
28
+ "control-implementations": [
29
+ {
30
+ "uuid": "7ba2642f-5cfa-431c-a030-afffc4e6a8d4",
31
+ "source": "trestle://profiles/lato/profile.json",
32
+ "description": "",
33
+ "implemented-requirements": [
34
+ {
35
+ "uuid": "fae8766e-7bf2-4d77-9c88-db5b2e9a8bfd",
36
+ "control-id": "si-4",
37
+ "description": "REPLACE_ME",
38
+ "props": [
39
+ {
40
+ "name": "implementation-status",
41
+ "value": "planned"
42
+ }
43
+ ],
44
+ "statements": [
45
+ {
46
+ "statement-id": "si-4_smt.a",
47
+ "uuid": "850fcb05-724a-46a3-9faf-2574624ef1ee",
48
+ "description": "New Relic is used for the purposes of monitoring and analyzing <%= app_name %> application data. New Relic monitors each application within <%= app_name %> for basic container utilization (CPU, memory, disk) as a baseline of provided metrics. New Relic dashboards are used by <%= app_name %> operations to obtain near real-time views into the metrics obtained from each application. New Relic provides application metrics that give insight into request/response rates, failure rates, etc. New Relic uses this data to detect anomalies (such as potential unauthorized activity) and alerts the <%= app_name %> team via <<INSERT NOTIFICATION CHANNEL>> in the GSA Slack. Example: a spike in failed requests may indicate an unauthorized user has entered the system and is attempting to phish for PII.\n\n1. A subset of relevant specific metrics <%= app_name %> is constantly monitoring include:\n* Abnormal cpu, memory, and disk utilization (defined in New Relic alerting rules)\n* Number of incoming requests\n* Request response time\n* Application crashes (for any reason)\n* Response status codes (high numbers of failing requests would be abnormal)\n* Applications (by name)\n* Abnormally high request rates\n1. Metrics that can be audited within <%= app_name %> include:\n* SSH Sessions (disabled in production under normal circumstances)\n1. A subset of relevant incidents <%= app_name %> will use these metrics to protect against include:\n* Unauthorized Access / Intrusion to <%= app_name %> as an Administrator\n* Denial of Service (DoS)\n* Improper Usage\n* Malicious Code\n* System Uptime\n* High Resource Usage\n\nWhen suspicious activity is encountered <%= app_name %> Operations audit the event through the cloud.gov logs provided at logs.fr.cloud.gov\n(a Kibana instance allowing users to access, filter, and search their cloud.gov logs. These logs are retained automatically by cloud.gov for 180 days after creation.",
49
+ "props": [
50
+ {
51
+ "name": "Rule_Id",
52
+ "value": "properly-configured"
53
+ },
54
+ {
55
+ "name": "implementation-status",
56
+ "value": "implemented"
57
+ }
58
+ ]
59
+ },
60
+ {
61
+ "statement-id": "si-4_smt.c",
62
+ "uuid": "dddcc80f-f715-4ee8-acf0-e4d9df3576c5",
63
+ "description": "The <%= app_name %> application logs events to stdout and stderr which are ingested by cloud.gov and New Relic.",
64
+ "props": [
65
+ {
66
+ "name": "Rule_Id",
67
+ "value": "properly-configured"
68
+ },
69
+ {
70
+ "name": "implementation-status",
71
+ "value": "implemented"
72
+ }
73
+ ]
74
+ },
75
+ {
76
+ "statement-id": "si-4_smt.d",
77
+ "uuid": "017e8dab-cbd3-4054-9185-cf24d6dcd6b9",
78
+ "description": "\\<%= app_name %> Operations are responsible for monitoring the New Relic dashboards that report on specific application events and performing follow-up investigations where necessary.",
79
+ "props": [
80
+ {
81
+ "name": "Rule_Id",
82
+ "value": "properly-configured"
83
+ },
84
+ {
85
+ "name": "implementation-status",
86
+ "value": "implemented"
87
+ }
88
+ ]
89
+ }
90
+ ]
91
+ },
92
+ {
93
+ "uuid": "fc6a4cb3-5160-4792-a835-bfdf92d97a33",
94
+ "control-id": "si-4.2",
95
+ "description": "\\<%= app_name %> is monitored using New Relic Application Performance Monitoring (APM), Synthetics and Logs, which detects and alerts on abnormal responses from <%= app_name %> applications in real time.",
96
+ "props": [
97
+ {
98
+ "name": "Rule_Id",
99
+ "value": "properly-configured"
100
+ },
101
+ {
102
+ "name": "implementation-status",
103
+ "value": "implemented"
104
+ }
105
+ ]
106
+ }
107
+ ]
108
+ }
109
+ ]
110
+ }
111
+ ]
112
+ }
113
+ }