Skip to content

testing #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
2816cd6
testing
jon-nfc Jun 1, 2025
0507a73
jghjgh
jon-nfc Jun 1, 2025
68ee3f0
kl
jon-nfc Jun 1, 2025
3785ba9
ci update
jon-nfc Jun 1, 2025
d397cf5
dsfds
jon-nfc Jun 1, 2025
55c2295
errs
jon-nfc Jun 1, 2025
adc0800
kubescape
jon-nfc Jun 1, 2025
a729fa4
v3 codeql
jon-nfc Jun 1, 2025
d4ca828
changed files fix
jon-nfc Jun 1, 2025
e33e446
changed files fix again
jon-nfc Jun 1, 2025
9c48180
seperate ci
jon-nfc Jun 1, 2025
2f2b54f
seperate ci
jon-nfc Jun 1, 2025
78f843e
ghgf
jon-nfc Jun 1, 2025
af3c255
gfh
jon-nfc Jun 1, 2025
eefa28f
fdgfdgd
jon-nfc Jun 1, 2025
41d0dc7
gfhfgh
jon-nfc Jun 1, 2025
143c9e2
hjgh
jon-nfc Jun 1, 2025
155615d
jklj
jon-nfc Jun 1, 2025
d88098f
fdgdfgdf
jon-nfc Jun 1, 2025
d0cb620
fgdfdf
jon-nfc Jun 1, 2025
587fe9c
dfgfd
jon-nfc Jun 1, 2025
4223bae
dfgfd
jon-nfc Jun 1, 2025
8ea98cd
pr write
jon-nfc Jun 1, 2025
eb23d4f
pr write
jon-nfc Jun 1, 2025
8b51d0e
hgjgj
jon-nfc Jun 1, 2025
0779c54
ghgfh
jon-nfc Jun 1, 2025
b63a6ea
files
jon-nfc Jun 1, 2025
6eaa212
hfghfg
jon-nfc Jun 1, 2025
06d4ad2
hgjgh
jon-nfc Jun 1, 2025
3bf61e8
ghgfh
jon-nfc Jun 1, 2025
758bf4e
verbose framework
jon-nfc Jun 1, 2025
f7336c7
dfgdfg
jon-nfc Jun 1, 2025
bf8b0cf
at np test
jon-nfc Jun 1, 2025
06a5952
test customize
jon-nfc Jun 1, 2025
1f51f61
fgdf
jon-nfc Jun 1, 2025
ebd0a21
all controls
jon-nfc Jun 1, 2025
516cb4a
nginx test
jon-nfc Jun 10, 2025
ff285b9
test with full path
jon-nfc Jun 10, 2025
3609f0a
base scan
jon-nfc Jun 10, 2025
d81f06f
app scan
jon-nfc Jun 10, 2025
78977d9
app scan
jon-nfc Jun 10, 2025
420780f
hlp cmd
jon-nfc Jun 10, 2025
e7f3201
hlp cmd
jon-nfc Jun 10, 2025
163e7cb
star
jon-nfc Jun 10, 2025
d5255b7
use correct path
jon-nfc Jun 10, 2025
97d2600
fukll path app
jon-nfc Jun 10, 2025
a312272
cd app dir scan dot
jon-nfc Jun 10, 2025
391391e
scan dot
jon-nfc Jun 10, 2025
1f5ae83
overlay scan
jon-nfc Jun 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
# on: push # yamllint disable-line rule:truthy
name: CI


on:
push:
branches:
- "**"
tags:
- "*"

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install yamllint
run: pip install yamllint

- name: Lint YAML files
run: yamllint ${PWD}/


# kubescape:

Check failure on line 26 in .github/workflows/ci.yaml

View workflow job for this annotation

GitHub Actions / lint

26:3 [comments-indentation] comment not indented like content
# runs-on: ubuntu-latest
# permissions:
# actions: read
# contents: read
# security-events: write
# steps:
# - uses: actions/checkout@v3
# - uses: kubescape/github-action@main
# continue-on-error: true
# with:
# format: sarif
# outputFile: results
# # # Optional: Specify the Kubescape Portal credentials
# # account: ${{secrets.KUBESCAPE_ACCOUNT}}
# # accessKey: ${{secrets.KUBESCAPE_ACCESS_KEY}}
# # server: ${{ vars.KUBESCAPE_SERVER }}
# # # Optional: Scan a specific path. Default will scan the whole repository
# # files: "examples/*.yaml"
# - name: Upload Kubescape scan results to Github Code Scanning
# uses: github/codeql-action/upload-sarif@v3
# with:
# sarif_file: results.sarif


# kubescape-fix-pr-reviews:
# runs-on: ubuntu-latest
# permissions:
# pull-requests: write

# steps:
# - uses: actions/checkout@v3
# with:
# fetch-depth: 0
# ref: ${{github.event.pull_request.head.ref}}
# repository: ${{github.event.pull_request.head.repo.full_name}}

# - name: Get changed files
# id: changed-files
# uses: tj-actions/changed-files@v46.0.1

# - uses: kubescape/github-action@main
# with:
# # account: ${{secrets.KUBESCAPE_ACCOUNT}}
# # accessKey: ${{secrets.KUBESCAPE_ACCESS_KEY}}
# # server: ${{ vars.KUBESCAPE_SERVER }}
# # files: ${{ steps.changed-files.outputs.all_changed_files }}
# fixFiles: true
# format: "sarif"

# - name: PR Suggester according to SARIF file
# if: github.event_name == 'pull_request_target'
# uses: HollowMan6/sarif4reviewdog@v1.0.0
# with:
# file: 'results.sarif'
# level: warning
47 changes: 47 additions & 0 deletions .github/workflows/kubescape-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# ---
# # on: push # yamllint disable-line rule:truthy
# name: Suggest autofixes with Kubescape for PR by reviews
# on:
# - pull_request_target
# - pull_request


# jobs:

# kubescape-fix-pr-reviews:
# runs-on: ubuntu-latest
# permissions:
# pull-requests: write

# steps:
# - uses: actions/checkout@v3
# with:
# fetch-depth: 0
# ref: ${{github.event.pull_request.head.ref}}
# repository: ${{github.event.pull_request.head.repo.full_name}}

# - name: Get changed files
# id: changed-files
# uses: tj-actions/changed-files@v46.0.1

# - uses: kubescape/github-action@main
# with:
# outputFile: results
# # account: ${{secrets.KUBESCAPE_ACCOUNT}}
# # accessKey: ${{secrets.KUBESCAPE_ACCESS_KEY}}
# # server: ${{ vars.KUBESCAPE_SERVER }}
# # files: ${{ steps.changed-files.outputs.all_changed_files }}
# fixFiles: true
# format: "sarif"

# - name: Upload Kubescape scan results to Github Code Scanning
# uses: github/codeql-action/upload-sarif@v3
# with:
# sarif_file: results.sarif

# - name: PR Suggester according to SARIF file
# # if: github.event_name == 'pull_request_target'
# uses: HollowMan6/sarif4reviewdog@v1.0.0
# with:
# file: 'results.sarif'
# level: warning
96 changes: 96 additions & 0 deletions .github/workflows/kubescape.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
---
# name: Kubescape scanning for misconfigurations
# on: [ pull_request ]
# jobs:
# kubescape:
# runs-on: ubuntu-latest
# permissions:
# actions: read
# contents: read
# security-events: write
# steps:
# - uses: actions/checkout@v3
# - uses: kubescape/github-action@main
# continue-on-error: false
# with:
# frameworks: NSA,MITRE
# verbose: true
# severityThreshold: low
# on: push # yamllint disable-line rule:truthy
name: Kubescape scanning for misconfigurations
on:
- pull_request
# - push

jobs:

kubescape:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
pull-requests: write
steps:
- uses: actions/checkout@v3
# - uses: kubescape/github-action@main
# continue-on-error: true
# with:
# format: sarif
# outputFile: results
# # # Optional: Specify the Kubescape Portal credentials
# # account: ${{secrets.KUBESCAPE_ACCOUNT}}
# # accessKey: ${{secrets.KUBESCAPE_ACCESS_KEY}}
# # server: ${{ vars.KUBESCAPE_SERVER }}
# # # Optional: Scan a specific path. Default will scan the whole repository
# files: "${PWD}/manifests/*.yaml"
# frameworks: NSA,MITRE
# verbose: true
# severityThreshold: low

- name: Install Kubescape
run: |
KUBESCAPE_DIR="$HOME/kubescape-bin"
mkdir -p "$KUBESCAPE_DIR"
LATEST_VERSION=$(curl -s https://api.github.com/repos/kubescape/kubescape/releases/latest | jq -r .tag_name)

Check warning on line 55 in .github/workflows/kubescape.yaml

View workflow job for this annotation

GitHub Actions / lint

55:101 [line-length] line too long (118 > 100 characters)
curl -sL "https://github.com/kubescape/kubescape/releases/download/${LATEST_VERSION}/kubescape-ubuntu-latest" -o "$KUBESCAPE_DIR/kubescape"

Check warning on line 56 in .github/workflows/kubescape.yaml

View workflow job for this annotation

GitHub Actions / lint

56:101 [line-length] line too long (149 > 100 characters)
chmod +x "$KUBESCAPE_DIR/kubescape"
echo "$KUBESCAPE_DIR" >> $GITHUB_PATH

- name: Run Kubescape debug
run: |
kubescape scan --help

- name: Run Kubescape scan
run: |
kubescape scan framework AllControls ${PWD}/manifests/nginx/overlays/static-site-gitlab-built/ \

Check warning on line 66 in .github/workflows/kubescape.yaml

View workflow job for this annotation

GitHub Actions / lint

66:101 [line-length] line too long (106 > 100 characters)
--verbose \

Check failure on line 67 in .github/workflows/kubescape.yaml

View workflow job for this annotation

GitHub Actions / lint

67:13 [indentation] wrong indentation: expected 10but found 12
--format sarif \

Check failure on line 68 in .github/workflows/kubescape.yaml

View workflow job for this annotation

GitHub Actions / lint

68:13 [indentation] wrong indentation: expected 10but found 12
--output results.sarif

Check failure on line 69 in .github/workflows/kubescape.yaml

View workflow job for this annotation

GitHub Actions / lint

69:13 [indentation] wrong indentation: expected 10but found 12

- name: Debug SARIF Contents
run: |
if [ -f results.sarif ]; then
cat results.sarif

Check failure on line 74 in .github/workflows/kubescape.yaml

View workflow job for this annotation

GitHub Actions / lint

74:13 [indentation] wrong indentation: expected 10but found 12
else
echo "No SARIF file generated"

Check failure on line 76 in .github/workflows/kubescape.yaml

View workflow job for this annotation

GitHub Actions / lint

76:13 [indentation] wrong indentation: expected 10but found 12
fi

- name: Upload Kubescape scan results to Github Code Scanning
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif

- name: Upload scan results (json Report)
uses: actions/upload-artifact@v4
with:
name: results.sarif
path: results.sarif

- name: PR Suggester according to SARIF file
# if: github.event_name == 'pull_request_target'
uses: HollowMan6/sarif4reviewdog@v1.0.0
with:
file: 'results.sarif'
level: warning
filter_mode: nofilter
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"fnando.linter"
]
}
35 changes: 35 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"linter.linters": {
"yamllint": {
"capabilities": [
"ignore-line"
],
"command": [
"yamllint",
"--format",
"parsable",
[
"$config",
"--config-file",
"$config"
],
"-"
],
"configFiles": [
".yamllint.yml",
".yamllint.yaml",
".yamllint"
],
"enabled": true,
"languages": [
"yaml"
],
"name": "yamllint",
"url": "https://github.com/adrienverge/yamllint"
}
},
"editor.detectIndentation": false,
"editor.indentSize": "tabSize",
"editor.tabSize": 2,
"files.eol": "\n"
}
69 changes: 69 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---

# extends: default

rules:
braces:
level: error
max-spaces-inside: 1
min-spaces-inside: 1
min-spaces-inside-empty: 0
max-spaces-inside-empty: 0

brackets:
level: error
max-spaces-inside: 1
min-spaces-inside: 1
min-spaces-inside-empty: 0
max-spaces-inside-empty: 0

colons:
level: warning
max-spaces-after: 1

commas:
level: warning

comments:
level: error
require-starting-space: true
ignore-shebangs: true
min-spaces-from-content: 4

comments-indentation:
level: error

document-end:
level: error
present: false

document-start:
level: error
present: true

empty-lines:
level: error
max: 2
max-start: 0
max-end: 0

hyphens:
level: error
max-spaces-after: 1

indentation:
level: error
spaces: 2
indent-sequences: true
check-multi-line-strings: true

line-length:
level: warning
max: 100
allow-non-breakable-inline-mappings: true

new-lines:
level: error
type: unix

truthy: disable
38 changes: 38 additions & 0 deletions manifests/centurion/base/CiliumNetworkPolicy-centurion-api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: centurion-api
spec:
endpointSelector:
matchLabels:
name: centurion
component: api
ingress:
- fromEndpoints:
- matchLabels:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/component: controller
io.kubernetes.pod.namespace: ingress
toPorts:
- ports:
- port: "80"
egress:
- toEndpoints:
- matchLabels:
io.kubernetes.pod.namespace: kube-system
k8s-app: kube-dns
toPorts:
- ports:
- port: "53"
protocol: UDP
rules:
dns:
- matchPattern: "*"
- toServices:
- k8sService:
serviceName: main-rw
namespace: postgres
- toServices:
- k8sService:
serviceName: main
namespace: rabbitmq
Loading
Loading