К основному содержанию
скилл CX Codex

building-devsecops-pipeline-with-gitlab-ci — скилл для GitLab CI

Скилл building-devsecops-pipeline-with-gitlab-ci помогает встроить проверки безопасности в GitLab CI/CD: анализирует код, зависимости, контейнеры и секреты. Пригодится при настройке сканирования до деплоя.

Apache-2.0 243 установок ★ 36 511 обновлён 2026-08-31

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill building-devsecops-pipeline-with-gitlab-ci -a claude-code
Открыть на GitHub

Что делает building-devsecops-pipeline-with-gitlab-ci

Скилл помогает настроить этапы безопасности в .gitlab-ci.yml: SAST, DAST, сканирование контейнеров и зависимостей, поиск секретов. Для SAST описаны анализаторы Semgrep, SpotBugs, Gosec, Bandit и NodeJsScan; сканирование контейнеров использует Trivy, а проверки можно подключить через управляемые шаблоны GitLab.

В примере конвейера проверки выполняются до деплоя, а DAST запускается против развёрнутого staging-приложения. Также описана настройка правил SAST и политик согласования уязвимостей. Для полного набора сканеров нужна лицензия GitLab Ultimate и настроенный GitLab Runner; DAST требует доступного приложения в staging. Без целевого URL DAST не проверит приложение.

Какие задачи решает

  • добавить SAST и поиск секретов в .gitlab-ci.yml
  • проверять контейнерный образ на известные уязвимости
  • сканировать зависимости проекта перед деплоем
  • запустить DAST против приложения в staging
  • настроить согласование критических уязвимостей

Примеры запросов агенту

  • Настрой в .gitlab-ci.yml этапы SAST, сканирования контейнеров и поиска секретов.
  • Покажи, как запустить DAST для приложения после деплоя в staging.
  • Добавь правила SAST для проекта и настрой согласование критических уязвимостей.

Как установить building-devsecops-pipeline-with-gitlab-ci

1Через Skills CLI (Vercel)

npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill building-devsecops-pipeline-with-gitlab-ci -a claude-code

2Вручную: положить файлы

~/.claude/skills/building-devsecops-pipeline-with-gitlab-ci/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/building-devsecops-pipeline-with-gitlab-ci/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о building-devsecops-pipeline-with-gitlab-ci

Как установить building-devsecops-pipeline-with-gitlab-ci в Claude Code?

Выполни npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill building-devsecops-pipeline-with-gitlab-ci -a claude-code. Файл скилла появится по пути ~/.claude/skills/building-devsecops-pipeline-with-gitlab-ci/SKILL.md.

Что делает building-devsecops-pipeline-with-gitlab-ci?

Помогает добавить в GitLab CI/CD проверки кода, зависимостей, контейнеров и секретов, а также DAST для приложения в staging.

Что нужно для DAST в GitLab CI?

Приложение должно быть развёрнуто и доступно по целевому URL. В примере DAST запускается после деплоя в staging.

Исходный текст

SKILL.md · Apache-2.0
---
name: building-devsecops-pipeline-with-gitlab-ci
description: Configure a GitLab CI/CD pipeline that embeds SAST (Semgrep, SpotBugs, Gosec, Bandit, NodeJsScan), DAST, container scanning, dependency scanning, and secret detection via GitLab's managed security templates. Use when building a shift-left DevSecOps pipeline in GitLab, adding automated vulnerability scanning stages to .gitlab-ci.yml, or triaging scanner findings with GitLab Duo AI before deployment.
domain: cybersecurity
subdomain: devsecops
tags:
- gitlab-ci
- devsecops
- sast
- dast
- container-scanning
- dependency-scanning
- secret-detection
- cicd-security
version: '1.0'
author: mahipal
license: Apache-2.0
nist_csf:
- PR.PS-01
- GV.SC-07
- ID.IM-04
- PR.PS-04
mitre_attack:
- T1195.001
- T1195.002
- T1552.001
- T1190
- T1610
---

# Building DevSecOps Pipeline with GitLab CI

## Overview

GitLab provides an integrated DevSecOps platform that embeds security testing directly into the CI/CD pipeline. By leveraging GitLab's built-in security scanners---SAST, DAST, container scanning, dependency scanning, secret detection, and license compliance---teams can shift security left, catching vulnerabilities during development rather than post-deployment. GitLab Duo AI assists with false positive detection for SAST vulnerabilities, helping security teams focus on genuine issues.


## When to Use

- When deploying or configuring building devsecops pipeline with gitlab ci capabilities in your environment
- When establishing security controls aligned to compliance requirements
- When building or improving security architecture for this domain
- When conducting security assessments that require this implementation

## Prerequisites

- GitLab Ultimate license (required for full security scanner suite)
- GitLab Runner configured (shared or self-hosted)
- `.gitlab-ci.yml` pipeline configuration familiarity
- Docker-in-Docker (DinD) or Kaniko for container builds
- Application deployed to a staging environment for DAST scanning

## Core Security Scanning Stages

### Static Application Security Testing (SAST)

SAST analyzes source code for vulnerabilities before compilation. GitLab supports 14+ languages using analyzers such as Semgrep, SpotBugs, Gosec, Bandit, and NodeJsScan. The simplest inclusion uses GitLab's managed templates.

### Dynamic Application Security Testing (DAST)

DAST tests running applications by simulating attack payloads against HTTP endpoints. It detects XSS, SQLi, CSRF, and other runtime vulnerabilities that static analysis cannot find. DAST requires a deployed, accessible target URL.

### Container Scanning

Uses Trivy to scan Docker images for known CVEs in OS packages and application dependencies. Runs after the Docker build stage to gate images before they reach a registry.

### Dependency Scanning

Inspects dependency manifests (package.json, requirements.txt, pom.xml, Gemfile.lock) for known vulnerable versions. Operates at the source code level, complementing container scanning.

### Secret Detection

Scans commits for accidentally committed credentials, API keys, tokens, and private keys using pattern matching and entropy analysis. Runs on every commit to prevent secrets from reaching the repository.

## Implementation

### Complete Pipeline Configuration

```yaml
# .gitlab-ci.yml

stages:
  - build
  - test
  - security
  - deploy-staging
  - dast
  - deploy-production

variables:
  DOCKER_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA
  SECURE_LOG_LEVEL: "info"

# Include GitLab managed security templates
include:
  - template: Security/SAST.gitlab-ci.yml
  - template: Security/Secret-Detection.gitlab-ci.yml
  - template: Security/Dependency-Scanning.gitlab-ci.yml
  - template: Security/Container-Scanning.gitlab-ci.yml
  - template: DAST.gitlab-ci.yml
  - template: Security/License-Scanning.gitlab-ci.yml

build:
  stage: build
  image: docker:24.0
  services:
    - docker:24.0-dind
  variables:
    DOCKER_TLS_CERTDIR: "/certs"
  script:
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
    - docker build -t $DOCKER_IMAGE .
    - docker push $DOCKER_IMAGE
  rules:
    - if: $CI_COMMIT_BRANCH

unit-tests:
  stage: test
  image: $DOCKER_IMAGE
  script:
    - npm ci
    - npm run test:coverage
  coverage: '/Lines\s*:\s*(\d+\.?\d*)%/'
  artifacts:
    reports:
      junit: junit-report.xml
      coverage_report:
        coverage_format: cobertura
        path: coverage/cobertura-coverage.xml

# Override SAST to run in security stage
sast:
  stage: security
  variables:
    SAST_EXCLUDED_PATHS: "spec,test,tests,tmp,node_modules"
    SEARCH_MAX_DEPTH: 10

# Override container scanning
container_scanning:
  stage: security
  variables:
    CS_IMAGE: $DOCKER_IMAGE
    CS_SEVERITY_THRESHOLD: "HIGH"

# Override dependency scanning
dependency_scanning:
  stage: security

# Override secret detection
secret_detection:
  stage: security

# License compliance scanning
license_scanning:
  stage: security

deploy-staging:
  stage: deploy-staging
  image: bitnami/kubectl:latest
  script:
    - kubectl set image deployment/app app=$DOCKER_IMAGE -n staging
    - kubectl rollout status deployment/app -n staging --timeout=300s
  environment:
    name: staging
    url: https://staging.example.com
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

# DAST runs against deployed staging
dast:
  stage: dast
  variables:
    DAST_WEBSITE: https://staging.example.com
    DAST_FULL_SCAN_ENABLED: "true"
    DAST_BROWSER_SCAN: "true"
  needs:
    - deploy-staging
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

deploy-production:
  stage: deploy-production
  image: bitnami/kubectl:latest
  script:
    - kubectl set image deployment/app app=$DOCKER_IMAGE -n production
    - kubectl rollout status deployment/app -n production --timeout=300s
  environment:
    name: production
    url: https://app.example.com
  when: manual
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
```

### Security Approval Policies

Configure scan execution policies to enforce mandatory security scans:

1. Navigate to Security & Compliance > Policies
2. Create a "Scan Execution Policy" requiring SAST and secret detection on all branches
3. Create a "Merge Request Approval Policy" requiring security team approval when critical vulnerabilities are detected

### Custom SAST Ruleset Configuration

Create `.gitlab/sast-ruleset.toml` to customize analyzer behavior:

```toml
[semgrep]
  [[semgrep.ruleset]]
    dirs = ["src"]

  [[semgrep.passthrough]]
    type = "url"
    target = "/sgrep-rules/custom-rules.yml"
    value = "https://semgrep.dev/p/owasp-top-ten"

  [[semgrep.passthrough]]
    type = "url"
    target = "/sgrep-rules/java-rules.yml"
    value = "https://semgrep.dev/p/java"
```

## Security Dashboard and Vulnerability Management

### Vulnerability Report

GitLab consolidates all scanner findings into a single Vulnerability Report accessible at Security & Compliance > Vulnerability Report. Each vulnerability includes:
- Severity rating (Critical, High, Medium, Low, Info)
- Scanner source (SAST, DAST, Container, Dependency, Secret)
- Location in source code or image layer
- Remediation guidance and suggested fixes
- Status tracking (Detected, Confirmed, Dismissed, Resolved)

### Merge Request Security Widget

Every merge request displays a security scanning widget showing:
- New vulnerabilities introduced by the MR
- Fixed vulnerabilities resolved by the MR
- Comparison against the target branch baseline

## Pipeline Optimization

- **Parallel execution**: Security scanners run concurrently in the security stage
- **Caching**: Use CI cache for dependency downloads to speed up scanning
- **Incremental scanning**: SAST can scan only changed files using `SAST_INCREMENTAL: "true"`
- **Fail conditions**: Set `allow_failure: false` on critical scanners to enforce quality gates

## Monitoring and Metrics

| Metric | Description | Target |
|--------|-------------|--------|
| Pipeline security coverage | Percentage of projects with all scanners enabled | > 95% |
| Critical vulnerability MTTR | Time from detection to resolution for critical findings | < 48 hours |
| False positive rate | Percentage of dismissed-as-false-positive findings | < 15% |
| Secret detection block rate | Percentage of secret commits blocked by push rules | > 99% |

## References

- [GitLab Security Scanning Documentation](https://docs.gitlab.com/ee/user/application_security/)
- [GitLab SAST Analyzers](https://docs.gitlab.com/ee/user/application_security/sast/)
- [GitLab DAST Configuration](https://docs.gitlab.com/ee/user/application_security/dast/)
- [GitLab Security Policies](https://docs.gitlab.com/ee/user/application_security/policies/)
- [GitLab Vulnerability Management](https://docs.gitlab.com/ee/user/application_security/vulnerability_report/)

© mahipal · Apache-2.0 · mukul975/Anthropic-Cybersecurity-Skills

Похожие скиллы

Все скиллы по теме «Безопасность» →
building-gitlab-ci-components nagyv Скилл building-gitlab-ci-components помогает собирать переиспользуемые GitLab CI/CD-компоненты: от структуры проекта и inputs до тестирования и публикации в CI/CD Catalog. CX Codex +1 1установок security-devsecops Mindrally Скилл security-devsecops для Claude Code и Codex направляет разработку по практикам DevSecOps и AppSec. Включается при работе с секретами, базой данных, аутентификацией или настройке CI/CD. CX Codex +1 117установок ci-cd ahmedasmar Скилл ci-cd помогает проектировать пайплайны GitHub Actions и GitLab CI, ускорять сборки кешированием и находить причины сбоев в тестах или деплое. CX Codex +1 367установок gitlab-workflow Mindrally Скилл gitlab-workflow учит ИИ-ассистента правилам GitLab: от оформления merge request до настройки конвейеров .gitlab-ci.yml. Помогает выстроить командную разработку. CX Codex +1 1 100установок gitlab-ci-validator akin-ozer Скилл gitlab-ci-validator проверяет синтаксис и правила безопасности в .gitlab-ci.yml. Пригодится перед мержем, чтобы отловить ошибки до пуша в репозиторий. CX Codex +1 758установок appsec-expert martinholovsky Скилл appsec-expert для Claude Code проектирует защиту приложений, ищет уязвимости и встраивает проверки безопасности в разработку. Помогает проводить аудит и исправлять проблемы безопасности. CX Codex +1 243установок

Из того же набора152

Весь набор →
analyzing-windows-event-logs-in-splunk Скилл analyzing-windows-event-logs-in-splunk для анализа журналов Windows Security, System и Sysmon в Splunk. CX Codex +1 251установок analyzing-windows-registry-for-artifacts Скилл analyzing-windows-registry-for-artifacts помогает извлекать и разбирать кусты реестра Windows при расследовании инцидентов. Находит автозагрузку, подключённые USB-накопители и следы запуска программ. CX Codex +1 248установок detecting-api-enumeration-attacks Скилл detecting-api-enumeration-attacks для Claude Code составляет SIEM-правила для поиска перебора идентификаторов и обхода проверок доступа к API. Включается при расследовании BOLA/IDOR и настройке охоты за угрозами. CX Codex +1 246установок conducting-full-scope-red-team-engagement Скилл conducting-full-scope-red-team-engagement для Claude Code планирует red team операции по MITRE ATT&CK. Запускается для оценки защиты от APT-атак или эмуляции действий группировки. CX Codex +1 243установок auditing-azure-active-directory-configuration Скилл auditing-azure-active-directory-configuration проводит аудит безопасности Microsoft Entra ID через Microsoft Graph API, Az CLI и ScoutSuite. Помогает найти избыточные привилегии и бреши в условном доступе. CX Codex +1 241установок auditing-gcp-iam-permissions Скилл auditing-gcp-iam-permissions для Claude Code проверяет IAM в GCP: широкие роли, ключи сервисных аккаунтов и доступ между проектами. Аудирует права и снижает риск бокового перемещения. CX Codex +1 241установок analyzing-usb-device-connection-history Скилл analyzing-usb-device-connection-history восстанавливает хронологию подключений USB-накопителей в Windows по реестру и журналам событий. Помогает расследовать утечки данных и действия инсайдеров. CX Codex +1 241установок performing-api-security-testing-with-postman Скилл performing-api-security-testing-with-postman для построения структурированных наборов тестов безопасности API в Postman, покрывающих OWASP API Security Top 10: обход аутентификации, ошибки авторизации, инъекции, утечки данных. CX Codex +1 240установок

Ещё в каталоге

Спонсоры проекта

Компании, которые помогают держать аналитику открытой