repositories

daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR

clonegit clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
cicd-gitlab-ci.mdMarkdown132 lines5.1 KiBsource raw download

title: "CI/CD - Gitlab CI" section: "DevOps" sectionSlug: "devops" sourcePath: "docs/devops/cicd-gitlab-ci.md" sourceUrl: "https://github.com/swisskyrepo/InternalAllTheThings/blob/203bb0c0b290/docs/devops/cicd-gitlab-ci.md" sha: "203bb0c0b290" isIndex: false#

CI/CD - Gitlab CI#

GitLab CI (Continuous Integration) is a built-in feature of GitLab that automates the process of building, testing, and deploying your code every time you make a change. It's part of GitLab CI/CD, which stands for Continuous Integration / Continuous Deployment.

Gitlab Runners#

sudo apt-get install gitlab-runner
sudo gitlab-runner register
Prompt Example Input
GitLab instance URL https://gitlab.com/
Registration token Found in your project under Settings > CI/CD > Runners
Executor shell, docker, etc.
Description my-remote-runner
Tags remote

The .gitlab-ci.yml file is the configuration file that GitLab CI/CD uses to define your pipelines, jobs, and stages.

Command Execution Jobs#

Gitlab-CI "Command Execution" example: .gitlab-ci.yml

stages:
    - test

test:
    stage: test
    script:
        - |
            whoami
    parallel:
        matrix:
            - RUNNER: VM1
            - RUNNER: VM2
            - RUNNER: VM3
    tags:
        - ${RUNNER}

List GitLab Runners#

List all GitLab runners available to the current user in GitLab.

SCMKit.exe -s gitlab -m listrunner -c userName:password -u https://gitlab.something.local
SCMKit.exe -s gitlab -m listrunner -c apikey -u https://gitlab.something.local

Gitlab Executors#

Gitlab CI/CD Variables#

CI/CD Variables are a convenient way to store and use data in a CI/CD pipeline, but variables are less secure than secrets management providers.

Persistence#

Personal Access Token#

Create a PAT (Personal Access Token) as a persistence mechanism for the Gitlab instance.

SSH Keys#

User Promotion#

Tools#

References#