mirror of
https://github.com/kubescape/kubescape.git
synced 2026-02-26 15:53:52 +00:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ceb5150e2 | ||
|
|
aad32ec965 | ||
|
|
d3137af3d7 | ||
|
|
2568241ef8 | ||
|
|
3c6b2db919 | ||
|
|
f60ff1fb26 | ||
|
|
679238ec13 | ||
|
|
94884ac3d7 | ||
|
|
0ef8f20c50 | ||
|
|
82f3d62de5 | ||
|
|
46f1e6a83b | ||
|
|
77a9956d91 | ||
|
|
a1e639453d |
11
.github/workflows/build.yaml
vendored
11
.github/workflows/build.yaml
vendored
@@ -52,14 +52,3 @@ jobs:
|
||||
asset_path: build/${{ matrix.os }}/kubescape
|
||||
asset_name: kubescape-${{ matrix.os }}
|
||||
asset_content_type: application/octet-stream
|
||||
|
||||
# - name: Upload Release md5 digest
|
||||
# id: upload-release-asset
|
||||
# uses: actions/upload-release-asset@v1
|
||||
# env:
|
||||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# with:
|
||||
# upload_url: ${{ needs.once.outputs.upload_url }}
|
||||
# asset_path: build/${{ matrix.os }}/kubescape.md5
|
||||
# asset_name: kubescape-${{ matrix.os }}
|
||||
# asset_content_type: application/octet-stream
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,4 +1,5 @@
|
||||
*.vs*
|
||||
*go.sum*
|
||||
*kubescape*
|
||||
*debug*
|
||||
*debug*
|
||||
.idea
|
||||
12
README.md
12
README.md
@@ -125,6 +125,18 @@ go mod tidy && go build -o kubescape .
|
||||
|
||||
4. Enjoy :zany_face:
|
||||
|
||||
# How to build in Docker
|
||||
|
||||
1. Clone Project
|
||||
```
|
||||
git clone git@github.com:armosec/kubescape.git kubescape && cd "$_"
|
||||
```
|
||||
|
||||
2. Build
|
||||
```
|
||||
docker build -t kubescape -f build/Dockerfile .
|
||||
```
|
||||
|
||||
# Under the hood
|
||||
|
||||
## Tests
|
||||
|
||||
13
build/Dockerfile
Normal file
13
build/Dockerfile
Normal file
@@ -0,0 +1,13 @@
|
||||
FROM golang:1.16-alpine as builder
|
||||
ENV GOPROXY=https://goproxy.io,direct
|
||||
ENV GO111MODULE=on
|
||||
|
||||
WORKDIR /work
|
||||
ADD . .
|
||||
RUN go mod tidy
|
||||
RUN GOOS=linux CGO_ENABLED=0 go build -ldflags="-s -w " -installsuffix cgo -o kubescape .
|
||||
|
||||
FROM alpine
|
||||
COPY --from=builder /work/kubescape /usr/bin/kubescape
|
||||
|
||||
CMD ["kubescape"]
|
||||
@@ -41,6 +41,7 @@ type FrameworkReport struct {
|
||||
}
|
||||
type ControlReport struct {
|
||||
armotypes.PortalBase `json:",inline"`
|
||||
ControlID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
RuleReports []RuleReport `json:"ruleReports"`
|
||||
Remediation string `json:"remediation"`
|
||||
@@ -100,10 +101,12 @@ type PolicyRule struct {
|
||||
// Control represents a collection of rules which are combined together to single purpose
|
||||
type Control struct {
|
||||
armotypes.PortalBase `json:",inline"`
|
||||
CreationTime string `json:"creationTime"`
|
||||
Description string `json:"description"`
|
||||
Remediation string `json:"remediation"`
|
||||
Rules []PolicyRule `json:"rules"`
|
||||
ControlID string `json:"id"`
|
||||
|
||||
CreationTime string `json:"creationTime"`
|
||||
Description string `json:"description"`
|
||||
Remediation string `json:"remediation"`
|
||||
Rules []PolicyRule `json:"rules"`
|
||||
// for new list of rules in POST/UPADTE requests
|
||||
RulesIDs *[]string `json:"rulesIDs,omitempty"`
|
||||
}
|
||||
|
||||
@@ -33,7 +33,8 @@ func MockFrameworkReportA() *FrameworkReport {
|
||||
Name: AMockFrameworkName,
|
||||
ControlReports: []ControlReport{
|
||||
{
|
||||
Name: AMockControlName,
|
||||
ControlID: "testctrl",
|
||||
Name: AMockControlName,
|
||||
RuleReports: []RuleReport{
|
||||
{
|
||||
Name: AMockRuleName,
|
||||
|
||||
@@ -22,7 +22,7 @@ var downloadCmd = &cobra.Command{
|
||||
},
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
downloadInfo.FrameworkName = args[1]
|
||||
g := getter.NewArmoAPI()
|
||||
g := getter.NewDownloadReleasedPolicy()
|
||||
if downloadInfo.Path == "" {
|
||||
downloadInfo.Path = getter.GetDefaultPath(downloadInfo.FrameworkName)
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ func (opaHandler *OPAProcessorHandler) ProcessRulesListenner() {
|
||||
opap.updateResults()
|
||||
|
||||
// update score
|
||||
opap.updateScore()
|
||||
// opap.updateScore()
|
||||
|
||||
// report
|
||||
*opaHandler.reportResults <- opaSessionObj
|
||||
@@ -121,6 +121,7 @@ func (opap *OPAProcessor) processControl(control *opapolicy.Control) (*opapolicy
|
||||
|
||||
controlReport := opapolicy.ControlReport{}
|
||||
controlReport.PortalBase = control.PortalBase
|
||||
controlReport.ControlID = control.ControlID
|
||||
|
||||
controlReport.Name = control.Name
|
||||
controlReport.Description = control.Description
|
||||
|
||||
Reference in New Issue
Block a user