Skip to content

Commit 7beaff5

Browse files
committed
ci: fix gosec action and opa syntax
1 parent 1fb22c5 commit 7beaff5

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,11 @@ jobs:
135135
with:
136136
go-version: ${{ env.GO_VERSION }}
137137

138+
- name: Install gosec
139+
run: go install github.com/securego/gosec/v2/cmd/gosec@latest
140+
138141
- name: Run gosec security scanner
139-
uses: securecodewarrior/github-action-gosec@master
140-
with:
141-
args: '-fmt sarif -out gosec.sarif ./...'
142+
run: gosec -fmt sarif -out gosec.sarif ./...
142143

143144
- name: Upload gosec results
144145
uses: github/codeql-action/upload-sarif@v3

policies/keep.rego

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package keep
22

3+
import future.keywords.if
4+
35
default decision := "deny"
46

57
decision := "allow" if {
@@ -27,9 +29,7 @@ decision := "deny" if {
2729
input.device.posture == "unregistered"
2830
}
2931

30-
allow if {
31-
decision == "allow"
32-
}
32+
allow if decision == "allow"
3333

3434
valid_user if {
3535
input.user.email != ""

policies/test/allow_test.rego

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package keep_test
22

3+
import future.keywords.if
4+
35
test_allow_healthy_device if {
46
input := {
57
"user": {"email": "alice@example.com"},

0 commit comments

Comments
 (0)