MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / write_graphql_policy

Function write_graphql_policy

e2e/rust/tests/forward_proxy_graphql_l7.rs:62–129  ·  view source on GitHub ↗
(host: &str, port: u16)

Source from the content-addressed store, hash-verified

60}
61
62fn write_graphql_policy(host: &str, port: u16) -> Result<NamedTempFile, String> {
63 let mut file = NamedTempFile::new().map_err(|e| format!("create temp policy file: {e}"))?;
64 let policy = format!(
65 r#"version: 1
66
67filesystem_policy:
68 include_workdir: true
69 read_only:
70 - /usr
71 - /lib
72 - /proc
73 - /dev/urandom
74 - /app
75 - /etc
76 - /var/log
77 read_write:
78 - /sandbox
79 - /tmp
80 - /dev/null
81
82landlock:
83 compatibility: best_effort
84
85process:
86 run_as_user: sandbox
87 run_as_group: sandbox
88
89network_policies:
90 test_graphql_l7:
91 name: test_graphql_l7
92 endpoints:
93 - host: {host}
94 port: {port}
95 protocol: graphql
96 enforcement: enforce
97 persisted_queries: allow_registered
98 graphql_persisted_queries:
99 abc123:
100 operation_type: query
101 operation_name: Viewer
102 fields: [viewer]
103 allowed_ips:
104 - "10.0.0.0/8"
105 - "172.0.0.0/8"
106 - "192.168.0.0/16"
107 - "fc00::/7"
108 rules:
109 - allow:
110 operation_type: query
111 fields: [viewer]
112 - allow:
113 operation_type: mutation
114 fields: [createIssue]
115 deny_rules:
116 - operation_type: mutation
117 fields: [deleteRepository]
118 binaries:
119 - path: /usr/bin/python*

Calls 1

flushMethod · 0.45

Tested by

no test coverage detected