Skip to content

Commit

Permalink
Merge branch 'main' into issue_74
Browse files Browse the repository at this point in the history
  • Loading branch information
VedRatan authored Mar 22, 2024
2 parents 026a22d + 8050a0d commit d351dac
Show file tree
Hide file tree
Showing 32 changed files with 3,644 additions and 82 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/pr-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: '1.21'
go-version: '1.22'

- name: go fmt
run: make fmt
Expand Down Expand Up @@ -108,11 +108,6 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install go
uses: actions/setup-go@v5
with:
go-version: '1.21'

- name: Create k8s Kind Cluster
uses: helm/kind-action@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright 2023 Authors of Nimbus

# Build the manager binary
FROM golang:1.21 as builder
FROM golang:1.22 as builder
ARG TARGETOS
ARG TARGETARCH

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ CHAINSAW ?= $(LOCALBIN)/chainsaw

## Tool Versions
KUSTOMIZE_VERSION ?= v5.2.1
CONTROLLER_TOOLS_VERSION ?= v0.13.0
CONTROLLER_TOOLS_VERSION ?= v0.14.0

.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. If wrong version is installed, it will be removed before downloading.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.13.0
controller-gen.kubebuilder.io/version: v0.14.0
name: clusternimbuspolicies.intent.security.nimbus.com
spec:
group: intent.security.nimbus.com
Expand Down Expand Up @@ -33,14 +33,19 @@ spec:
API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.13.0
controller-gen.kubebuilder.io/version: v0.14.0
name: clustersecurityintentbindings.intent.security.nimbus.com
spec:
group: intent.security.nimbus.com
Expand Down Expand Up @@ -36,14 +36,19 @@ spec:
API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
Expand Down
19 changes: 12 additions & 7 deletions config/crd/bases/intent.security.nimbus.com_nimbuspolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.13.0
controller-gen.kubebuilder.io/version: v0.14.0
name: nimbuspolicies.intent.security.nimbus.com
spec:
group: intent.security.nimbus.com
Expand Down Expand Up @@ -32,14 +32,19 @@ spec:
description: NimbusPolicy is the Schema for the nimbuspolicies API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.13.0
controller-gen.kubebuilder.io/version: v0.14.0
name: securityintentbindings.intent.security.nimbus.com
spec:
group: intent.security.nimbus.com
Expand Down Expand Up @@ -36,14 +36,19 @@ spec:
API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
Expand Down
35 changes: 21 additions & 14 deletions config/crd/bases/intent.security.nimbus.com_securityintents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.13.0
controller-gen.kubebuilder.io/version: v0.14.0
name: securityintents.intent.security.nimbus.com
spec:
group: intent.security.nimbus.com
Expand Down Expand Up @@ -37,14 +37,19 @@ spec:
description: SecurityIntent is the Schema for the securityintents API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
Expand All @@ -62,8 +67,9 @@ spec:
intent's purpose.
type: string
id:
description: ID is predefined in adapter ID pool. Used by security
engines to generate corresponding security policies.
description: |-
ID is predefined in adapter ID pool.
Used by security engines to generate corresponding security policies.
pattern: ^[a-zA-Z0-9]*$
type: string
params:
Expand All @@ -76,13 +82,14 @@ spec:
type: object
severity:
default: Low
description: Severity defines the potential impact of a security
violation related to the intent. Defaults to Low.
description: |-
Severity defines the potential impact of a security violation related to the intent.
Defaults to Low.
type: string
tags:
description: Tags are additional metadata for categorization and
grouping of intents. Facilitates searching, filtering, and management
of security policies.
description: |-
Tags are additional metadata for categorization and grouping of intents.
Facilitates searching, filtering, and management of security policies.
items:
type: string
type: array
Expand Down
32 changes: 32 additions & 0 deletions examples/clusterscoped/escape-to-host-si-sib.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: intent.security.nimbus.com/v1
kind: SecurityIntent
metadata:
name: escape-to-host
spec:
intent:
id: escapeToHost
description: "A attacker can breach container boundaries and can gain access to the host machine"
action: Block
---
apiVersion: intent.security.nimbus.com/v1
kind: ClusterSecurityIntentBinding
metadata:
name: escape-to-host-binding
spec:
intents:
- name: escape-to-host
selector:
resources:
- kind: Pod
name: pod1
namespace: ns1
matchLabels:
app: db
env: dev

- kind: Pod
name: pod1
namespace: ns2
matchLabels:
app: mongo
env: prod
2 changes: 1 addition & 1 deletion examples/namespaced/escape-to-host-si-sib.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ spec:
kind: Pod
namespace: default
matchLabels:
app: nginx
app: nginx
12 changes: 7 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/5GSEC/nimbus

go 1.21
go 1.22

require (
github.com/go-logr/logr v1.4.1
Expand All @@ -12,15 +12,17 @@ require (
require (
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
github.com/evanphx/json-patch v5.7.0+incompatible // indirect
github.com/stoewer/go-strcase v1.2.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
github.com/google/pprof v0.0.0-20231023181126-ff6d637d2a7b // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/stoewer/go-strcase v1.3.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.11.2 // indirect
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
Expand Down
Loading

0 comments on commit d351dac

Please sign in to comment.