Skip to content

Commit 1fb22c5

Browse files
committed
ci: align go toolchain and opa policies
1 parent 88a1afc commit 1fb22c5

File tree

5 files changed

+13
-20
lines changed

5 files changed

+13
-20
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches: [ main ]
88

99
env:
10-
GO_VERSION: '1.22'
10+
GO_VERSION: '1.24'
1111
PYTHON_VERSION: '3.12'
1212

1313
jobs:

policies/keep.rego

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,36 @@ package keep
22

33
default decision := "deny"
44

5-
# High trust score - allow access
6-
decision := "allow" {
5+
decision := "allow" if {
76
valid_user
87
input.device.trust_score >= 80
98
}
109

11-
# Medium trust score - require step-up authentication
12-
decision := "step-up" {
10+
decision := "step-up" if {
1311
valid_user
1412
input.device.trust_score >= 50
1513
input.device.trust_score < 80
1614
}
1715

18-
# Low trust score - deny access
19-
decision := "deny" {
16+
decision := "deny" if {
2017
input.device.trust_score < 50
2118
}
2219

23-
# Special case: unknown or unregistered devices
24-
decision := "deny" {
20+
decision := "deny" if {
2521
valid_user
2622
input.device.posture == "unknown"
2723
}
2824

29-
decision := "deny" {
25+
decision := "deny" if {
3026
valid_user
3127
input.device.posture == "unregistered"
3228
}
3329

34-
# Backward compatibility
35-
allow {
30+
allow if {
3631
decision == "allow"
3732
}
3833

39-
valid_user {
34+
valid_user if {
4035
input.user.email != ""
4136
input.user.email != null
4237
}

policies/test/allow_test.rego

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

3-
import future.keywords
4-
5-
test_allow_healthy_device {
3+
test_allow_healthy_device if {
64
input := {
75
"user": {"email": "alice@example.com"},
86
"device": {"posture": "healthy"},
@@ -12,7 +10,7 @@ test_allow_healthy_device {
1210
result == "allow"
1311
}
1412

15-
test_step_up_quarantined {
13+
test_step_up_quarantined if {
1614
input := {
1715
"user": {"email": "alice@example.com"},
1816
"device": {"posture": "quarantined"},
@@ -21,7 +19,7 @@ test_step_up_quarantined {
2119
result == "step-up"
2220
}
2321

24-
test_deny_missing_user {
22+
test_deny_missing_user if {
2523
input := {
2624
"user": {"email": ""},
2725
"device": {"posture": "healthy"},

services/authz/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.22 AS build
1+
FROM golang:1.24 AS build
22

33
WORKDIR /src
44
COPY go.mod go.sum ./

services/inventory/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.22 AS build
1+
FROM golang:1.24 AS build
22

33
WORKDIR /src
44
COPY go.mod go.sum ./

0 commit comments

Comments
 (0)