debian-mirror-gitlab/app/assets/javascripts/security_configuration/components/constants.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

329 lines
11 KiB
JavaScript
Raw Normal View History

2021-03-11 19:13:27 +05:30
import { helpPagePath } from '~/helpers/help_page_helper';
2021-04-17 20:07:23 +05:30
import { __, s__ } from '~/locale';
2021-03-11 19:13:27 +05:30
import {
REPORT_TYPE_SAST,
2021-12-11 22:18:48 +05:30
REPORT_TYPE_SAST_IAC,
2021-03-11 19:13:27 +05:30
REPORT_TYPE_DAST,
2021-04-17 20:07:23 +05:30
REPORT_TYPE_DAST_PROFILES,
2023-06-20 00:43:36 +05:30
REPORT_TYPE_BREACH_AND_ATTACK_SIMULATION,
2021-03-11 19:13:27 +05:30
REPORT_TYPE_SECRET_DETECTION,
REPORT_TYPE_DEPENDENCY_SCANNING,
REPORT_TYPE_CONTAINER_SCANNING,
REPORT_TYPE_COVERAGE_FUZZING,
2021-11-11 11:23:49 +05:30
REPORT_TYPE_CORPUS_MANAGEMENT,
2021-04-17 20:07:23 +05:30
REPORT_TYPE_API_FUZZING,
2021-03-11 19:13:27 +05:30
} from '~/vue_shared/security_reports/constants';
2022-05-07 20:08:51 +05:30
import kontraLogo from 'images/vulnerability/kontra-logo.svg';
import scwLogo from 'images/vulnerability/scw-logo.svg';
2023-07-09 08:55:56 +05:30
import secureflagLogo from 'images/vulnerability/secureflag-logo.svg';
2021-09-30 23:02:18 +05:30
import configureSastMutation from '../graphql/configure_sast.mutation.graphql';
2021-12-11 22:18:48 +05:30
import configureSastIacMutation from '../graphql/configure_iac.mutation.graphql';
2021-09-30 23:02:18 +05:30
import configureSecretDetectionMutation from '../graphql/configure_secret_detection.mutation.graphql';
2021-03-11 19:13:27 +05:30
/**
2021-10-27 15:23:28 +05:30
* Translations & helpPagePaths for Security Configuration Page
2022-01-26 12:08:38 +05:30
* Make sure to add new scanner translations to the SCANNER_NAMES_MAP below.
2021-03-11 19:13:27 +05:30
*/
2021-10-27 15:23:28 +05:30
2021-04-17 20:07:23 +05:30
export const SAST_NAME = __('Static Application Security Testing (SAST)');
2021-09-04 01:27:46 +05:30
export const SAST_SHORT_NAME = s__('ciReport|SAST');
2021-04-17 20:07:23 +05:30
export const SAST_DESCRIPTION = __('Analyze your source code for known vulnerabilities.');
2021-03-11 19:13:27 +05:30
export const SAST_HELP_PATH = helpPagePath('user/application_security/sast/index');
2021-09-04 01:27:46 +05:30
export const SAST_CONFIG_HELP_PATH = helpPagePath('user/application_security/sast/index', {
anchor: 'configuration',
});
2021-03-11 19:13:27 +05:30
2021-12-11 22:18:48 +05:30
export const SAST_IAC_NAME = __('Infrastructure as Code (IaC) Scanning');
2023-05-27 22:25:52 +05:30
export const SAST_IAC_SHORT_NAME = s__('ciReport|SAST IaC');
2021-12-11 22:18:48 +05:30
export const SAST_IAC_DESCRIPTION = __(
'Analyze your infrastructure as code configuration files for known vulnerabilities.',
);
export const SAST_IAC_HELP_PATH = helpPagePath('user/application_security/iac_scanning/index');
export const SAST_IAC_CONFIG_HELP_PATH = helpPagePath(
'user/application_security/iac_scanning/index',
{
anchor: 'configuration',
},
);
2021-04-17 20:07:23 +05:30
export const DAST_NAME = __('Dynamic Application Security Testing (DAST)');
2021-09-04 01:27:46 +05:30
export const DAST_SHORT_NAME = s__('ciReport|DAST');
2022-06-21 17:19:12 +05:30
export const DAST_DESCRIPTION = s__(
'ciReport|Analyze a deployed version of your web application for known vulnerabilities by examining it from the outside in. DAST works by simulating external attacks on your application while it is running.',
);
2021-03-11 19:13:27 +05:30
export const DAST_HELP_PATH = helpPagePath('user/application_security/dast/index');
2021-09-04 01:27:46 +05:30
export const DAST_CONFIG_HELP_PATH = helpPagePath('user/application_security/dast/index', {
2022-07-16 23:28:13 +05:30
anchor: 'enable-automatic-dast-run',
2021-09-04 01:27:46 +05:30
});
2022-06-21 17:19:12 +05:30
export const DAST_BADGE_TEXT = __('Available on-demand');
export const DAST_BADGE_TOOLTIP = __(
'On-demand scans run outside of the DevOps cycle and find vulnerabilities in your projects',
);
2021-03-11 19:13:27 +05:30
2022-06-21 17:19:12 +05:30
export const DAST_PROFILES_NAME = __('DAST profiles');
2021-09-30 23:02:18 +05:30
export const DAST_PROFILES_DESCRIPTION = s__(
'SecurityConfiguration|Manage profiles for use by DAST scans.',
2021-04-17 20:07:23 +05:30
);
2022-06-21 17:19:12 +05:30
export const DAST_PROFILES_CONFIG_TEXT = s__('SecurityConfiguration|Manage profiles');
2021-04-17 20:07:23 +05:30
2023-06-20 00:43:36 +05:30
export const BAS_BADGE_TEXT = s__('SecurityConfiguration|Incubating feature');
export const BAS_BADGE_TOOLTIP = s__(
'SecurityConfiguration|Breach and Attack Simulation is an incubating feature extending existing security testing by simulating adversary activity.',
);
export const BAS_DESCRIPTION = s__(
'SecurityConfiguration|Simulate breach and attack scenarios against your running application by attempting to detect and exploit known vulnerabilities.',
);
export const BAS_HELP_PATH = helpPagePath(
'user/application_security/breach_and_attack_simulation/index',
);
export const BAS_NAME = s__('SecurityConfiguration|Breach and Attack Simulation (BAS)');
export const BAS_SHORT_NAME = s__('SecurityConfiguration|BAS');
export const BAS_DAST_FEATURE_FLAG_DESCRIPTION = s__(
'SecurityConfiguration|Enable incubating Breach and Attack Simulation focused features such as callback attacks in your DAST scans.',
);
export const BAS_DAST_FEATURE_FLAG_HELP_PATH = helpPagePath(
'user/application_security/breach_and_attack_simulation/index',
{ anchor: 'extend-dynamic-application-security-testing-dast' },
);
export const BAS_DAST_FEATURE_FLAG_NAME = s__(
'SecurityConfiguration|Out-of-Band Application Security Testing (OAST)',
);
2021-04-17 20:07:23 +05:30
export const SECRET_DETECTION_NAME = __('Secret Detection');
export const SECRET_DETECTION_DESCRIPTION = __(
2021-03-11 19:13:27 +05:30
'Analyze your source code and git history for secrets.',
);
export const SECRET_DETECTION_HELP_PATH = helpPagePath(
'user/application_security/secret_detection/index',
);
2021-09-04 01:27:46 +05:30
export const SECRET_DETECTION_CONFIG_HELP_PATH = helpPagePath(
'user/application_security/secret_detection/index',
{ anchor: 'configuration' },
);
2021-03-11 19:13:27 +05:30
2021-04-17 20:07:23 +05:30
export const DEPENDENCY_SCANNING_NAME = __('Dependency Scanning');
export const DEPENDENCY_SCANNING_DESCRIPTION = __(
2021-03-11 19:13:27 +05:30
'Analyze your dependencies for known vulnerabilities.',
);
export const DEPENDENCY_SCANNING_HELP_PATH = helpPagePath(
'user/application_security/dependency_scanning/index',
);
2021-09-04 01:27:46 +05:30
export const DEPENDENCY_SCANNING_CONFIG_HELP_PATH = helpPagePath(
'user/application_security/dependency_scanning/index',
{ anchor: 'configuration' },
);
2021-03-11 19:13:27 +05:30
2021-04-17 20:07:23 +05:30
export const CONTAINER_SCANNING_NAME = __('Container Scanning');
export const CONTAINER_SCANNING_DESCRIPTION = __(
2021-03-11 19:13:27 +05:30
'Check your Docker images for known vulnerabilities.',
);
export const CONTAINER_SCANNING_HELP_PATH = helpPagePath(
'user/application_security/container_scanning/index',
);
2021-09-04 01:27:46 +05:30
export const CONTAINER_SCANNING_CONFIG_HELP_PATH = helpPagePath(
'user/application_security/container_scanning/index',
{ anchor: 'configuration' },
);
2021-03-11 19:13:27 +05:30
2021-04-17 20:07:23 +05:30
export const COVERAGE_FUZZING_NAME = __('Coverage Fuzzing');
export const COVERAGE_FUZZING_DESCRIPTION = __(
2021-03-11 19:13:27 +05:30
'Find bugs in your code with coverage-guided fuzzing.',
);
export const COVERAGE_FUZZING_HELP_PATH = helpPagePath(
'user/application_security/coverage_fuzzing/index',
);
2021-10-27 15:23:28 +05:30
export const COVERAGE_FUZZING_CONFIG_HELP_PATH = helpPagePath(
'user/application_security/coverage_fuzzing/index',
2022-07-16 23:28:13 +05:30
{ anchor: 'enable-coverage-guided-fuzz-testing' },
2021-10-27 15:23:28 +05:30
);
2021-03-11 19:13:27 +05:30
2021-11-11 11:23:49 +05:30
export const CORPUS_MANAGEMENT_NAME = __('Corpus Management');
export const CORPUS_MANAGEMENT_DESCRIPTION = s__(
2022-04-04 11:22:00 +05:30
'SecurityConfiguration|Manage corpus files used as seed inputs with coverage-guided fuzzing.',
2021-11-11 11:23:49 +05:30
);
export const CORPUS_MANAGEMENT_CONFIG_TEXT = s__('SecurityConfiguration|Manage corpus');
2021-04-17 20:07:23 +05:30
export const API_FUZZING_NAME = __('API Fuzzing');
export const API_FUZZING_DESCRIPTION = __('Find bugs in your code with API fuzzing.');
export const API_FUZZING_HELP_PATH = helpPagePath('user/application_security/api_fuzzing/index');
2023-07-09 08:55:56 +05:30
export const CLUSTER_IMAGE_SCANNING_NAME = s__('ciReport|Cluster Image Scanning');
2021-03-11 19:13:27 +05:30
2022-01-26 12:08:38 +05:30
export const SCANNER_NAMES_MAP = {
SAST: SAST_SHORT_NAME,
SAST_IAC: SAST_IAC_NAME,
DAST: DAST_SHORT_NAME,
API_FUZZING: API_FUZZING_NAME,
CONTAINER_SCANNING: CONTAINER_SCANNING_NAME,
COVERAGE_FUZZING: COVERAGE_FUZZING_NAME,
SECRET_DETECTION: SECRET_DETECTION_NAME,
DEPENDENCY_SCANNING: DEPENDENCY_SCANNING_NAME,
2023-07-09 08:55:56 +05:30
BREACH_AND_ATTACK_SIMULATION: BAS_NAME,
CLUSTER_IMAGE_SCANNING: CLUSTER_IMAGE_SCANNING_NAME,
2022-10-11 01:57:18 +05:30
GENERIC: s__('ciReport|Manually added'),
2022-01-26 12:08:38 +05:30
};
2021-09-04 01:27:46 +05:30
export const securityFeatures = [
{
name: SAST_NAME,
shortName: SAST_SHORT_NAME,
description: SAST_DESCRIPTION,
helpPath: SAST_HELP_PATH,
configurationHelpPath: SAST_CONFIG_HELP_PATH,
type: REPORT_TYPE_SAST,
},
2022-01-26 12:08:38 +05:30
{
name: SAST_IAC_NAME,
shortName: SAST_IAC_SHORT_NAME,
description: SAST_IAC_DESCRIPTION,
helpPath: SAST_IAC_HELP_PATH,
configurationHelpPath: SAST_IAC_CONFIG_HELP_PATH,
type: REPORT_TYPE_SAST_IAC,
},
2021-09-04 01:27:46 +05:30
{
2022-06-21 17:19:12 +05:30
badge: {
text: DAST_BADGE_TEXT,
tooltipText: DAST_BADGE_TOOLTIP,
variant: 'info',
},
2021-09-04 01:27:46 +05:30
secondary: {
type: REPORT_TYPE_DAST_PROFILES,
name: DAST_PROFILES_NAME,
description: DAST_PROFILES_DESCRIPTION,
configurationText: DAST_PROFILES_CONFIG_TEXT,
},
2022-06-21 17:19:12 +05:30
name: DAST_NAME,
shortName: DAST_SHORT_NAME,
description: DAST_DESCRIPTION,
helpPath: DAST_HELP_PATH,
configurationHelpPath: DAST_CONFIG_HELP_PATH,
type: REPORT_TYPE_DAST,
2022-08-13 15:12:31 +05:30
anchor: 'dast',
2021-09-04 01:27:46 +05:30
},
{
name: DEPENDENCY_SCANNING_NAME,
description: DEPENDENCY_SCANNING_DESCRIPTION,
helpPath: DEPENDENCY_SCANNING_HELP_PATH,
configurationHelpPath: DEPENDENCY_SCANNING_CONFIG_HELP_PATH,
type: REPORT_TYPE_DEPENDENCY_SCANNING,
2022-08-13 15:12:31 +05:30
anchor: 'dependency-scanning',
2021-09-04 01:27:46 +05:30
},
{
name: CONTAINER_SCANNING_NAME,
description: CONTAINER_SCANNING_DESCRIPTION,
helpPath: CONTAINER_SCANNING_HELP_PATH,
configurationHelpPath: CONTAINER_SCANNING_CONFIG_HELP_PATH,
type: REPORT_TYPE_CONTAINER_SCANNING,
},
{
name: SECRET_DETECTION_NAME,
description: SECRET_DETECTION_DESCRIPTION,
helpPath: SECRET_DETECTION_HELP_PATH,
configurationHelpPath: SECRET_DETECTION_CONFIG_HELP_PATH,
type: REPORT_TYPE_SECRET_DETECTION,
},
{
name: API_FUZZING_NAME,
description: API_FUZZING_DESCRIPTION,
helpPath: API_FUZZING_HELP_PATH,
type: REPORT_TYPE_API_FUZZING,
},
{
name: COVERAGE_FUZZING_NAME,
description: COVERAGE_FUZZING_DESCRIPTION,
helpPath: COVERAGE_FUZZING_HELP_PATH,
2021-10-27 15:23:28 +05:30
configurationHelpPath: COVERAGE_FUZZING_CONFIG_HELP_PATH,
2021-09-04 01:27:46 +05:30
type: REPORT_TYPE_COVERAGE_FUZZING,
2022-05-07 20:08:51 +05:30
secondary: {
type: REPORT_TYPE_CORPUS_MANAGEMENT,
name: CORPUS_MANAGEMENT_NAME,
description: CORPUS_MANAGEMENT_DESCRIPTION,
configurationText: CORPUS_MANAGEMENT_CONFIG_TEXT,
},
2021-09-04 01:27:46 +05:30
},
2023-06-20 00:43:36 +05:30
{
anchor: 'bas',
badge: {
alwaysDisplay: true,
text: BAS_BADGE_TEXT,
tooltipText: BAS_BADGE_TOOLTIP,
variant: 'info',
},
description: BAS_DESCRIPTION,
name: BAS_NAME,
helpPath: BAS_HELP_PATH,
secondary: {
configurationHelpPath: BAS_DAST_FEATURE_FLAG_HELP_PATH,
description: BAS_DAST_FEATURE_FLAG_DESCRIPTION,
name: BAS_DAST_FEATURE_FLAG_NAME,
},
shortName: BAS_SHORT_NAME,
type: REPORT_TYPE_BREACH_AND_ATTACK_SIMULATION,
},
2021-09-04 01:27:46 +05:30
];
2021-06-08 01:23:25 +05:30
export const featureToMutationMap = {
[REPORT_TYPE_SAST]: {
mutationId: 'configureSast',
getMutationPayload: (projectPath) => ({
mutation: configureSastMutation,
variables: {
input: {
projectPath,
configuration: { global: [], pipeline: [], analyzers: [] },
},
},
}),
},
2022-01-26 12:08:38 +05:30
[REPORT_TYPE_SAST_IAC]: {
mutationId: 'configureSastIac',
getMutationPayload: (projectPath) => ({
mutation: configureSastIacMutation,
variables: {
input: {
projectPath,
2021-12-11 22:18:48 +05:30
},
2022-01-26 12:08:38 +05:30
},
}),
},
2021-09-30 23:02:18 +05:30
[REPORT_TYPE_SECRET_DETECTION]: {
mutationId: 'configureSecretDetection',
getMutationPayload: (projectPath) => ({
mutation: configureSecretDetectionMutation,
variables: {
input: {
projectPath,
},
},
}),
},
2021-06-08 01:23:25 +05:30
};
2021-10-27 15:23:28 +05:30
export const AUTO_DEVOPS_ENABLED_ALERT_DISMISSED_STORAGE_KEY =
'security_configuration_auto_devops_enabled_dismissed_projects';
2022-05-07 20:08:51 +05:30
// Fetch the svg path from the GraphQL query once this issue is resolved
// https://gitlab.com/gitlab-org/gitlab/-/issues/346899
export const TEMP_PROVIDER_LOGOS = {
Kontra: {
svg: kontraLogo,
},
[__('Secure Code Warrior')]: {
svg: scwLogo,
},
2023-07-09 08:55:56 +05:30
SecureFlag: {
svg: secureflagLogo,
},
2022-05-07 20:08:51 +05:30
};
// Use the `url` field from the GraphQL query once this issue is resolved
// https://gitlab.com/gitlab-org/gitlab/-/issues/356129
export const TEMP_PROVIDER_URLS = {
Kontra: 'https://application.security/',
[__('Secure Code Warrior')]: 'https://www.securecodewarrior.com/',
2023-07-09 08:55:56 +05:30
SecureFlag: 'https://www.secureflag.com/',
2022-05-07 20:08:51 +05:30
};