Skip to content

Commit c7d644f

Browse files
authored
Project linting (OWASP#95)
* ci: add pre-commit workflows * feat: add pin-github-action hooks * docs: fix end of lines * docs: remove trailing whitespace * docs: quick md linting * docs: markdown-lint * docs: markdown-lint * docs: markdown-lint * docs: update TOC & README.md * docs: fix typo
1 parent 1e69b3c commit c7d644f

File tree

52 files changed

+885
-530
lines changed

Some content is hidden

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

52 files changed

+885
-530
lines changed

.config/.markdown-lint.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
default: true
3+
MD004:
4+
style: dash
5+
MD007:
6+
indent: 2
7+
start_indented: false
8+
MD013:
9+
code_block_line_length: 80
10+
heading_line_length: 99
11+
line_length: 1600
12+
code_blocks: false
13+
headings: true
14+
stern: false
15+
strict: false
16+
tables: false
17+
MD025:
18+
level: 1
19+
front_matter_title: ""
20+
MD033:
21+
allowed_elements: [a, br, p, img]
22+
MD041:
23+
level: 1
24+
front_matter_title: ""
25+
MD044:
26+
code_blocks: false
27+
MD046:
28+
style: fenced
29+
MD048:
30+
style: backtick

.github/workflows/master.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
name: CI - Master
3+
4+
on: # yamllint disable-line rule:truthy
5+
push:
6+
branches:
7+
- master
8+
pull_request:
9+
branches:
10+
- master
11+
workflow_dispatch:
12+
13+
concurrency:
14+
group: ${{ github.ref }}-${{ github.workflow }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
19+
pre-commit:
20+
name: Run pre-commit
21+
runs-on: ubuntu-24.04
22+
timeout-minutes: 5
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
27+
28+
- name: Setup python
29+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
30+
with:
31+
python-version: '3.13'
32+
33+
- name: Set python environment variable
34+
run: |
35+
echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
36+
37+
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
38+
with:
39+
path: ~/.cache/pre-commit
40+
key: pre-commit | ${{ env.PY }} | ${{ hashFiles('.pre-commit-config.yaml') }}
41+
42+
- name: Run pre-commit
43+
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
.DS_Store
33
._.DS_Store
44
**/.DS_Store
5-
**/._.DS_Store
5+
**/._.DS_Store

.pre-commit-config.yaml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
# pre-commit install --allow-missing-config && pre-commit autoupdate && pre-commit run --all-files --color auto
3+
exclude: |
4+
(?x)^(
5+
old-versions/.*
6+
)
7+
fail_fast: true
8+
default_stages:
9+
- pre-commit
10+
default_language_version:
11+
python: python3.13
12+
default_install_hook_types:
13+
- commit-msg
14+
- pre-commit
15+
ci:
16+
autoupdate_schedule: monthly
17+
repos:
18+
- repo: meta
19+
hooks:
20+
- id: identity
21+
name: "meta | pre-commit hooks"
22+
stages:
23+
- manual
24+
- repo: https://github.com/pre-commit/pre-commit-hooks
25+
rev: v6.0.0
26+
hooks:
27+
- id: check-added-large-files
28+
name: "git | block large files"
29+
args: [--maxkb=2048]
30+
- id: check-json
31+
name: "general | check JSON files"
32+
- id: check-toml
33+
name: "general | check TOML files"
34+
- id: check-xml
35+
name: "general | check XML files"
36+
- id: check-yaml
37+
name: "general | check YAML files"
38+
- id: end-of-file-fixer
39+
name: "general | fix end of file"
40+
- id: forbid-new-submodules
41+
name: "git | forbid new submodules"
42+
- id: forbid-submodules
43+
name: "git | forbid submodules usage"
44+
- id: mixed-line-ending
45+
name: "general | fix line ending"
46+
args:
47+
- --fix=auto
48+
- id: pretty-format-json
49+
name: "general | prettify JSON files"
50+
args:
51+
- --autofix
52+
- --no-ensure-ascii
53+
- id: trailing-whitespace
54+
name: "general | remove trailing whitespace"
55+
- repo: local
56+
hooks:
57+
- id: pin-github-action
58+
name: "gh-action | lint: pinned sha"
59+
files: ^\.github/workflows/[^/]+\.ya?ml$
60+
entry: "pin-github-action ."
61+
language: node
62+
additional_dependencies:
63+
- pin-github-action@3.4.0
64+
stages:
65+
- manual
66+
- repo: https://github.com/igorshubovych/markdownlint-cli
67+
rev: v0.45.0
68+
hooks:
69+
- id: markdownlint
70+
name: "md | lint: run markdownlint-cli"
71+
args:
72+
- --config
73+
- .config/.markdown-lint.yml
74+
exclude: |
75+
(?x)^(
76+
doc-utilities/scripts/toc.md
77+
)

LICENSE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
44

5-
## You are free to:
5+
## You are free to
66

77
- **Share** — copy and redistribute the material in any medium or format
88
- **Adapt** — remix, transform, and build upon the material for any purpose, even commercially.
99

10-
## Under the following terms:
10+
## Under the following terms
1111

1212
- **Attribution** — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
1313

@@ -17,10 +17,10 @@ This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 Intern
1717

1818
- You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
1919

20-
## Notices:
20+
## Notices
2121

2222
You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation.
2323

2424
No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may need to be obtained before you use the material.
2525

26-
For more details, see the [full text](https://creativecommons.org/licenses/by-sa/4.0/legalcode) of the license.
26+
For more details, see the [full text](https://creativecommons.org/licenses/by-sa/4.0/legalcode) of the license.

README.md

Lines changed: 55 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,37 @@
11
# OWASP DevSecOps Guideline
2-
The OWASP DevSecOps Guideline explains how we can implement a secure pipeline and use best practices and introduce tools that we can use in this matter. Also, the project is trying to help us promote the shift-left security culture in our development process.
2+
3+
The OWASP DevSecOps Guideline explains how we can implement a secure pipeline and use best practices and introduce tools that we can use in this matter. Also, the project is trying to help us promote the shift-left security culture in our development process.
34
This project helps any companies of each size that have a development pipeline or, in other words, have a DevOps pipeline.
4-
We try to draw a perspective of a secure DevOps pipeline during this project and then improve it based on our customized requirements.
5+
We try to draw a perspective of a secure DevOps pipeline during this project and then improve it based on our customized requirements.
56

67
The Ideal goal is **"detect security issues (by design or application vulnerability) as early as possible."**
78

89
## Initial steps
10+
911
DevSecOps is all about putting security into DevOps. But to keep up with the pace of CI/CD, security has to be injected early into software writing and testing.
1012

1113
![DevSecOps cycle](/assets/images/DevSecOps-cycle.png)
1214

13-
[OWASP Proactive Controls](https://owasp.org/www-project-proactive-controls/) lists the top 10 security controls every developer has to implement while coding any application. Consider this set as the starting point when you have to design, write or test code in the DevSecOps cycle.
15+
[OWASP Proactive Controls](https://owasp.org/www-project-proactive-controls/) lists the top 10 security controls every developer has to implement while coding any application. Consider this set as the starting point when you have to design, write or test code in the DevSecOps cycle.
1416

1517
You can also follow the [OWASP Software Assurance Maturity Model (SAMM)](https://owaspsamm.org/model/) to establish what to consider for security requirements (and more) according to your maturity level.
1618

1719
## What to add in a pipeline
20+
1821
![DevSecOps pipeline](/assets/images/DevSecOps-pipeline.png)
1922
At first, we consider implementing the following steps in a basic pipeline:
20-
* Scan git repositories for finding potential credentials leakage.
21-
* SCA (Software Composition Analysis)
22-
* SAST (Static Application Security Test)
23-
* IaC Scanning (Scanning Terraform, HelmChart code to find misconfiguration)
24-
* IAST (Interactive Application Security Testing)
25-
* API Security
26-
* DAST (Dynamic Application Security Test)
27-
* CNAPP (Cloud Native Application Protection)
28-
* Infrastructure scanning
29-
* Continuous Scanning from other tools
30-
* Compliance check
23+
24+
- Scan git repositories for finding potential credentials leakage.
25+
- SCA (Software Composition Analysis)
26+
- SAST (Static Application Security Test)
27+
- IaC Scanning (Scanning Terraform, HelmChart code to find misconfiguration)
28+
- IAST (Interactive Application Security Testing)
29+
- API Security
30+
- DAST (Dynamic Application Security Test)
31+
- CNAPP (Cloud Native Application Protection)
32+
- Infrastructure scanning
33+
- Continuous Scanning from other tools
34+
- Compliance check
3135

3236
We can customize the steps of our pipeline according to our Software Development Life Cycle (SDLC) or software architecture and add automation progressively if we are starting.
3337
For instance, we can switch from SAST/DAST to a regular test suite with built-in security controls or add an audit script checking for known vulnerable dependencies.
@@ -36,7 +40,9 @@ CI/CD is an advantage for SecOps, a privileged entry point for security measures
3640
However, when using CI/CD tools to provide automation, keep in mind that the tools themselves often expand your attack surface, so put security controls on building, deployment, and automation software.
3741

3842
---
39-
## Table of Contents:
43+
44+
## Table of Contents
45+
4046
- [0-Intro](current-version/0-Intro)
4147
- [0-1-Intro](current-version/0-Intro/0-1-Intro.md)
4248
- [0-2-Overview](current-version/0-Intro/0-2-Overview.md)
@@ -49,32 +55,39 @@ However, when using CI/CD tools to provide automation, keep in mind that the too
4955
- [2-Process](current-version/2-Process)
5056
- [2-1-Design](current-version/2-Process/2-1-Design)
5157
- [2-1-1-Threat-modeling](current-version/2-Process/2-1-Design/2-1-1-Threat-modeling.md)
52-
- [2-2-Code](current-version/2-Process/2-2-Code)
53-
- [2-2-3-Interactive-Application-Security-Testing](current-version/2-Process/2-2-Code/2-2-3-Interactive-Application-Security-Testing.md)
54-
- [2-2-1-Pre-commit](current-version/2-Process/2-2-Code/2-2-1-Pre-commit)
55-
- [2-2-1-1-Pre-commit](current-version/2-Process/2-2-Code/2-2-1-Pre-commit/2-2-1-1-Pre-commit.md)
56-
- [2-2-1-2-Secrets-Management](current-version/2-Process/2-2-Code/2-2-1-Pre-commit/2-2-1-2-Secrets-Management.md)
57-
- [2-2-1-3-Linting-code](current-version/2-Process/2-2-Code/2-2-1-Pre-commit/2-2-1-3-Linting-code.md)
58-
- [2-2-1-4-Repository-Hardening](current-version/2-Process/2-2-Code/2-2-1-Pre-commit/2-2-1-4-Repository-Hardening.md)
59-
- [2-2-2-Static-Analysis](current-version/2-Process/2-2-Code/2-2-2-Static-Analysis)
60-
- [2-2-2-1-Static-Application-Security-Testing](current-version/2-Process/2-2-Code/2-2-2-Static-Analysis/2-2-2-1-Static-Application-Security-Testing.md)
61-
- [2-2-2-2-Software-Composition-Analysis](current-version/2-Process/2-2-Code/2-2-2-Static-Analysis/2-2-2-2-Software-Composition-Analysis.md)
62-
- [2-2-2-3-Infastructure-as-Code-Scanning](current-version/2-Process/2-2-Code/2-2-2-Static-Analysis/2-2-2-3-Infastructure-as-Code-Scanning.md)
63-
- [2-2-2-4-Container-Security](current-version/2-Process/2-2-Code/2-2-2-Static-Analysis/2-2-2-4-Container-Security)
64-
- [2-2-2-4-1-Container-Scanning](current-version/2-Process/2-2-Code/2-2-2-Static-Analysis/2-2-2-4-Container-Security/2-2-2-4-1-Container-Scanning.md)
65-
- [2-2-2-4-2-Container-Hardening](current-version/2-Process/2-2-Code/2-2-2-Static-Analysis/2-2-2-4-Container-Security/2-2-2-4-2-Container-Hardening.md)
58+
- [2-2-Develop](current-version/2-Process/2-2-Develop)
59+
- [2-2-1-Pre-commit](current-version/2-Process/2-2-Develop/2-2-1-Pre-commit)
60+
- [2-2-1-1-Pre-commit](current-version/2-Process/2-2-Develop/2-2-1-Pre-commit/2-2-1-1-Pre-commit.md)
61+
- [2-2-1-2-Secrets-Management](current-version/2-Process/2-2-Develop/2-2-1-Pre-commit/2-2-1-2-Secrets-Management.md)
62+
- [2-2-1-3-Linting-code](current-version/2-Process/2-2-Develop/2-2-1-Pre-commit/2-2-1-3-Linting-code.md)
63+
- [2-2-1-4-Repository-Hardening](current-version/2-Process/2-2-Develop/2-2-1-Pre-commit/2-2-1-4-Repository-Hardening.md)
6664
- [2-3-Build](current-version/2-Process/2-3-Build)
67-
- [2-3-1-Dynamic-Application-Security-Testing](current-version/2-Process/2-3-Build/2-3-1-Dynamic-Application-Security-Testing.md)
68-
- [2-3-2-Mobile-Application-Security-Test](current-version/2-Process/2-3-Build/2-3-2-Mobile-Application-Security-Test.md)
69-
- [2-3-3-API-Security](current-version/2-Process/2-3-Build/2-3-3-API-Security.md)
70-
- [2-3-4-Miss-Configuration-Check](current-version/2-Process/2-3-Build/2-3-4-Miss-Configuration-Check.md)
71-
- [2-4-Operation](current-version/2-Process/2-4-Operation)
72-
- [2-4-1-Cloud-Native-Security](current-version/2-Process/2-4-Operation/2-4-1-Cloud-Native-Security.md)
73-
- [2-4-2-Logging-and-Monitoring](current-version/2-Process/2-4-Operation/2-4-2-Logging-and-Monitoring.md)
74-
- [2-4-3-Pentest](current-version/2-Process/2-4-Operation/2-4-3-Pentest.md)
75-
- [2-4-4-Vulnerability-Management](current-version/2-Process/2-4-Operation/2-4-4-Vulnerability-Management.md)
76-
- [2-4-5-VDP|Bug-bounty](current-version/2-Process/2-4-Operation/2-4-5-VDP|Bug-bounty.md)
77-
- [2-4-6-Breach-and-attack-simulation](current-version/2-Process/2-4-Operation/2-4-6-Breach-and-attack-simulation.md)
65+
- [2-3-5-Security-Gates](current-version/2-Process/2-3-Build/2-3-5-Security-Gates.md)
66+
- [2-3-1-Static-Analysis](current-version/2-Process/2-3-Build/2-3-1-Static-Analysis)
67+
- [2-3-1-1-Static-Application-Security-Testing](current-version/2-Process/2-3-Build/2-3-1-Static-Analysis/2-3-1-1-Static-Application-Security-Testing.md)
68+
- [2-3-2-Software Composition Analysis](current-version/2-Process/2-3-Build/2-3-2-Software Composition Analysis)
69+
- [2-3-2-1-Software-Composition-Analysis](current-version/2-Process/2-3-Build/2-3-2-Software Composition Analysis/2-3-2-1-Software-Composition-Analysis.md)
70+
- [2-3-3-Container-Security](current-version/2-Process/2-3-Build/2-3-3-Container-Security)
71+
- [2-3-3-1-Container-Scanning](current-version/2-Process/2-3-Build/2-3-3-Container-Security/2-3-3-1-Container-Scanning.md)
72+
- [2-3-3-2-Container-Hardening](current-version/2-Process/2-3-Build/2-3-3-Container-Security/2-3-3-2-Container-Hardening.md)
73+
- [2-3-4-Infrastructure as Code Security](current-version/2-Process/2-3-Build/2-3-4-Infrastructure as Code Security)
74+
- [2-3-1-3-Infastructure-as-Code-Scanning](current-version/2-Process/2-3-Build/2-3-4-Infrastructure as Code Security/2-3-1-3-Infastructure-as-Code-Scanning.md)
75+
- [2-4-Test](current-version/2-Process/2-4-Test)
76+
- [2-4-1-Interactive-Application-Security-Testing](current-version/2-Process/2-4-Test/2-4-1-Interactive-Application-Security-Testing.md)
77+
- [2-4-2-Dynamic-Application-Security-Testing](current-version/2-Process/2-4-Test/2-4-2-Dynamic-Application-Security-Testing.md)
78+
- [2-4-3-Mobile-Application-Security-Test](current-version/2-Process/2-4-Test/2-4-3-Mobile-Application-Security-Test.md)
79+
- [2-4-4-API-Security](current-version/2-Process/2-4-Test/2-4-4-API-Security.md)
80+
- [2-4-5-Misconfiguration-Check](current-version/2-Process/2-4-Test/2-4-5-Misconfiguration-Check.md)
81+
- [2-5-Release](current-version/2-Process/2-5-Release)
82+
- [2-5-1-Release](current-version/2-Process/2-5-Release/2-5-1-Release.md)
83+
- [2-6-Deploy](current-version/2-Process/2-6-Deploy)
84+
- [2-6-1-Deploy](current-version/2-Process/2-6-Deploy/2-6-1-Deploy.md)
85+
- [2-7-Operate](current-version/2-Process/2-7-Operate)
86+
- [2-7-1-Cloud-Native-Security](current-version/2-Process/2-7-Operate/2-7-1-Cloud-Native-Security.md)
87+
- [2-7-2-Logging-and-Monitoring](current-version/2-Process/2-7-Operate/2-7-2-Logging-and-Monitoring.md)
88+
- [2-7-3-Pentest](current-version/2-Process/2-7-Operate/2-7-3-Pentest.md)
89+
- [2-7-4-Vulnerability-Management](current-version/2-Process/2-7-Operate/2-7-4-Vulnerability-Management.md)
90+
- [2-7-6-Breach-and-attack-simulation](current-version/2-Process/2-7-Operate/2-7-6-Breach-and-attack-simulation.md)
7891
- [3-Governance](current-version/3-Governance)
7992
- [3-2-Data-protection](current-version/3-Governance/3-2-Data-protection.md)
8093
- [3-1-Compliance-Auditing](current-version/3-Governance/3-1-Compliance-Auditing)
@@ -85,6 +98,6 @@ However, when using CI/CD tools to provide automation, keep in mind that the too
8598
- [3-3-1-Tracking-maturities](current-version/3-Governance/3-3-Reporting/3-3-1-Tracking-maturities.md)
8699
- [3-3-2-Central-vulnerability-management-dashboard](current-version/3-Governance/3-3-Reporting/3-3-2-Central-vulnerability-management-dashboard.md)
87100

88-
89101
---
90-
The project page on the OWASP website is [here](https://owasp.org/www-project-devsecops-guideline/)
102+
103+
The project page on the OWASP website is available at [OWASP DevSecOps Guideline Project](https://owasp.org/www-project-devsecops-guideline/)

0 commit comments

Comments
 (0)