This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ("fmt" | |
"net/http" | |
"log" | |
"io/ioutil" | |
"io" | |
"sync" | |
"os" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ("fmt" | |
"net/http" | |
) | |
func main(){ | |
rootHttpHandler := func(writer http.ResponseWriter, request *http.Request) { | |
fmt.Fprintf(writer, "Request Method: %s\n", request.Method) | |
fmt.Fprintf(writer, "Request Method: %q\n", request.URL) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./ls | |
Reading contents of current directory: | |
Name: ls, Size: 2190488, Last Modified Time: 2021-01-30 16:36:15.436720922 -0600 CST | |
Name: ls.go, Size: 334, Last Modified Time: 2021-01-30 16:34:42.99726847 -0600 CST |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./ls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ go build ls.go |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
) | |
func main(){ | |
fmt.Println("Reading contents of current directory: ") | |
files, err := ioutil.ReadDir(".") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: RoleBinding | |
metadata: | |
name: <role-binding-name> | |
namespace: <your-namespace> | |
roleRef: | |
apiGroup: rbac.authorization.k8s.io | |
kind: ClusterRole | |
name: privileged-cluster-role | |
subjects: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: RoleBinding | |
metadata: | |
name: <name>-role-binding | |
namespace: <your-namespace> | |
roleRef: | |
apiGroup: rbac.authorization.k8s.io | |
kind: ClusterRole | |
name: privileged-cluster-role | |
subjects: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRole | |
metadata: | |
name: privileged-cluster-role | |
rules: | |
- apiGroups: | |
- policy | |
resourceNames: | |
- privileged-psp | |
resources: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: policy/v1beta1 | |
kind: PodSecurityPolicy | |
metadata: | |
name: privileged-psp | |
spec: | |
allowPrivilegeEscalation: true | |
allowedCapabilities: | |
- '*' | |
fsGroup: | |
rule: RunAsAny |