Skip to content

Commit 0c3c3d2

Browse files
committed
Update deploy scripts
0 parents  commit 0c3c3d2

11 files changed

Lines changed: 106 additions & 0 deletions

File tree

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DATABASE_PASSWORD='super_secret_password_123'

.github/workflows/sentinel.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Sentinel Security Gate
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
security-check:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout Code
14+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
15+
16+
- name: Install Sentinel
17+
env:
18+
INSTALL_TOKEN: ${{ secrets.SENTINEL_INSTALL_TOKEN }}
19+
run: |
20+
python -m pip install --upgrade pip
21+
# Admin must replace placeholder with their private repo
22+
pip install git+https://x-access-token:${INSTALL_TOKEN}@github.com/[YOUR_ORG/YOUR_SENTINEL_REPO].git@main
23+
24+
- name: Execute Security Scan
25+
id: scan_step
26+
env:
27+
# Automatically binds reporting to the client's repository
28+
SENTINEL_AUTHORIZED_REPO: ${{ github.repository }}
29+
SENTINEL_ALERT_TOKEN: ${{ secrets.SENTINEL_ALERT_TOKEN }}
30+
run: sentinel scan . --report
31+
continue-on-error: true
32+
33+
- name: Upload Security Report
34+
if: steps.scan_step.outcome == 'failure'
35+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08
36+
with:
37+
name: sentinel-security-report
38+
path: sentinel_report.html
39+
retention-days: 7
40+
41+
- name: Terminate on Failure
42+
if: steps.scan_step.outcome == 'failure'
43+
run: exit 1

.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# English technical comments for the repository protection
2+
3+
# Virtual environments (Do not track local Python copies)
4+
venv/
5+
.venv/
6+
env/
7+
8+
# Python byte-code and runtime cache
9+
__pycache__/
10+
*.py[cod]
11+
*$py.class
12+
13+
# Distribution and Build artifacts (Generated by setup.py)
14+
dist/
15+
build/
16+
*.egg-info/
17+
*.zip
18+
*.tar.gz
19+
20+
# Sentinel dynamic reports (Reports should be generated fresh each time)
21+
sentinel_report.html
22+
23+
# IDE and Editor settings (Local development configs)
24+
.vscode/
25+
.idea/
26+
*.swp
27+
.DS_Store
28+
29+
# Testing and Coverage
30+
.pytest_cache/
31+
.coverage
32+
htmlcov/

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FROM node:latest

hack_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DB_PASS = '1234567890'

requirements.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Project-level dependencies for Sentinel Core
2+
# These versions are pinned for production stability
3+
4+
click==8.1.7
5+
pyyaml==6.0.1
6+
requests==2.31.0

secrets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
aws_key = 'AKIAIMNO789012345678'

sentinel.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
ignore:
2+
- venv/*
3+
- .git/*
4+
- node_modules/*
5+
- sentinel/rules/secrets/*
6+
- sentinel_report.html
7+
overrides: []
8+
severity:
9+
INFRA-001: BLOCK
10+
SEC-001: BLOCK
11+
SUPPLY-001: BLOCK

temp_check.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ADMIN_PASSWORD = 'password12345'

test_infra.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
resource "aws_security_group" "bad_example" {
2+
ingress {
3+
from_port = 22
4+
to_port = 22
5+
protocol = "tcp"
6+
cidr_blocks = ["0.0.0.0/0"] # Это вызовет срабатывание правила INFRA-002
7+
}
8+
}

0 commit comments

Comments
 (0)