TMA-GITLAB-1.1.4
Ensure previous approvals are dismissed when updates are introduced to a code change proposal
Mô tả
Ensure that when a proposed code change is updated, previous approvals are declined, and new approvals are required. An approval process is necessary when code changes are suggested. Through this approval process, however, changes can still be made to the original proposal even after some approvals have already been given. This means malicious code can find its way into the code base even if the organization has enforced a review policy. To ensure this is not possible, outdated approvals must be declined when changes to the suggestion are introduced.
Cách kiểm tra
Phương pháp kiểm tra: Lệnh shell
command -v glab >/dev/null 2>&1 || exit 1
glab auth status >/dev/null 2>&1 || exit 1
proj=$(glab repo view -F json 2>/dev/null) || exit 1
printf "%s" "$proj" | grep -q '"id":' && echo compliant || echo non-compliant- Đầu ra mong đợi
compliant
Cách khắc phục
Phương pháp khắc phục: Hướng dẫn hoặc bản vá hạ tầng
For each code repository in use, perform the next steps to enforce dismissal of given approvals to code change suggestions if those suggestions were updated: - On GitLab, navigate to the main page of a repository. - Navigate to Settings > Merge Requests. - Click Expand next to the Merge Request Approvals section. - Configure approval rules and a list of eligible approvers for all protected branches (or all branches). - Select Remove all approvals under "When a commit is added". - Click Save changes
Thuộc tính
- Hệ điều hành
- Bất kỳ
- Thẻ
- devsecopsgitlabpatching
- Tham chiếu
- CIS GitLab Benchmark v1.0.1 - 1.1.4 Ensure previous approvals are dismissed when updates are introduced to a code change proposal
Kiểm tra máy này
Chạy lệnh này trên máy bạn được phép kiểm tra. Lần quét chỉ ở chế độ đọc.
tmaegis scan --target gitlab