Skip to content

Commit b2f2b14

Browse files
feat: initial commit
1 parent 34de0f7 commit b2f2b14

114 files changed

Lines changed: 33979 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cicsdev/sdv-sample.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: cics-security-sdv-samples
2+
description: "Provides tooling to introduce Security testing into your CICS applications CI pipelines"
3+
learning_objective: |
4+
Learn how to use the Galasa SDV manager to write role-based tests for your CICS applications, then how to adapt
5+
the applications CI pipeline to detect changes in security definition usage following application code change
6+
requests and initiate an approval process.
7+
product:
8+
cicsts:
9+
version:
10+
minimum: 6.2
11+
language: javascript,python,ansible
12+
13+
build:
14+
ide:
15+
- VS Code
16+
tools:
17+
- Node
18+
- Python
19+
- Ansible
20+
- GitHub
21+
- Galasa

.devcontainer/Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#
2+
# Copyright IBM Corp. 2024
3+
#
4+
FROM mcr.microsoft.com/devcontainers/base:jammy
5+
6+
RUN apt update
7+
8+
ENV LOG_LEVEL="trace"
9+
10+
EXPOSE 3000
11+
EXPOSE 3001
12+
13+
COPY initialise_dev_container.sh /post_script/initialise_dev_container.sh
14+
15+
RUN mkdir -p /workspaces; \
16+
chmod 755 /post_script/initialise_dev_container.sh
17+
18+
WORKDIR /workspaces

.devcontainer/devcontainer.json

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"name": "cics-security-sdv-samples Container",
3+
"build": {
4+
"dockerfile": "Dockerfile"
5+
},
6+
"customizations": {
7+
"vscode": {
8+
"settings": {
9+
"vsintellicode.java.completionsEnabled": false,
10+
"vsintellicode.python.completionsEnabled": false,
11+
"vsintellicode.sql.completionsEnabled": false,
12+
"vsintellicode.typescript.completionsEnabled": false,
13+
"vsintellicode.modify.editor.suggestSelection": "disabled",
14+
"errorLens.onSave": true,
15+
"errorLens.messageEnabled": true,
16+
"versionlens.suggestions.showOnStartup": true,
17+
"editor.formatOnSave": true,
18+
"ansible.python.interpreterPath": "/usr/local/python/current/bin/python",
19+
"pylint.interpreter": [
20+
"/usr/local/python/current/bin/python"
21+
],
22+
"eslint.workingDirectories": [
23+
"./docs",
24+
"./lib"
25+
],
26+
"stylelint.validate": [
27+
"css",
28+
"scss"
29+
],
30+
"stylelint.configBasedir": "./docs"
31+
},
32+
"extensions": [
33+
"dbaeumer.vscode-eslint",
34+
"usernamehw.errorlens",
35+
"igorsbitnev.error-gutters",
36+
"wayou.vscode-todo-highlight",
37+
"pflannery.vscode-versionlens",
38+
"bierner.markdown-emoji",
39+
"redhat.ansible",
40+
"ms-python.flake8",
41+
"gruntfuggly.todo-tree",
42+
"ms-python.python",
43+
"ms-python.pylint",
44+
"stylelint.vscode-stylelint",
45+
"streetsidesoftware.code-spell-checker"
46+
]
47+
}
48+
},
49+
"features": {
50+
"ghcr.io/devcontainers/features/git:1": {},
51+
"ghcr.io/devcontainers/features/common-utils:2": {},
52+
"ghcr.io/devcontainers/features/node:1": {
53+
"version": "18"
54+
},
55+
"ghcr.io/devcontainers/features/python:1": {
56+
"version": "3.12"
57+
}
58+
},
59+
"forwardPorts": [
60+
3000,
61+
3001
62+
],
63+
"privileged": true,
64+
"remoteUser": "root",
65+
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces,type=bind",
66+
"workspaceFolder": "/workspaces",
67+
"postStartCommand": "git config --global --add safe.directory /workspaces; git config commit.gpgsign false",
68+
"postAttachCommand": "/post_script/initialise_dev_container.sh"
69+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#
2+
# Copyright IBM Corp. 2024
3+
#
4+
5+
# Install approval bot dependencies
6+
npm install
7+
8+
# Install docs dependencies
9+
cd docs
10+
npm install
11+
cd ..
12+
13+
# Install Ansible tooling
14+
pip install ansible==10.2.0 ansible-lint==24.7.0 --root-user-action=ignore
15+
16+
# Install ansible script dependencies
17+
cd ansible-sdv-pipeline
18+
pip install -r requirements.txt --root-user-action=ignore
19+

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*
2+
!lib/
3+
!index.js
4+
!package.json
5+
!package-lock.json

.env.example

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# The ID of your GitHub App; You can find this in the About section of your Github app
2+
APP_ID=
3+
4+
# The Webhook Secret; This is generated by you and then inputted in the settings of your Github app.
5+
WEBHOOK_SECRET=development
6+
7+
# Use `trace` to get verbose logging or `info` to show less
8+
LOG_LEVEL=debug
9+
10+
PRIVATE_KEY=""
11+
12+
GHE_HOST=github.com
13+
14+
CHECK_NAME=Security

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
text eol=lf

.github/workflows/ansible-lint.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Ansible
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
jobs:
10+
Lint:
11+
runs-on: ubuntu-latest
12+
defaults:
13+
run:
14+
working-directory: "ansible-sdv-pipeline"
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Set up Python 3.x
19+
uses: actions/setup-python@v3
20+
with:
21+
python-version: 3.x
22+
- name: Install Ansible-lint
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install ansible-lint
26+
- name: Running Ansible-lint
27+
run: ansible-lint ./*

.github/workflows/docs.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: SDV Documentation
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: false
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
defaults:
22+
run:
23+
working-directory: "docs"
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- name: Use Node.js 18.x
29+
uses: actions/setup-node@v3
30+
with:
31+
node-version: "18.x"
32+
cache: "npm"
33+
cache-dependency-path: "**/package-lock.json"
34+
35+
- name: Installing dependencies
36+
run: npm ci
37+
38+
- name: Linting the docs code
39+
run: npm run lint
40+
working-directory: "docs"
41+
42+
- name: Setup Pages
43+
uses: actions/configure-pages@v4
44+
with:
45+
static_site_generator: next
46+
47+
- name: Building docs
48+
run: npm run build
49+
50+
- name: Uploading artifacts
51+
if: ${{ github.ref == 'refs/heads/main' }}
52+
uses: actions/upload-pages-artifact@v3
53+
with:
54+
path: ./docs/out
55+
56+
deploy:
57+
if: ${{ github.ref == 'refs/heads/main' }}
58+
environment:
59+
name: github-pages
60+
url: ${{ steps.deployment.outputs.page_url }}
61+
62+
runs-on: ubuntu-latest
63+
defaults:
64+
run:
65+
working-directory: "docs"
66+
needs: build
67+
68+
steps:
69+
- name: Publish to GitHub Pages
70+
id: deployment
71+
uses: actions/deploy-pages@v4

.github/workflows/node.js.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: SDV Approval Bot Build
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
jobs:
10+
Test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
- name: Use Node.js 18.x
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: "18.x"
21+
cache: "npm"
22+
cache-dependency-path: "**/package-lock.json"
23+
- name: Installing dependencies
24+
run: npm ci
25+
- name: Linting the commit message
26+
run: npx commitlint -V --from=HEAD~1
27+
- name: Linting the application code
28+
run: npm run lint-bot
29+
- name: Running unit tests
30+
run: npm run unit-test

0 commit comments

Comments
 (0)