Skip to content

Commit 06afc60

Browse files
yroblataskbot
andauthored
fix: remove allow_transport from network permissions (#1048)
Co-authored-by: taskbot <[email protected]>
1 parent da6bbab commit 06afc60

File tree

12 files changed

+3
-132
lines changed

12 files changed

+3
-132
lines changed

cmd/thv-operator/api/v1alpha1/mcpserver_types.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,6 @@ type OutboundNetworkPermissions struct {
252252
// +optional
253253
InsecureAllowAll bool `json:"insecureAllowAll,omitempty"`
254254

255-
// AllowTransport is a list of transport protocols to allow (e.g., "tcp", "udp")
256-
// +optional
257-
AllowTransport []string `json:"allowTransport,omitempty"`
258-
259255
// AllowHost is a list of hosts to allow connections to
260256
// +optional
261257
AllowHost []string `json:"allowHost,omitempty"`

cmd/thv-operator/api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 1 addition & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/thv/app/registry.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,6 @@ func printTextServerInfo(name string, server *registry.ImageMetadata) {
243243
fmt.Println(" Insecure Allow All: true")
244244
}
245245

246-
if len(outbound.AllowTransport) > 0 {
247-
fmt.Printf(" Allow Transport: %s\n", strings.Join(outbound.AllowTransport, ", "))
248-
}
249-
250246
if len(outbound.AllowHost) > 0 {
251247
fmt.Printf(" Allow Host: %s\n", strings.Join(outbound.AllowHost, ", "))
252248
}

docs/operator/crd-api.md

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/registry/schema.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -254,16 +254,6 @@
254254
"uniqueItems": true,
255255
"default": []
256256
},
257-
"allow_transport": {
258-
"type": "array",
259-
"description": "Allowed transport protocols for outbound connections",
260-
"items": {
261-
"type": "string",
262-
"enum": ["tcp", "udp"]
263-
},
264-
"uniqueItems": true,
265-
"default": []
266-
},
267257
"insecure_allow_all": {
268258
"type": "boolean",
269259
"description": "Whether to allow all outbound connections (insecure, use with caution)",

docs/server/docs.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/server/swagger.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/server/swagger.yaml

Lines changed: 0 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/container/docker/squid.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -223,16 +223,6 @@ func writeOutboundACLs(sb *strings.Builder, outbound *permissions.OutboundNetwor
223223
}
224224
sb.WriteString("\n")
225225
}
226-
227-
if len(outbound.AllowTransport) > 0 {
228-
sb.WriteString("# Define allowed methods\nacl allowed_methods method")
229-
for _, method := range outbound.AllowTransport {
230-
if strings.ToUpper(method) == "TCP" {
231-
sb.WriteString(" CONNECT GET POST HEAD")
232-
}
233-
sb.WriteString(" " + strings.ToUpper(method))
234-
}
235-
}
236226
}
237227

238228
func writeHttpAccessRules(sb *strings.Builder, outbound *permissions.OutboundNetworkPermissions) {
@@ -243,9 +233,6 @@ func writeHttpAccessRules(sb *strings.Builder, outbound *permissions.OutboundNet
243233
if len(outbound.AllowHost) > 0 {
244234
conditions = append(conditions, "allowed_dsts")
245235
}
246-
if len(outbound.AllowTransport) > 0 {
247-
conditions = append(conditions, "allowed_methods")
248-
}
249236
if len(conditions) > 0 {
250237
sb.WriteString("\n# Define http_access rules\n")
251238
sb.WriteString("http_access allow " + strings.Join(conditions, " ") + "\n")

pkg/permissions/profile.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ type OutboundNetworkPermissions struct {
5050
// InsecureAllowAll allows all outbound network connections
5151
InsecureAllowAll bool `json:"insecure_allow_all,omitempty"`
5252

53-
// AllowTransport is a list of allowed transport protocols (tcp, udp)
54-
AllowTransport []string `json:"allow_transport,omitempty"`
55-
5653
// AllowHost is a list of allowed hosts
5754
AllowHost []string `json:"allow_host,omitempty"`
5855

@@ -69,7 +66,6 @@ func NewProfile() *Profile {
6966
Network: &NetworkPermissions{
7067
Outbound: &OutboundNetworkPermissions{
7168
InsecureAllowAll: false,
72-
AllowTransport: []string{},
7369
AllowHost: []string{},
7470
AllowPort: []int{},
7571
},
@@ -104,7 +100,6 @@ func BuiltinNoneProfile() *Profile {
104100
Network: &NetworkPermissions{
105101
Outbound: &OutboundNetworkPermissions{
106102
InsecureAllowAll: false,
107-
AllowTransport: []string{},
108103
AllowHost: []string{},
109104
AllowPort: []int{},
110105
},
@@ -121,7 +116,6 @@ func BuiltinNetworkProfile() *Profile {
121116
Network: &NetworkPermissions{
122117
Outbound: &OutboundNetworkPermissions{
123118
InsecureAllowAll: true,
124-
AllowTransport: []string{},
125119
AllowHost: []string{},
126120
AllowPort: []int{},
127121
},

0 commit comments

Comments
 (0)