File tree Expand file tree Collapse file tree 3 files changed +14
-13
lines changed
airflow-core/src/airflow/ui/src Expand file tree Collapse file tree 3 files changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ import { ProgressBar } from "src/components/ui";
24
24
25
25
import { ErrorPage } from "./Error" ;
26
26
27
- export const Iframe = ( ) => {
27
+ export const Iframe = ( { sandbox = "allow-same-origin allow-forms" } : { readonly sandbox : string } ) => {
28
28
const { page } = useParams ( ) ;
29
29
const { data : pluginData , isLoading } = usePluginServiceGetPlugins ( ) ;
30
30
@@ -44,10 +44,6 @@ export const Iframe = () => {
44
44
return < ErrorPage /> ;
45
45
}
46
46
47
- // The following iframe sandbox setting is intentionally less restrictive.
48
- // ONLY trusted contents can be framed within Iframe.
49
- const sandbox = "allow-same-origin allow-forms" ;
50
-
51
47
return (
52
48
< Box flexGrow = { 1 } m = { - 3 } >
53
49
< iframe
Original file line number Diff line number Diff line change @@ -24,6 +24,12 @@ import { ProgressBar } from "src/components/ui";
24
24
25
25
import { ErrorPage } from "./Error" ;
26
26
27
+ // The following iframe sandbox setting is intentionally less restrictive.
28
+ // This is considered safe because the framed content originates from the Auth manager,
29
+ // which is part of the deployment of Airflow and trusted as per our security policy.
30
+ // https://airflow.apache.org/docs/apache-airflow/stable/security/security_model.html
31
+ const SANDBOX = "allow-scripts allow-same-origin allow-forms" ;
32
+
27
33
export const Security = ( ) => {
28
34
const { page } = useParams ( ) ;
29
35
@@ -43,15 +49,9 @@ export const Security = () => {
43
49
return < ErrorPage /> ;
44
50
}
45
51
46
- // The following iframe sandbox setting is intentionally less restrictive.
47
- // This is considered safe because the framed content originates from the Auth manager,
48
- // which is part of the deployment of Airflow and trusted as per our security policy.
49
- // https://airflow.apache.org/docs/apache-airflow/stable/security/security_model.html
50
- const sandbox = "allow-scripts allow-same-origin allow-forms" ;
51
-
52
52
return (
53
53
< Box flexGrow = { 1 } m = { - 3 } >
54
- < iframe sandbox = { sandbox } src = { link . href } style = { { height : "100%" , width : "100%" } } title = { link . text } />
54
+ < iframe sandbox = { SANDBOX } src = { link . href } style = { { height : "100%" , width : "100%" } } title = { link . text } />
55
55
</ Box >
56
56
) ;
57
57
} ;
Original file line number Diff line number Diff line change @@ -143,7 +143,12 @@ export const routerConfig = [
143
143
path : "connections" ,
144
144
} ,
145
145
{
146
- element : < Iframe /> ,
146
+ // The following iframe sandbox setting is intentionally less restrictive.
147
+ // This is considered safe because the framed content originates from the Plugins,
148
+ // which is part of the deployment of Airflow and trusted as per our security policy.
149
+ // https://airflow.apache.org/docs/apache-airflow/stable/security/security_model.html
150
+ // They are not user provided plugins.
151
+ element : < Iframe sandbox = "allow-scripts allow-same-origin allow-forms" /> ,
147
152
path : "plugin/:page" ,
148
153
} ,
149
154
{
You can’t perform that action at this time.
0 commit comments