- add sbom Ansible role - install Syft on target hosts - generate CycloneDX SBOM files - fetch SBOM artifacts from managed hosts - integrate SBOM playbook into GitLab CI
43 lines
870 B
YAML
43 lines
870 B
YAML
default:
|
|
image: registry.gitlab/next-gen-portal/infra-custom-images/ansible-utilities:latest
|
|
tags:
|
|
- docker
|
|
stages:
|
|
- validate
|
|
- deploy
|
|
- security
|
|
|
|
before_script:
|
|
- echo "Setting up ssh ..."
|
|
- mkdir -p ~/.ssh
|
|
- cat "$SSH_PRIVATE_KEY_FILE" > ~/.ssh/id_ed25519
|
|
- chmod 600 ~/.ssh/id_ed25519
|
|
- cat "$SSH_PUBLIC_KEY_FILE" > ~/.ssh/id_ed25519.pub
|
|
- chmod 600 ~/.ssh/id_ed25519.pub
|
|
- export ANSIBLE_CONFIG=$CI_PROJECT_DIR/ansible.cfg
|
|
|
|
ansible-lint:
|
|
stage: validate
|
|
script:
|
|
- ansible-lint
|
|
|
|
syntax-check:
|
|
stage: validate
|
|
script:
|
|
- ansible-playbook --syntax-check playbooks/openvpn.yml
|
|
|
|
deploy-prod:
|
|
stage: deploy
|
|
script:
|
|
- ansible-playbook playbooks/openvpn.yml
|
|
|
|
sbom:
|
|
stage: security
|
|
script:
|
|
- ansible-playbook playbooks/sbom.yml
|
|
artifacts:
|
|
when: always
|
|
paths:
|
|
- reports/sbom/
|
|
expire_in: 365 days
|