Skip to content

Instantly share code, notes, and snippets.

apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: all-reader
rules:
- apiGroups: [""]
resources:
- nodes
- nodes/proxy
- services
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: prometheus
namespace: stats
spec:
replicas: 1
selector:
matchLabels:
app: prometheus
@startuml
skinparam componentStyle uml2
node "Redis Pod" {
[redis_exporter]
database redis
}
redis <- redis_exporter
@startuml
object ": AccessLog" as access
access : severity = "ERROR"
access : time = "2020-12-31T20:02:05.123456Z"
access : httpRequest = Object
object ": ApplicationLog" as app1
app1 : severity = "INFO"
app1 : time = "2020-12-31T20:02:03.000456Z"
use azure_core::prelude::Range;
use azure_core::HttpClient;
use azure_storage::blob::prelude::{AsBlobClient, AsContainerClient};
use azure_storage::clients::AsStorageClient;
use azure_storage::core::clients::StorageAccountClient;
use reqwest;
use std::error::Error;
use std::sync::Arc;
#[tokio::main]
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
let account = "xxxxx";
let master_key = "xxxxx";
let http_client: Arc<Box<dyn HttpClient>> = Arc::new(Box::new(reqwest::Client::new()));
let storage_account_client =
StorageAccountClient::new_access_key(http_client.clone(), account, master_key);
let storage_client = storage_account_client.as_storage_client();
autoactivate on
participant "main.rs : App" as App
participant "lib.rs:Enclave" as Enclave
participant "client.rs:Client" as Client
participant "SGX SDK" as SDK
participant IPS <<Intel Service>>
participant IAS <<Intel Service>>
App -> Enclave: verify<<ECall>>
class App {
main()
ocall_sgx_init_quote()<<OCall>>
ocall_get_quote()<<OCall>>
}
class Enclave {
verify() <<ECall>>
create_attestation_report()
}
class Client {
Rectangle Enclaves {
package "Architectural Enclaves" {
["PvE"]
["QE"]
["LE"]
["PSE"]
["PcE"]
}
["Application Enclave"]
}
participant "main.rs : App" as App
participant "lib.rs:Enclave" as Enclave
participant "secret_key:OnceCell" as OnceCell
App -> Enclave: ecall_get_encryption_key<<ECall>>
Enclave -> Enclave: "generates key pair"
Enclave -> OnceCell: set
return
Enclave --> App: public_key