Skip to content

Commit fd02cc1

Browse files
committed
Merge branch 'feature/srt-integration' into 'develop'
Replace DSR with open-source SRT security scanning tool See merge request genaiic-reusable-assets/engagement-artifacts/genaiic-idp-accelerator!629
2 parents 3eb319c + 0264b46 commit fd02cc1

17 files changed

Lines changed: 44831 additions & 76428 deletions

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ __pycache__
2323
.kiro
2424
notebooks/examples/data
2525
.idea/
26-
.dsr/
26+
.srt/
2727
*tmp-dev-assets*
2828
scratch/
2929
.mcp.json

.gitlab-ci.yml

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ stages:
2222
- developer_tests
2323
- deployment_validation
2424
- integration_tests
25+
- security_review
2526

2627
developer_tests:
2728
stage: developer_tests
@@ -115,7 +116,7 @@ integration_tests:
115116
when: manual
116117
- if: $CI_COMMIT_BRANCH =~ /^release\/.*/
117118
when: manual
118-
- when: manual
119+
- when: never
119120

120121
before_script:
121122
- apt-get update -y
@@ -192,4 +193,55 @@ integration_tests:
192193
paths:
193194
- pipeline_execution_id.txt
194195
- codebuild_logs.txt
195-
expire_in: 1 week
196+
expire_in: 1 week
197+
198+
srt_security_review:
199+
stage: security_review
200+
timeout: 30m # SRT scan typically takes 5-10 minutes
201+
202+
# Use runner with more memory for SRT security scanning
203+
# saas-linux-medium-amd64: 4 vCPUs, 16 GB RAM
204+
tags:
205+
- size:large
206+
207+
# Only run on merge requests targeting develop branch
208+
rules:
209+
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop"
210+
when: on_success
211+
- when: never
212+
213+
before_script:
214+
- python --version
215+
- apt-get update -y
216+
- apt-get install curl python3-pip -y
217+
# Install Python dependencies for SRT setup script
218+
- pip install --upgrade pip
219+
220+
script:
221+
- echo "Running SRT (Sample Security Review Tool) security assessment..."
222+
- echo "This stage only runs on merge requests targeting develop branch"
223+
- make srt-setup
224+
- make srt-scan
225+
226+
after_script:
227+
- |
228+
if [ -d ".srt" ]; then
229+
echo "SRT assessment completed"
230+
# Copy SRT reports to artifacts root for easy access
231+
[ -f ".srt/issues.json" ] && cp .srt/issues.json srt-issues.json
232+
[ -f ".srt/dashboard.html" ] && cp .srt/dashboard.html srt-dashboard.html
233+
[ -f ".srt/bandit-summary.json" ] && cp .srt/bandit-summary.json srt-bandit-summary.json
234+
[ -f ".srt/syft-summary.json" ] && cp .srt/syft-summary.json srt-syft-summary.json
235+
echo "✓ SRT reports captured for download"
236+
fi
237+
238+
artifacts:
239+
when: always
240+
paths:
241+
- srt-issues.json
242+
- srt-dashboard.html
243+
- srt-bandit-summary.json
244+
- srt-syft-summary.json
245+
reports:
246+
# Future: Add security scanning report format when GitLab supports it
247+
expire_in: 1 week

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ SPDX-License-Identifier: MIT-0
55

66
## [Unreleased]
77

8+
### Changed
9+
10+
- **Replaced DSR with open-source SRT security scanning tool** — Migrated from deprecated internal DSR (Design Security Review) tool to the actively maintained open-source [Sample Security Review Tool (SRT)](https://github.com/aws-samples/sample-security-review-tool). Added automated security scanning in GitLab CI/CD pipeline that runs on merge requests targeting `develop` branch. Pipeline fails if security findings are detected, providing a security gate before production deployments. New Makefile targets: `make srt`, `make srt-setup`, `make srt-scan`, `make srt-fix`. Updated documentation in CLAUDE.md, CONTRIBUTING.md, and scripts/README.md.
11+
812
## [0.5.9]
913

1014
### Added

CLAUDE.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ make lint-cicd
6464
### Testing
6565

6666
```bash
67-
# Run all tests (idp_common_pkg + idp_cli)
67+
# Run all tests (idp_common_pkg + idp_cli + srt security scan)
6868
make test
6969

7070
# Run tests in idp_common_pkg only
@@ -84,6 +84,26 @@ pytest -m "unit"
8484
pytest -m "integration"
8585
```
8686

87+
### Security Scanning
88+
89+
The project includes automated security scanning with the [Sample Security Review Tool (SRT)](https://github.com/aws-samples/sample-security-review-tool):
90+
91+
```bash
92+
# Run full SRT workflow (setup → scan → optional fix)
93+
make srt
94+
95+
# Or run individual steps:
96+
make srt-setup # Download and configure SRT
97+
make srt-scan # Run security assessment
98+
make srt-fix # Interactive fix mode
99+
```
100+
101+
**CI/CD Integration:**
102+
- SRT automatically runs on merge requests targeting `develop` branch (GitLab CI `security_review` stage)
103+
- Does not run on feature branch pushes to avoid blocking development
104+
- Pipeline fails if high-priority security findings are detected
105+
- Provides security gate before code is merged to `develop`
106+
87107
### IDP CLI Commands
88108

89109
The IDP CLI is used for programmatic deployment and batch processing:

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,14 @@ make ui-start STACK_NAME=my-idp-stack
204204
| `make docs-build` | Build documentation site (no serve) |
205205
| `make docs-deploy` | Deploy docs to GitHub Pages (from local build) |
206206

207-
### Security (DSR)
207+
### Security (SRT)
208208

209209
| Command | Description |
210210
|---------|-------------|
211-
| `make dsr` | Run full DSR workflow (setup → scan → optional fix) |
212-
| `make dsr-setup` | Set up DSR tool |
213-
| `make dsr-scan` | Run DSR security scan |
214-
| `make dsr-fix` | Run DSR interactive fix |
211+
| `make srt` | Run full SRT workflow (setup → scan → optional fix) |
212+
| `make srt-setup` | Download and configure SRT tool |
213+
| `make srt-scan` | Run SRT security assessment |
214+
| `make srt-fix` | Run SRT interactive fix |
215215

216216
## Coding Standards
217217

Makefile

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,16 @@ typecheck-pr: ## Type check only files changed vs TARGET_BRANCH (default: main)
197197
$(PYTHON) scripts/sdlc/typecheck_pr_changes.py $(TARGET_BRANCH)
198198

199199
##@ Testing
200-
test: ## Run all tests (idp_common, cli, sdk, capacity, config library)
200+
test: ## Run all tests (idp_common, cli, sdk, capacity, config library, srt)
201201
$(MAKE) -C lib/idp_common_pkg test PYTHON=$(PYTHON)
202202
cd lib/idp_cli_pkg && $(PYTHON) -m pytest -v
203203
cd lib/idp_sdk && $(PYTHON) -m pytest -m "not integration" -v
204204
@echo "Running capacity planning Lambda tests..."
205205
cd src/lambda/calculate_capacity && $(PYTHON) -m pytest -v
206206
@echo "Validating config library files..."
207207
$(PYTHON) -m pytest config_library/test_config_library.py -v
208+
@echo "Running SRT security scan..."
209+
$(MAKE) srt
208210

209211
test-cli: ## Run only IDP CLI tests
210212
@echo "Running IDP CLI tests..."
@@ -379,28 +381,28 @@ docs-deploy: docs-build ## Deploy docs to GitHub Pages (from local build)
379381
cd docs-site && npx gh-pages -d dist --dotfiles --repo https://github.com/aws-solutions-library-samples/accelerated-intelligent-document-processing-on-aws.git
380382
@echo -e "$(GREEN)✅ Docs deployed to GitHub Pages!$(NC)"
381383

382-
##@ Security (DSR)
383-
dsr: ## Run full DSR workflow (setup → scan → optional fix)
384-
@$(MAKE) dsr-setup
385-
@$(MAKE) dsr-scan
384+
##@ Security (SRT)
385+
srt: ## Run full SRT workflow (setup → scan → optional fix)
386+
@$(MAKE) srt-setup
387+
@$(MAKE) srt-scan
386388
@echo ""
387-
@echo "Do you want to run DSR fix? (y/N):"
389+
@echo "Do you want to run SRT fix? (y/N):"
388390
@read answer && \
389391
if [ "$$answer" = "y" ] || [ "$$answer" = "Y" ]; then \
390-
$(MAKE) dsr-fix; \
392+
$(MAKE) srt-fix; \
391393
fi
392394

393-
dsr-setup: ## Set up DSR tool
394-
@echo "Setting up DSR tool..."
395-
$(PYTHON) scripts/dsr/setup.py
395+
srt-setup: ## Download and configure SRT tool
396+
@echo "Setting up SRT tool..."
397+
$(PYTHON) scripts/srt/setup.py
396398

397-
dsr-scan: ## Run DSR security scan
398-
@echo "Running DSR security scan..."
399-
$(PYTHON) scripts/dsr/run.py
399+
srt-scan: ## Run SRT security assessment
400+
@echo "Running SRT security assessment..."
401+
$(PYTHON) scripts/srt/run.py
400402

401-
dsr-fix: ## Run DSR interactive fix
402-
@echo "Running DSR interactive fix..."
403-
$(PYTHON) scripts/dsr/fix.py
403+
srt-fix: ## Run SRT interactive fix
404+
@echo "Running SRT interactive fix..."
405+
$(PYTHON) scripts/srt/fix.py
404406

405407
##@ Deploy
406408
# Thin wrappers around `idp-cli publish` / `deploy` / `delete` for the common

scripts/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This directory contains utility scripts for building, testing, deploying, and op
77
```
88
scripts/
99
├── setup/ # Development environment setup scripts
10-
├── dsr/ # DSR (Deliverable Security Review) integration
10+
├── srt/ # SRT (Sample Security Review Tool) integration
1111
├── sdlc/ # SDLC CI/CD scripts and infrastructure
1212
│ ├── cfn/ # CloudFormation templates for CI/CD pipeline
1313
│ └── [scripts] # CI/CD automation scripts
@@ -19,8 +19,8 @@ scripts/
1919
### `setup/` - Development Environment Setup
2020
Setup scripts for different operating systems. See [setup/README.md](setup/README.md).
2121

22-
### `dsr/` - DSR Security Scanning
23-
DSR (Deliverable Security Review) integration for automated security scanning. See [dsr/README.md](dsr/README.md).
22+
### `srt/` - SRT Security Scanning
23+
SRT (Sample Security Review Tool) integration for automated security scanning. See [srt/README.md](srt/README.md).
2424

2525
### `sdlc/` - SDLC CI/CD Scripts and Infrastructure
2626
CloudFormation templates and scripts for CI/CD pipeline infrastructure.

scripts/dsr/README.md

Lines changed: 0 additions & 148 deletions
This file was deleted.

0 commit comments

Comments
 (0)