1648175344
Hộp chứa là bánh mì và bơ cho các ứng dụng đang chạy ngày nay. Và công nghệ container phổ biến nhất được gọi là Docker .
Biết cách SSH vào vùng chứa là điều cần thiết để sử dụng, gỡ lỗi và vận hành vùng chứa trên hệ điều hành cục bộ hoặc thiết lập từ xa của bạn.
Bài viết này sẽ mô tả các phương pháp khác nhau để làm như vậy cùng với các ràng buộc của chúng.
docker exec
Lệnh phổ biến và hữu ích nhất để lấy shell trong container là docker exec -it
. Nó chạy một lệnh mới trong vùng chứa, cho phép bạn bắt đầu một trình bao tương tác mới:
# start a container
$ docker run --name nginx --rm -p 8080:80 -d nginx
# create and connect to a bash shell in the container
$ docker exec -it nginx bash
root@a84ad71521b1:/#
Bạn có thể thoát khỏi trình bao hiện tại bằng cách nhấn control + d
hoặc nhập exit
.
Nó hoạt động vì:
docker exec
chạy một lệnh mới,-i
thêm một luồng stdin,-t
thêm một trình điều khiển thiết bị đầu cuối,-it
kết hợp -i
và -t
cho phép bạn tương tác với quá trình. Có thể xảy ra trường hợp vùng chứa của bạn chưa được cài đặt bash. Trong trường hợp bạn không thể bắt đầu bash, bạn có thể thử bắt đầu sh
-shell:
docker exec -it nginx sh
Ngoài ra, có thể không có một trình bao nào được cài đặt trong hộp chứa. Do đó, không có cách nào để lấy một trình bao trong vùng chứa đó trong một trình kết nối đơn giản Universum và bạn không thể khởi động bất kỳ trình bao nào.
Tùy thuộc vào công cụ điều phối vùng chứa của bạn, bạn vẫn có thể truy cập vùng chứa. Ví dụ, các thùng chứa không cần kê biên đang trở nên phổ biến hơn để giảm diện tích thùng chứa. Nếu bạn sử dụng Kubernetes, tính năng vùng chứa tạm thời cho phép bạn gỡ lỗi các vùng chứa không có vỏ cũng như các vùng chứa bị rơi.
docker attach
Lệnh
docker attach
đính kèm đầu vào, đầu ra và lỗi tiêu chuẩn của thiết bị đầu cuối của bạn vào một vùng chứa đang chạy bằng cách sử dụng id hoặc tên của vùng chứa. (Nguồn docker.com )
Trên thực tế, điều này có nghĩa là mọi thứ bạn nhập sẽ được chuyển tiếp đến vùng chứa và mọi thứ được in ra sẽ được hiển thị trong bảng điều khiển của bạn.
Bây giờ, bạn đính kèm vào vùng chứa đang chạy:
$ docker attach nginx
172.17.0.1 - - [18/Mar/2022:08:37:14 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" "-"
Trong khi chạy, bạn có thể mở http: // localhost: 8080 . Vì vùng chứa in nhật ký truy cập trên mỗi trang được mở nên bạn sẽ thấy kết quả đầu ra trong thiết bị đầu cuối của mình.
Ngoài ra, đầu vào cũng được chuyển tiếp tới vùng chứa. Vì vậy, nếu bạn nhấn control + c
, mà kích hoạt tín hiệu tiêu diệt, vùng chứa của bạn sẽ tắt.
$ docker attach nginx
172.17.0.1 - - [18/Mar/2022:08:37:14 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" "-"
^[[A^C2022/03/18 08:39:50 [notice] 1#1: signal 2 (SIGINT) received, exiting
2022/03/18 08:39:50 [notice] 32#32: exiting
Việc tách có thể phức tạp vì control + c
nó cũng được sử dụng để tách. Để có thể tháo rời mà không dừng vùng chứa, bạn có thể gắn vào vùng chứa bằng cách tắt tín hiệu chuyển tiếp:
# start the container again
docker run --name nginx --rm -p 8080:80 -d nginx
# attach with proxying signals
docker attach --sig-proxy=false nginx
Để kết nối với một vùng chứa bằng các lệnh docker đơn giản, bạn có thể sử dụng docker exec
và docker attach
.
docker exec
phổ biến hơn rất nhiều vì bạn có thể chạy một lệnh mới cho phép bạn tạo ra một trình bao mới. Bạn có thể kiểm tra các quy trình, tệp và hoạt động giống như trong môi trường cục bộ của bạn.
docker attach
bị hạn chế hơn vì nó gắn đầu vào, đầu ra và lỗi tiêu chuẩn của thiết bị đầu cuối của bạn với quy trình chính của một vùng chứa đang chạy.
Tôi hy vọng bạn thích bài viết.
Nguồn: https://www.freecodecamp.org/news/how-to-ssh-..
1602964260
Last year, we provided a list of Kubernetes tools that proved so popular we have decided to curate another list of some useful additions for working with the platform—among which are many tools that we personally use here at Caylent. Check out the original tools list here in case you missed it.
According to a recent survey done by Stackrox, the dominance Kubernetes enjoys in the market continues to be reinforced, with 86% of respondents using it for container orchestration.
(State of Kubernetes and Container Security, 2020)
And as you can see below, more and more companies are jumping into containerization for their apps. If you’re among them, here are some tools to aid you going forward as Kubernetes continues its rapid growth.
(State of Kubernetes and Container Security, 2020)
#blog #tools #amazon elastic kubernetes service #application security #aws kms #botkube #caylent #cli #container monitoring #container orchestration tools #container security #containers #continuous delivery #continuous deployment #continuous integration #contour #developers #development #developments #draft #eksctl #firewall #gcp #github #harbor #helm #helm charts #helm-2to3 #helm-aws-secret-plugin #helm-docs #helm-operator-get-started #helm-secrets #iam #json #k-rail #k3s #k3sup #k8s #keel.sh #keycloak #kiali #kiam #klum #knative #krew #ksniff #kube #kube-prod-runtime #kube-ps1 #kube-scan #kube-state-metrics #kube2iam #kubeapps #kubebuilder #kubeconfig #kubectl #kubectl-aws-secrets #kubefwd #kubernetes #kubernetes command line tool #kubernetes configuration #kubernetes deployment #kubernetes in development #kubernetes in production #kubernetes ingress #kubernetes interfaces #kubernetes monitoring #kubernetes networking #kubernetes observability #kubernetes plugins #kubernetes secrets #kubernetes security #kubernetes security best practices #kubernetes security vendors #kubernetes service discovery #kubernetic #kubesec #kubeterminal #kubeval #kudo #kuma #microsoft azure key vault #mozilla sops #octant #octarine #open source #palo alto kubernetes security #permission-manager #pgp #rafay #rakess #rancher #rook #secrets operations #serverless function #service mesh #shell-operator #snyk #snyk container #sonobuoy #strongdm #tcpdump #tenkai #testing #tigera #tilt #vert.x #wireshark #yaml
1648175344
Hộp chứa là bánh mì và bơ cho các ứng dụng đang chạy ngày nay. Và công nghệ container phổ biến nhất được gọi là Docker .
Biết cách SSH vào vùng chứa là điều cần thiết để sử dụng, gỡ lỗi và vận hành vùng chứa trên hệ điều hành cục bộ hoặc thiết lập từ xa của bạn.
Bài viết này sẽ mô tả các phương pháp khác nhau để làm như vậy cùng với các ràng buộc của chúng.
docker exec
Lệnh phổ biến và hữu ích nhất để lấy shell trong container là docker exec -it
. Nó chạy một lệnh mới trong vùng chứa, cho phép bạn bắt đầu một trình bao tương tác mới:
# start a container
$ docker run --name nginx --rm -p 8080:80 -d nginx
# create and connect to a bash shell in the container
$ docker exec -it nginx bash
root@a84ad71521b1:/#
Bạn có thể thoát khỏi trình bao hiện tại bằng cách nhấn control + d
hoặc nhập exit
.
Nó hoạt động vì:
docker exec
chạy một lệnh mới,-i
thêm một luồng stdin,-t
thêm một trình điều khiển thiết bị đầu cuối,-it
kết hợp -i
và -t
cho phép bạn tương tác với quá trình. Có thể xảy ra trường hợp vùng chứa của bạn chưa được cài đặt bash. Trong trường hợp bạn không thể bắt đầu bash, bạn có thể thử bắt đầu sh
-shell:
docker exec -it nginx sh
Ngoài ra, có thể không có một trình bao nào được cài đặt trong hộp chứa. Do đó, không có cách nào để lấy một trình bao trong vùng chứa đó trong một trình kết nối đơn giản Universum và bạn không thể khởi động bất kỳ trình bao nào.
Tùy thuộc vào công cụ điều phối vùng chứa của bạn, bạn vẫn có thể truy cập vùng chứa. Ví dụ, các thùng chứa không cần kê biên đang trở nên phổ biến hơn để giảm diện tích thùng chứa. Nếu bạn sử dụng Kubernetes, tính năng vùng chứa tạm thời cho phép bạn gỡ lỗi các vùng chứa không có vỏ cũng như các vùng chứa bị rơi.
docker attach
Lệnh
docker attach
đính kèm đầu vào, đầu ra và lỗi tiêu chuẩn của thiết bị đầu cuối của bạn vào một vùng chứa đang chạy bằng cách sử dụng id hoặc tên của vùng chứa. (Nguồn docker.com )
Trên thực tế, điều này có nghĩa là mọi thứ bạn nhập sẽ được chuyển tiếp đến vùng chứa và mọi thứ được in ra sẽ được hiển thị trong bảng điều khiển của bạn.
Bây giờ, bạn đính kèm vào vùng chứa đang chạy:
$ docker attach nginx
172.17.0.1 - - [18/Mar/2022:08:37:14 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" "-"
Trong khi chạy, bạn có thể mở http: // localhost: 8080 . Vì vùng chứa in nhật ký truy cập trên mỗi trang được mở nên bạn sẽ thấy kết quả đầu ra trong thiết bị đầu cuối của mình.
Ngoài ra, đầu vào cũng được chuyển tiếp tới vùng chứa. Vì vậy, nếu bạn nhấn control + c
, mà kích hoạt tín hiệu tiêu diệt, vùng chứa của bạn sẽ tắt.
$ docker attach nginx
172.17.0.1 - - [18/Mar/2022:08:37:14 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" "-"
^[[A^C2022/03/18 08:39:50 [notice] 1#1: signal 2 (SIGINT) received, exiting
2022/03/18 08:39:50 [notice] 32#32: exiting
Việc tách có thể phức tạp vì control + c
nó cũng được sử dụng để tách. Để có thể tháo rời mà không dừng vùng chứa, bạn có thể gắn vào vùng chứa bằng cách tắt tín hiệu chuyển tiếp:
# start the container again
docker run --name nginx --rm -p 8080:80 -d nginx
# attach with proxying signals
docker attach --sig-proxy=false nginx
Để kết nối với một vùng chứa bằng các lệnh docker đơn giản, bạn có thể sử dụng docker exec
và docker attach
.
docker exec
phổ biến hơn rất nhiều vì bạn có thể chạy một lệnh mới cho phép bạn tạo ra một trình bao mới. Bạn có thể kiểm tra các quy trình, tệp và hoạt động giống như trong môi trường cục bộ của bạn.
docker attach
bị hạn chế hơn vì nó gắn đầu vào, đầu ra và lỗi tiêu chuẩn của thiết bị đầu cuối của bạn với quy trình chính của một vùng chứa đang chạy.
Tôi hy vọng bạn thích bài viết.
1596789120
Everything around us has become smart, like smart infrastructures, smart cities, autonomous vehicles, to name a few. The innovation of smart devices makes it possible to achieve these heights in science and technology. But, data is vulnerable, there is a risk of attack by cybercriminals. To get started, let’s know about IoT devices.
The Internet Of Things(IoT) is a system that interrelates computer devices like sensors, software, and actuators, digital machines, etc. They are linked together with particular objects that work through the internet and transfer data over devices without humans interference.
Famous examples are Amazon Alexa, Apple SIRI, Interconnected baby monitors, video doorbells, and smart thermostats.
When technologies grow and evolve, risks are also on the high stakes. Ransomware attacks are on the continuous increase; securing data has become the top priority.
When you think your smart home won’t fudge a thing against cybercriminals, you should also know that they are vulnerable. When cybercriminals access our smart voice speakers like Amazon Alexa or Apple Siri, it becomes easy for them to steal your data.
Cybersecurity report 2020 says popular hacking forums expose 770 million email addresses and 21 million unique passwords, 620 million accounts have been compromised from 16 hacked websites.
The attacks are likely to increase every year. To help you secure your data of IoT devices, here are some best tips you can implement.
Your router has the default name of make and model. When we stick with the manufacturer name, attackers can quickly identify our make and model. So give the router name different from your addresses, without giving away personal information.
If your devices are connected to the internet, these connections are vulnerable to cyber attacks when your devices don’t have the proper security. Almost every web interface is equipped with multiple devices, so it’s hard to track the device. But, it’s crucial to stay aware of them.
When we use the default usernames and passwords, it is attackable. Because the cybercriminals possibly know the default passwords come with IoT devices. So use strong passwords to access our IoT devices.
Use strong or unique passwords that are easily assumed, such as ‘123456’ or ‘password1234’ to protect your accounts. Give strong and complex passwords formed by combinations of alphabets, numeric, and not easily bypassed symbols.
Also, change passwords for multiple accounts and change them regularly to avoid attacks. We can also set several attempts to wrong passwords to set locking the account to safeguard from the hackers.
Are you try to keep an eye on your IoT devices through your mobile devices in different locations. I recommend you not to use the public WI-FI network to access them. Because they are easily accessible through for everyone, you are still in a hurry to access, use VPN that gives them protection against cyber-attacks, giving them privacy and security features, for example, using Express VPN.
There are software and firewalls like intrusion detection system/intrusion prevention system in the market. This will be useful to screen and analyze the wire traffic of a network. You can identify the security weakness by the firewall scanners within the network structure. Use these firewalls to get rid of unwanted security issues and vulnerabilities.
Every smart device comes with the insecure default settings, and sometimes we are not able to change these default settings configurations. These conditions need to be assessed and need to reconfigure the default settings.
Nowadays, every smart app offers authentication to secure the accounts. There are many types of authentication methods like single-factor authentication, two-step authentication, and multi-factor authentication. Use any one of these to send a one time password (OTP) to verify the user who logs in the smart device to keep our accounts from falling into the wrong hands.
Every smart device manufacturer releases updates to fix bugs in their software. These security patches help us to improve our protection of the device. Also, update the software on the smartphone, which we are used to monitoring the IoT devices to avoid vulnerabilities.
When we connect the smart home to the smartphone and control them via smartphone, you need to keep them safe. If you miss the phone almost, every personal information is at risk to the cybercriminals. But sometimes it happens by accident, makes sure that you can clear all the data remotely.
However, securing smart devices is essential in the world of data. There are still cybercriminals bypassing the securities. So make sure to do the safety measures to avoid our accounts falling out into the wrong hands. I hope these steps will help you all to secure your IoT devices.
If you have any, feel free to share them in the comments! I’d love to know them.
Are you looking for more? Subscribe to weekly newsletters that can help your stay updated IoT application developments.
#iot #enterprise iot security #how iot can be used to enhance security #how to improve iot security #how to protect iot devices from hackers #how to secure iot devices #iot security #iot security devices #iot security offerings #iot security technologies iot security plus #iot vulnerable devices #risk based iot security program
1602317778
At some point we’ve all said the words, “But it works on my machine.” It usually happens during testing or when you’re trying to get a new project set up. Sometimes it happens when you pull down changes from an updated branch.
Every machine has different underlying states depending on the operating system, other installed programs, and permissions. Getting a project to run locally could take hours or even days because of weird system issues.
The worst part is that this can also happen in production. If the server is configured differently than what you’re running locally, your changes might not work as you expect and cause problems for users. There’s a way around all of these common issues using containers.
A container is a piece of software that packages code and its dependencies so that the application can run in any computing environment. They basically create a little unit that you can put on any operating system and reliably and consistently run the application. You don’t have to worry about any of those underlying system issues creeping in later.
Although containers were already used in Linux for years, they became more popular in recent years. Most of the time when people are talking about containers, they’re referring to Docker containers. These containers are built from images that include all of the dependencies needed to run an application.
When you think of containers, virtual machines might also come to mind. They are very similar, but the big difference is that containers virtualize the operating system instead of the hardware. That’s what makes them so easy to run on all of the operating systems consistently.
Since we know how odd happenings occur when you move code from one computing environment to another, this is also a common issue with moving code to the different environments in our DevOps process. You don’t want to have to deal with system differences between staging and production. That would require more work than it should.
Once you have an artifact built, you should be able to use it in any environment from local to production. That’s the reason we use containers in DevOps. It’s also invaluable when you’re working with microservices. Docker containers used with something like Kubernetes will make it easier for you to handle larger systems with more moving pieces.
#devops #containers #containers-devops #devops-containers #devops-tools #devops-docker #docker #docker-image
1602318300
Note: This is part 1 of a multi-part series.
Introduction:
Dear Readers, in this blog series I will cover Security issues related to Docker and how to protect against misconfigurations and attacks.
Let’s get started.
Docker Overview:
According to the official website of Docker, “Docker is the de facto standard to build and share containerized apps — from desktop to the cloud. We are building on our unique connected experience from code to cloud for developers and developer teams.”
In simple words, Docker provides the ability to package and run an application in an isolated environment called a container.
There are a lot of resources related to understanding docker and the references below will also be helpful;
I will list out security concerns with some tags like [Dockerfile] [Host] or [Both] so that it is easy to understand and do some review if needed.
[Dockerfile] Do Not Run Applications as ROOT User :
One of the best practices while running Docker Container is to run processes with a non-root user. This is because if a user manages to break out of the application running as root in the container, may gain root user access on the host. In addition, configuring container to user unprivileged is the best way to prevent privilege escalation attacks.
#infosec #containers #hacking #security #docker