Skip to content

Commit db4cb65

Browse files
authored
ci(secu): update analyses (#18)
1 parent aafba29 commit db4cb65

File tree

9 files changed

+165
-0
lines changed

9 files changed

+165
-0
lines changed

.githooks/pre-commit

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env sh
2+
set -eu
3+
4+
# ensure gitleaks is available
5+
if ! command -v gitleaks >/dev/null 2>&1; then
6+
echo "Error: gitleaks is not installed or not in PATH." >&2
7+
echo "Install: https://github.com/gitleaks/gitleaks#install" >&2
8+
exit 1
9+
fi
10+
11+
# scan for secrets before commit
12+
gitleaks detect --no-git --verbose

.github/CODEOWNERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
* @centreon/owners-react @centreon/owners-php
2+
3+
.github/** @centreon/owners-pipelines
4+
5+
.gitleaks.toml @centreon/owners-security
6+
.gitleaksignore @centreon/owners-security
7+
**/secu-*.yml @centreon/owners-security

.github/dependabot.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: '/'
5+
schedule:
6+
interval: monthly
7+
open-pull-requests-limit: 50
8+
labels:
9+
- 'dependencies'
10+
- 'gha'
11+
12+
- package-ecosystem: npm
13+
directory: '/'
14+
schedule:
15+
interval: daily
16+
open-pull-requests-limit: 0
17+
labels:
18+
- 'dependencies'
19+
- 'javascript'
20+
allow:
21+
- dependency-type: "direct"
22+
- dependency-type: "production"
23+
ignore:
24+
- dependency-name: '*'
25+
26+
- package-ecosystem: composer
27+
directory: '/'
28+
schedule:
29+
interval: daily
30+
open-pull-requests-limit: 0
31+
labels:
32+
- 'dependencies'
33+
- 'php'
34+
allow:
35+
- dependency-type: "direct"
36+
- dependency-type: "production"
37+
ignore:
38+
- dependency-name: '*'

.github/workflows/actionlint.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: actionlint
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
5+
cancel-in-progress: true
6+
7+
on:
8+
workflow_dispatch:
9+
pull_request:
10+
branches:
11+
- master
12+
- main
13+
- develop
14+
paths:
15+
- ".github/**"
16+
17+
jobs:
18+
action-lint:
19+
runs-on: ubuntu-24.04
20+
steps:
21+
- name: Checkout sources
22+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
23+
24+
- name: Ensure SHA pinned actions
25+
uses: centreon/github-actions-ensure-sha-pinned-actions@47d553c67ceb08ad660deaeb3b994e47a3dd8fc3 # v3.0.23.3
26+
with:
27+
allowlist: |
28+
centreon/security-tools
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: code-scan
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
5+
cancel-in-progress: true
6+
7+
on:
8+
pull_request:
9+
branches:
10+
- master
11+
- main
12+
- develop
13+
push:
14+
branches:
15+
- master
16+
- main
17+
- develop
18+
workflow_dispatch:
19+
schedule:
20+
- cron: 0 1 * * 1-5
21+
22+
jobs:
23+
24+
code-scan:
25+
uses: centreon/security-tools/.github/workflows/checkmarx-analysis.yml@main
26+
with:
27+
module_directory:
28+
module_name: centreon-dummy
29+
exclude_list:
30+
secrets:
31+
base_uri: ${{ secrets.AST_RND_SCANS_BASE_URI }}
32+
cx_tenant: ${{ secrets.AST_RND_SCANS_TENANT }}
33+
cx_client_id: ${{ secrets.AST_RND_SCANS_CLIENT_ID }}
34+
cx_client_secret: ${{ secrets.AST_RND_SCANS_CLIENT_SECRET }}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: dependency-scan
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
5+
6+
on:
7+
pull_request:
8+
workflow_dispatch:
9+
10+
jobs:
11+
dependency-scan:
12+
uses: centreon/security-tools/.github/workflows/dependency-analysis.yml@main
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: secrets-scan
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
5+
6+
on:
7+
pull_request:
8+
workflow_dispatch:
9+
10+
jobs:
11+
secrets-scan:
12+
uses: centreon/security-tools/.github/workflows/gitleaks-analysis.yml@main

.gitleaks.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
title = "Gitleaks custom rules"
2+
3+
[extend]
4+
useDefault = true
5+
6+
[allowlist]
7+
paths = [
8+
'''node_modules\/''',
9+
'''vendor\/''',
10+
'''(.*?)\.rptlibrary''',
11+
'''package\.json''',
12+
'''package-lock\.json''',
13+
'''composer\.json''',
14+
'''composer\.lock''',
15+
'''\.gitleaks\.toml$''',
16+
'''(.*?)(jpg|gif|doc|pdf|bin)$'''
17+
]
18+
19+
regexTarget = "match"
20+
regexes = [
21+
'''ABCDEFG1234567890'''
22+
]

.gitleaksignore

Whitespace-only changes.

0 commit comments

Comments
 (0)