organizationSecurityAndPrivacyGroups.tsx 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. import type {JsonFormObject} from 'sentry/components/forms/types';
  2. import {t} from 'sentry/locale';
  3. import {convertMultilineFieldValue, extractMultilineFields} from 'sentry/utils';
  4. import {
  5. formatStoreCrashReports,
  6. getStoreCrashReportsValues,
  7. SettingScope,
  8. } from 'sentry/utils/crashReports';
  9. // Export route to make these forms searchable by label/help
  10. export const route = '/settings/:orgId/security-and-privacy/';
  11. const formGroups: JsonFormObject[] = [
  12. {
  13. title: t('Security & Privacy'),
  14. fields: [
  15. {
  16. name: 'require2FA',
  17. type: 'boolean',
  18. label: t('Require Two-Factor Authentication'),
  19. help: t('Require and enforce two-factor authentication for all members'),
  20. 'aria-label': t(
  21. 'Enable to require and enforce two-factor authentication for all members'
  22. ),
  23. confirm: {
  24. true: t(
  25. 'This will remove all members without two-factor authentication from your organization. It will also send them an email to setup 2FA and reinstate their access and settings. Do you want to continue?'
  26. ),
  27. false: t(
  28. 'Are you sure you want to allow users to access your organization without having two-factor authentication enabled?'
  29. ),
  30. },
  31. },
  32. {
  33. name: 'allowSharedIssues',
  34. type: 'boolean',
  35. label: t('Allow Shared Issues'),
  36. help: t('Enable sharing of limited details on issues to anonymous users'),
  37. confirm: {
  38. true: t('Are you sure you want to allow sharing issues to anonymous users?'),
  39. },
  40. },
  41. {
  42. name: 'enhancedPrivacy',
  43. type: 'boolean',
  44. label: t('Enhanced Privacy'),
  45. help: t(
  46. 'Enable enhanced privacy controls to limit personally identifiable information (PII) as well as source code in things like notifications'
  47. ),
  48. confirm: {
  49. false: t(
  50. 'Disabling this can have privacy implications for ALL projects, are you sure you want to continue?'
  51. ),
  52. },
  53. },
  54. {
  55. name: 'scrapeJavaScript',
  56. type: 'boolean',
  57. confirm: {
  58. false: t(
  59. "Are you sure you want to disable sourcecode fetching for JavaScript events? This will affect Sentry's ability to aggregate issues if you're not already uploading sourcemaps as artifacts."
  60. ),
  61. },
  62. label: t('Allow JavaScript Source Fetching'),
  63. help: t('Allow Sentry to scrape missing JavaScript source context when possible'),
  64. },
  65. {
  66. name: 'storeCrashReports',
  67. type: 'select',
  68. label: t('Store Native Crash Reports'),
  69. help: t(
  70. 'Store native crash reports such as Minidumps for improved processing and download in issue details'
  71. ),
  72. visible: ({features}) => features.has('event-attachments'),
  73. // HACK: some organization can have limit of stored crash reports a number that's not in the options (legacy reasons),
  74. // we therefore display it in a placeholder
  75. placeholder: ({value}) => formatStoreCrashReports(value),
  76. choices: () =>
  77. getStoreCrashReportsValues(SettingScope.ORGANIZATION).map(value => [
  78. value,
  79. formatStoreCrashReports(value),
  80. ]),
  81. },
  82. {
  83. name: 'allowJoinRequests',
  84. type: 'boolean',
  85. label: t('Allow Join Requests'),
  86. help: t('Allow users to request to join your organization'),
  87. 'aria-label': t('Enable to allow users to request to join your organization'),
  88. confirm: {
  89. true: t(
  90. 'Are you sure you want to allow users to request to join your organization?'
  91. ),
  92. },
  93. visible: ({hasSsoEnabled}) => !hasSsoEnabled,
  94. },
  95. ],
  96. },
  97. {
  98. title: t('Data Scrubbing'),
  99. fields: [
  100. {
  101. name: 'dataScrubber',
  102. type: 'boolean',
  103. label: t('Require Data Scrubber'),
  104. help: t('Require server-side data scrubbing be enabled for all projects'),
  105. 'aria-label': t('Enable server-side data scrubbing'),
  106. confirm: {
  107. false: t(
  108. 'Disabling this can have privacy implications for ALL projects, are you sure you want to continue?'
  109. ),
  110. },
  111. },
  112. {
  113. name: 'dataScrubberDefaults',
  114. type: 'boolean',
  115. label: t('Require Using Default Scrubbers'),
  116. help: t(
  117. 'Require the default scrubbers be applied to prevent things like passwords and credit cards from being stored for all projects'
  118. ),
  119. 'aria-label': t(
  120. 'Enable to apply default scrubbers to prevent things like passwords and credit cards from being stored'
  121. ),
  122. confirm: {
  123. false: t(
  124. 'Disabling this can have privacy implications for ALL projects, are you sure you want to continue?'
  125. ),
  126. },
  127. },
  128. {
  129. name: 'sensitiveFields',
  130. type: 'string',
  131. multiline: true,
  132. autosize: true,
  133. maxRows: 10,
  134. rows: 1,
  135. placeholder: 'e.g. email',
  136. label: t('Global Sensitive Fields'),
  137. help: t(
  138. 'Additional field names to match against when scrubbing data for all projects. Separate multiple entries with a newline.'
  139. ),
  140. 'aria-label': t(
  141. 'Enter additional field names to match against when scrubbing data for all projects. Separate multiple entries with a newline.'
  142. ),
  143. extraHelp: t(
  144. 'Note: These fields will be used in addition to project specific fields.'
  145. ),
  146. getValue: val => extractMultilineFields(val),
  147. setValue: val => convertMultilineFieldValue(val),
  148. },
  149. {
  150. name: 'safeFields',
  151. type: 'string',
  152. multiline: true,
  153. autosize: true,
  154. maxRows: 10,
  155. rows: 1,
  156. placeholder: t('e.g. business-email'),
  157. label: t('Global Safe Fields'),
  158. help: t(
  159. 'Field names which data scrubbers should ignore. Separate multiple entries with a newline.'
  160. ),
  161. 'aria-label': t(
  162. 'Enter field names which data scrubbers should ignore. Separate multiple entries with a newline.'
  163. ),
  164. extraHelp: t(
  165. 'Note: These fields will be used in addition to project specific fields'
  166. ),
  167. getValue: val => extractMultilineFields(val),
  168. setValue: val => convertMultilineFieldValue(val),
  169. },
  170. {
  171. name: 'scrubIPAddresses',
  172. type: 'boolean',
  173. label: t('Prevent Storing of IP Addresses'),
  174. help: t(
  175. 'Preventing IP addresses from being stored for new events on all projects'
  176. ),
  177. 'aria-label': t(
  178. 'Enable to prevent IP addresses from being stored for new events'
  179. ),
  180. confirm: {
  181. false: t(
  182. 'Disabling this can have privacy implications for ALL projects, are you sure you want to continue?'
  183. ),
  184. },
  185. },
  186. ],
  187. },
  188. ];
  189. export default formGroups;