29 Temmuz 2022 Cuma

OpenVPN

Kullanılmayan VPN Bağlantısı
Artık kullanmadığımız bir bağlantıyı silmek için 
C:\Users\user\OpenVPN\config
dizinine gidip bağlantısı ismiyle aynı olan dizini silmek gerekir.


19 Temmuz 2022 Salı

Google Cloud - Google Cloud Registry (GCR)

Giriş
Açıklaması şöyle
Most of the time, developers store their docker images in the Docker Hub. If you are working on a project and you have private images that need to be stored in a private place, most of the time developers configure a nexus server and store it there.

But Google Cloud’s GCR is a perfect solution to this problem. With GCR, you can store, manage, and secure your Docker container images easily. All you want is a service account with proper access permission. GCR is not just a docker repository. You can easily set up CI/CD pipelines with integration to Cloud Build or deploy directly to Google Kubernetes Engine, App Engine, Cloud Functions, or Firebase with GCR.
Sunucu İsimleri
Açıklaması şöyle
gcr.io hosts images in data centers in the United States, but the location may change in the future
us.gcr.io hosts images in data centers in the United States, in a separate storage bucket from images hosted by gcr.io
eu.gcr.io hosts the images in the European Union
asia.gcr.io hosts images in data centers in Asia
GCloud and configure
Önce şöyle yaparız
Go to Google Container Registry (GCR) and enable the Container Registry API.
Google hesabına giriş için şöyle yaparız
gcloud auth login
Daha sonra servise erişmek gerekir. Açıklaması şöyle
Then run the command to configure authentication with service account credentials. Replace the below variables.
- service_account_name — the name of the service account created in step 01.
project_id — your project ID
downloaded_key_file_name — the name of the downloaded key file in step 01.
Servise erişmek için şöyle yaparız
gcloud auth 
  activate-service-account  <SERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com> 
  --key-file=<DOWNLOADED_KEY_FILE_NAME>.json
docker konfigürasyonuna GCR'yi eklemek için şöyle yaparız
gcloud auth configure-docker
Çıktısı şöyle
Adding credentials for all GCR repositories.
WARNING: A long list of credential helpers may cause delays running 'docker build'. 
We recommend passing the registry name to configure only the registry you are using.
After update, the following will be written to your Docker config file
located at [/Users/romina/.docker/config.json]:
{
 "credHelpers": {
   "gcr.io": "gcloud",
   "us.gcr.io": "gcloud",
   "eu.gcr.io": "gcloud",
   "asia.gcr.io": "gcloud",
   "staging-k8s.gcr.io": "gcloud",
   "marketplace.gcr.io": "gcloud"
 }
}
Do you want to continue (Y/n)?  Y
Docker configuration file updated.
Örnek
us-east1 için şöyle yaparız
gcloud auth configure-docker us-east1-docker.pkg.dev
GCR'ye Image Push
1. Yerel image retag'lenir
2. Sonra image push'laınr
Örnek
Yerel image'a retag atmak için şöyle yaparız
docker tag hello-world:latest gcr.io/PROJECT_ID/hello-world:v1
Kontrol etmek için şöyle yaparız
docker images
Push'lamak için şöyle yaparız
docker push gcr.io/PROJECT_ID/hello-world:v1
Kontrol etmek için şöyle yaparız
docker pull gcr.io/PROJECT_ID/hello-world:v1
Örnek
Şöyle yaparız
docker tag my-image us-east1-docker.pkg.dev/my-project/my-repo/test-image
docker push us-east1-docker.pkg.dev/PROJECT-ID/REPOSITORY/IMAGE:TAG


GCR'yi Başka Bir Kubernetes Ortamından Kullanmak - imagePullSecrets

Authentication
Herhangi bir GCR'ye erişmek için doğrulama gerekir. 

1. Create Credentials for GCR
Adımlar şöyle
1. Go to the GCP Console. Select “API & Services” > “Credentials”
2. Select “Create credentials” > “Services Account Key” > “Create New Services Account”.
3. And then, fill the service account name, and for the Role, select the Viewer
4. And click Create. After we create, the credential will automatically be downloaded in a JSON file.
2. Add a Kubernetes Secret in Kubernetes Cluster
Örnek
Şöyle yaparız. secret ismi gcr-json-key. Dosya ismi json-key-file-from-gcp.json
$ kubectl create secret docker-registry gcr-json-key \
--docker-server=asia.gcr.io \
--docker-username=_json_key \
--docker-password="$(cat ~/json-key-file-from-gcp.json)" \
--docker-email=any@valid.email
Secret'ı kontrol etmek için şöyle yaparız
$ kubectl get secret
NAME         TYPE                                  DATA   AGE
gcr-json-key kubernetes.io/dockerconfigjson        1      6s
3: Using the Secret for Deployment
Burada iki seçenek var. Bunlar şöyle
- Add the secret into ImagePullSecrets in default service account in a Kubernetes’s namespace.   With this  method, every pod that will be deployed will use the secret when pulling the images.

- The other way is, add the secret directly to deployment configuration to each pod who needs it.
kubetctl komutuna eklemek için şöyle yaparız
$ kubectl patch serviceaccount default \
-p '{"imagePullSecrets": [{"name": "gcr-json-key"}]}'
yaml dosyasına eklemek için şöyle yaparız. Burada image isminde "gcr.io/PROJECT_ID/hello-world" gibi bir şey kullanıldığını görebiliriz.
apiVersion: v1
kind: Pod
metadata:
  name: august
spec:
  containers:
  - name: august
    image: asia.gcr.io/personal-project/august:latest
  imagePullSecrets:
  - name: gcr-json-key


18 Temmuz 2022 Pazartesi

DO-330 Software Tool Qualification Considerations

Giriş
Açıklaması şöyle. Yani bir DO-178C hedefi için bir araç kullanıyorsak bu aracın qualify edilmesi gerekiyor.
Many verification activities can be performed either manually or by using automated tools to help run the analysis. When automated tools are used to achieve a DO-178C objective without their output being verified, those tools must be qualified for use following the DO-330 Guidelines.
Açıklaması şöyle. Toplam 5 Tool Qualification Level (TQL) seviyesi var. Bunlar da 3 gruba ayrılmışlar.
If you use any commercial verification tools to automate DO-178C verification processes and don’t plan on manually reviewing output from the tools, they will need to be qualified at the appropriate tool qualification level.
Ancak aracın nasıl qualify edilmesi gerektiği D0-178C belgesinde yok. Açıklaması şöyle
DO-178C itself describes when a tool must be qualified, but does not go into detail on how this should be done.

The ED-215/DO-330: Software Tool Qualification Considerations supplement to DO-178C expands on this guidance by defining corresponding objectives for the specification, development and verification of qualified tools.

DO-330 guidance can be applied to any tools, not just those used for software development or verification, for example systems design or hardware development tools, and acts more like a stand-alone guidance document.
Bunu açıklayan belge DO-330. Açıklaması şöyle
The ED-215/DO-330: Software Tool Qualification Considerations supplement to DO-178C expands on this guidance by defining corresponding objectives for the specification, development and verification of qualified tools.

DO-330 guidance can be applied to any tools, not just those used for software development or verification, for example systems design or hardware development tools, and acts more like a stand-alone guidance document.
Qualification Seviyeler Nasıldır?
Açıklaması şöyle. Toplam 5 Tool Qualification Level (TQL) seviyesi var. Bunlar da 3 gruba ayrılmışlar.
DO-178C defines 3 sets of tool assessment criteria which, when combined with the DAL level of your software, are used to classify tool at one of 5 different Tool Qualification Levels (TQLs) as shown in table image attached to the post.
Şeklen şöyle

TQL seviyelerinin açıklaması şöyle.  Yani TLQ1 araçlar çok daha sıkı test edilmeli.
Tools with a lower numbered TQL (e.g. 1) must be tested more rigorously than those with a higher numbered TQL (e.g. 5), and the rigor of testing needed for tools with lower numbered TQLs approaches the rigor needed for testing DAL A software.
Bazı örneklerin açıklaması şöyle. Code Generator araçlar Criteria 1, doğrulama araçları da Criteria 3 olabiliyor.
For example, a code generator tool that converts an architectural description of the software into package or class structures fulfils criteria 1.

Verification tools typically fall into Criteria 3 (and are thus classified at TQL-5) as they neither create airborne software nor eliminate or reduce any processes other than the ones for which they are intended.

Criteria 2 typically applies in cases such as model-based testing with a qualified code generator. In this case, the task of verifying the generated code is eliminated or reduced in favor of testing the model, and so the model-based testing tool meets criteria 2.

14 Temmuz 2022 Perşembe

Open standard for Authorization - OAuth2 Scopes Nedir

OAuth 2.0 Scopes Nedir
Açıklaması şöyle. Resource Server üzerinde farklı scope'lar için farklı endpoint'ler bulunabilir.
OAuth 2.0 scopes is a feature that lets users decide if the application will be authorized to make something restricted. For example, you could have “read” and “write” scopes. If an application needs the write scope, it should ask the user this specific scope.
Role İçin Scope - Kullanmayın
Açıklaması şöyle
The very first authorization pattern developers implement involves differentiating “normal users” and “admins.” It’s very easy to create an OAuth2 scope to represent the “admin” permission. When a user that is determined to be an admin that logs in, developers rely on the authentication system to place this admin scope into the JSON Web Token (JWT) that is minted for that user. Every call to a protected resource checks the JWT for this “admin” scope, and life appears to be good. Except life is rarely that simple and any serious application quickly runs into four problems.
Bunun sebeplerinden birisi şöyle
Applications grow to have many types of resources, and each of these resources (documents, reports, projects, repositories) support a few different operations (create, read, update, delete, list). A fine-grained permission system often creates a cartesian product of these resource/operation tuples, resulting in dozens (or hundreds) of scopes. Injecting all of these scopes into a JWT isn’t possible, since the HTTP authorization header will eventually exceed size limits.

6 Temmuz 2022 Çarşamba

Jira Dashboard

Giriş
Benim bildiğim yöntem şöyle. Başka ve daha kolay bir yolu var mı bilmiyorum.
1. Filters/Advanced Issue Search menüsünü kullanarak bir filtre yarat ve bunu "Save as" ile isim vererek kaydet

2. Dashboard / Create Dashboard menüsünü kullanarak boş bir dashboard yarata. 
Boş dashboard'daki "Add a new gadget" linkini tıkla
"Filter Results" gadget'ı seç ve yeni eklenen filtreyi bu gadget içinde kullan.

Google Cloud - gsutil komutu

cp seçeneği
Örnek
Şöyle yaparız
gsutil cp rlwy04-1657028737.tar.gz gs://product-oce-private-okd4-cluster/rlwy04.tar.gz
iam seçeneği
Örnek
Şöyle yaparız
Şöyle yaparız
#Storage bucket in GCS
# Select GCP project
$  gcloud config set project [project-name]

# Create a GCS bucket
$  gsutil mb -l us-central1 -b on gs://my-vitess-operator-backup-bucket
Creating gs://my-vitess-operator-backup-bucket/...

# Create a GCP service account
$ gcloud iam service-accounts create my-backup-service-account
Created service account [my-backup-service-account].

# Grant the service account access to the bucket gsutil iam ch
$ gsutil iam ch serviceAccount:my-backup-service-account@planetscale-dev.iam.gserviceaccount.com:objectViewer,objectCreator,objectAdmin \
gs://my-vitess-operator-backup-bucket

mb seçeneği
Örnek
Şöyle yaparız
#Storage bucket in GCS
# Select GCP project
$  gcloud config set project [project-name]

# Create a GCS bucket
$  gsutil mb -l us-central1 -b on gs://my-vitess-operator-backup-bucket
Creating gs://my-vitess-operator-backup-bucket/...

23 Haziran 2022 Perşembe

Amazon Web Service (AWS) Elastic Beanstalk

Giriş
Beanstalk bileşenleri şöyle
- AWS Elastic Load Balancer
- Nginx
- Application Server : Mesela Java, Tomcat, ve Amazon Linux

Şeklen şöyle


Açıklaması şöyle 
There is an AWS elastic load balancer in the forefront. This Load Balancer will distribute the traffic to a set of EC2 instances (which can be auto-scaled). Each EC2 instance will have an Nginx web server and a Tomcat application server. Requests sent by the Elastic Load Balancer are first handled by the Nginx server. Then the Nginx server forwards the request to the tomcat server.