organizationSecurityAndPrivacyGroups.tsx 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. import {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: 'requireEmailVerification',
  34. type: 'boolean',
  35. label: t('Require Email Verification'),
  36. help: t('Require and enforce email address verification for all members'),
  37. visible: ({features}) => features.has('required-email-verification'),
  38. confirm: {
  39. true: t(
  40. 'This will remove all members whose email addresses are not verified from your organization. It will also send them an email to verify their address and reinstate their access and settings. Do you want to continue?'
  41. ),
  42. false: t(
  43. 'Are you sure you want to allow users to access your organization without verifying their email address?'
  44. ),
  45. },
  46. },
  47. {
  48. name: 'allowSharedIssues',
  49. type: 'boolean',
  50. label: t('Allow Shared Issues'),
  51. help: t('Enable sharing of limited details on issues to anonymous users'),
  52. confirm: {
  53. true: t('Are you sure you want to allow sharing issues to anonymous users?'),
  54. },
  55. },
  56. {
  57. name: 'enhancedPrivacy',
  58. type: 'boolean',
  59. label: t('Enhanced Privacy'),
  60. help: t(
  61. 'Enable enhanced privacy controls to limit personally identifiable information (PII) as well as source code in things like notifications'
  62. ),
  63. confirm: {
  64. false: t(
  65. 'Disabling this can have privacy implications for ALL projects, are you sure you want to continue?'
  66. ),
  67. },
  68. },
  69. {
  70. name: 'scrapeJavaScript',
  71. type: 'boolean',
  72. confirm: {
  73. false: t(
  74. "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."
  75. ),
  76. },
  77. label: t('Allow JavaScript Source Fetching'),
  78. help: t('Allow Sentry to scrape missing JavaScript source context when possible'),
  79. },
  80. {
  81. name: 'storeCrashReports',
  82. type: 'select',
  83. label: t('Store Native Crash Reports'),
  84. help: t(
  85. 'Store native crash reports such as Minidumps for improved processing and download in issue details'
  86. ),
  87. visible: ({features}) => features.has('event-attachments'),
  88. // HACK: some organization can have limit of stored crash reports a number that's not in the options (legacy reasons),
  89. // we therefore display it in a placeholder
  90. placeholder: ({value}) => formatStoreCrashReports(value),
  91. choices: () =>
  92. getStoreCrashReportsValues(SettingScope.ORGANIZATION).map(value => [
  93. value,
  94. formatStoreCrashReports(value),
  95. ]),
  96. },
  97. {
  98. name: 'allowJoinRequests',
  99. type: 'boolean',
  100. label: t('Allow Join Requests'),
  101. help: t('Allow users to request to join your organization'),
  102. 'aria-label': t('Enable to allow users to request to join your organization'),
  103. confirm: {
  104. true: t(
  105. 'Are you sure you want to allow users to request to join your organization?'
  106. ),
  107. },
  108. visible: ({hasSsoEnabled}) => !hasSsoEnabled,
  109. },
  110. ],
  111. },
  112. {
  113. title: t('Data Scrubbing'),
  114. fields: [
  115. {
  116. name: 'dataScrubber',
  117. type: 'boolean',
  118. label: t('Require Data Scrubber'),
  119. help: t('Require server-side data scrubbing be enabled for all projects'),
  120. 'aria-label': t('Enable server-side data scrubbing'),
  121. confirm: {
  122. false: t(
  123. 'Disabling this can have privacy implications for ALL projects, are you sure you want to continue?'
  124. ),
  125. },
  126. },
  127. {
  128. name: 'dataScrubberDefaults',
  129. type: 'boolean',
  130. label: t('Require Using Default Scrubbers'),
  131. help: t(
  132. 'Require the default scrubbers be applied to prevent things like passwords and credit cards from being stored for all projects'
  133. ),
  134. 'aria-label': t(
  135. 'Enable to apply default scrubbers to prevent things like passwords and credit cards from being stored'
  136. ),
  137. confirm: {
  138. false: t(
  139. 'Disabling this can have privacy implications for ALL projects, are you sure you want to continue?'
  140. ),
  141. },
  142. },
  143. {
  144. name: 'sensitiveFields',
  145. type: 'string',
  146. multiline: true,
  147. autosize: true,
  148. maxRows: 10,
  149. rows: 1,
  150. placeholder: 'e.g. email',
  151. label: t('Global Sensitive Fields'),
  152. help: t(
  153. 'Additional field names to match against when scrubbing data for all projects. Separate multiple entries with a newline.'
  154. ),
  155. 'aria-label': t(
  156. 'Enter additional field names to match against when scrubbing data for all projects. Separate multiple entries with a newline.'
  157. ),
  158. extraHelp: t(
  159. 'Note: These fields will be used in addition to project specific fields.'
  160. ),
  161. getValue: val => extractMultilineFields(val),
  162. setValue: val => convertMultilineFieldValue(val),
  163. },
  164. {
  165. name: 'safeFields',
  166. type: 'string',
  167. multiline: true,
  168. autosize: true,
  169. maxRows: 10,
  170. rows: 1,
  171. placeholder: t('e.g. business-email'),
  172. label: t('Global Safe Fields'),
  173. help: t(
  174. 'Field names which data scrubbers should ignore. Separate multiple entries with a newline.'
  175. ),
  176. 'aria-label': t(
  177. 'Enter field names which data scrubbers should ignore. Separate multiple entries with a newline.'
  178. ),
  179. extraHelp: t(
  180. 'Note: These fields will be used in addition to project specific fields'
  181. ),
  182. getValue: val => extractMultilineFields(val),
  183. setValue: val => convertMultilineFieldValue(val),
  184. },
  185. {
  186. name: 'scrubIPAddresses',
  187. type: 'boolean',
  188. label: t('Prevent Storing of IP Addresses'),
  189. help: t(
  190. 'Preventing IP addresses from being stored for new events on all projects'
  191. ),
  192. 'aria-label': t(
  193. 'Enable to prevent IP addresses from being stored for new events'
  194. ),
  195. confirm: {
  196. false: t(
  197. 'Disabling this can have privacy implications for ALL projects, are you sure you want to continue?'
  198. ),
  199. },
  200. },
  201. ],
  202. },
  203. ];
  204. export default formGroups;