Home Blog Page 473

​SUSE Introduces New Container Management Service for IaaS and PaaS clouds

Like many other companies, SUSE has decided Kubernetes is the future of container orchestration. At SUSECon in Prague, the oldest Linux company announced the release of SUSE CaaS [Container-as-a-Service] Platform 2, its Kubernetes-based CaaS container management program for Infrastructure-as-a-Service (IaaS) clouds and SUSE Cloud Application Platform (SCAP) for its Cloud Foundry Platform-as-a-Service (PaaS).

Both are designed to enable IT and DevOps professionals to more easily deploy, manage and scale container-based applications and services. This means enterprises can reduce application delivery cycle times.

SUSE CaaS Platform 2 adds powerful tools to simplify large-scale application deployment, incorporates an updated release of Kubernetes, and streamlines public cloud container orchestration.

Read more at ZDNet

Getting Started with Lyft Envoy for Microservices Resilience

Using microservices to solve real-world problems always involves more than simply writing the code. You need to test your services. You need to figure out how to do continuous deployment. You need to work out clean, elegant, resilient ways for them to talk to each other.

A really interesting tool that can help with the “talk to each other” bit is Lyft’s Envoy.

Lyft Envoy Overview

Lyft Envoy is a modern, high performance, small footprint edge and service proxy. Envoy adds resilience and observability to your services, and it does so in a way that’s transparent to your service implementation.

Read more at Dev.to

Identifying Secure Firmware Update Mechanisms and Open Source Options for Embedded Linux devices

Today, a new class of field software updates is arising that has been fueled by security concerns but also allows engineers to add new features and fix bugs.

With regards to embedded devices, the firmware update mechanism must be not only secure, but also reliable in that it either succeeds in the update or fails to a recoverable state. In no way should the software update brick a device, and it should be able to happen unattended. Most updates must also preserve the previous device state, although on some occasions recovering a device could involve resetting to a default state.

There is also the question of atomicity. The Linux server world is used to performing package-based updates, and everything seems to work just fine. But an embedded device is not a server.

Read more at Embedded Computing Design

Debugging Netlink Requests

This week I was working on a Kubernetes networking problem. Basically our container network backend was reporting that it couldn’t delete routes, and we didn’t know why.

I started reading the code that was failing, and it was using a library called “netlink”. I’d never heard of that before this week.

Wikipedia says:

Netlink socket family is a Linux kernel interface used for inter-process communication (IPC) between both the kernel and userspace processes, and between different userspace processes, in a way similar to the Unix domain sockets.

The program I was debugging was creating/deleting routes from the route table. 

Read more at Julia Evans

Redirecting Network Traffic: Part 2

In the previous article, I looked at how to use the clever redir utility to listen out for inbound traffic on a particular port on a host and then forward that traffic onward somewhere else. Here, I’ll briefly describe some other approaches to manipulating traffic that may suit your needs.

IPTables Local

You can, of course, use the mighty IPtables (the kernel-based firewall, Netfilter) to alter how your traffic is manipulated as it arrives at your server. Let’s consider a local port redirection and then we can have a quick a look receiving traffic to a port on one server and dutifully forwarding it onwards to another IP address.

Here are two examples for locally redirecting.

# iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 25 -j REDIRECT --to-port 2500
# iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 443

Here we use the “PREROUTING” functionality on IPtables. The first command redirects incoming traffic for SMTP to port 2500 and the second command intercepts HTTP port traffic and forwards it onto the SSL/TLS port. The syntax isn’t too hard to follow, thankfully.

If you get lost, you can easily look up any NAT (Network Address Translation) rules with this command:

# iptables -nvL -t nat

Should you feel your blood pressure rising, then just flush the problematic rules away like this:

# iptables -F; iptables -t nat -F

Adding these “-F” commands to a Bash alias is sometimes a good idea so you can recover quickly.

IPtables Remote

What about palming off traffic to another machine by using IPtables, along the same lines that we saw previously with the redir utility?

Needless to say you should know what you’re doing (and experiment on a test machine before trying this in production). To start off, we need to enable forwarding on our local machine (“forwarding” essentially equals “routing” for all intents and purposes, allowing traffic to move between network interfaces on a local machine). We can achieve that with this command:

# sysctl net.ipv4.ip_forward=1

If you remove the “sysctl” part and add the remainder of that command (“net.ipv4.ip_forward=1”) to the foot of the file “/etc/sysctl.conf” then that new config will survive a reboot.

Next, we simply declare our rule. Let’s use TCP port 80 again as our example:

# iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 10.10.10.123:80

Finally, we add this line to enable masquerading:

# iptables -t nat -A POSTROUTING -j MASQUERADE

As you would expect, the “-p” switch allows us to change the protocol setting from “tcp” to “udp” or “icmp”. IPtables apparently supports all of these protocols should you have the need to expand that list:

tcp, udp, udplite, icmp, esp, ah, sctp or  all

Internal Redirects

Of course, you don’t need to rely on tools that are, admittedly, relatively complex when other alternatives will suffice.

We’ve already looked at a common redirect (which is required fairly frequently in my experience), namely those of web-based services and TCP ports 80 and 443, so we will briefly look at how redirects are handled internally using the world’s most popular web server, Apache’s httpd.

Once tested a little, these rules are relatively intuitive. Here is an example of what a simple redirect would look like. You can see below that we send all inbound traffic to the HTTP port on to the HTTPS port:

RewriteCond %{HTTPS} !=on

RewriteRule ^(.*)$ https://www.chrisbinnie.tld/$1

In the above example, if the traffic that hits this rule isn’t already using HTTPS (encrypted with SSL or TLS in other words) then the condition will assume it is unencrypted HTTP traffic and continue to the next rule beneath it. The exclamation and equals sign (!=) mean not equal to.

You might, for example, want all traffic, except that which is being sent by a particular IP address, to go a new location. Note the slightly obscure exclamation mark before the IP Address “10.10.10.10” which acts as a negatory condition again, if met. You could add a whole subnet here easily, too.

RewriteCond %{REMOTE_ADDR} !10.10.10.10

RewriteRule .* http://www.chrisbinnie.tld/newer_page.html [L]

This picks up all the external traffic to your virtual host which Apache is dutifully listening out for traffic to. If you’re curious, the “[L]” flag at the end of the second line means that “mod_rewrite”, the Apache module responsible for performing the redirects, stops at that “last” command. There are a mountain of flags which the super-slick Apache can use to process its rules, for Apache 2.4 have a look here: http://httpd.apache.org/docs/2.4/rewrite/flags.html

So that “nginx” web server users don’t feel left out, let’s have a quick look at one of its examples, too. The mighty nginx has gained massive traction amongst the web server market, if you’re interested in one of the reasons this highly performant piece of software took such a large bite out of Apache’s market share then look up the “c10k” problem using your favourite online search device.

A simple nginx example of forwarding TCP port 80 traffic to an encrypted connection would look something like this:

if ($host = 'www.chrisbinnie.tld' ) {
            rewrite  ^/(.*)$  https://secure.chrisbinnie.tld/$1  permanent;
     }

That’s a welcome, short piece of config hopefully you agree and it also includes a look at how nginx can employ “if” statements, which is highly useful at times, and more familiar to programmers than Apache config might be.

Incidentally, you need to place that config inside your “server { }” tag. There are different options to this config; I’ve seen other syntax used in nginx, so if it doesn’t work then you might need to look online so that your version’s needs are met or other config isn’t breaking things. This following example is how you might alter the above to catch multiple domain names for instance:

server {
 listen 80;
 server_name chrisbinnie.tld www.chris.tld;
 rewrite ^ $scheme://www.chrisbinnie.tld$request_uri permanent;

...

}

Here we are simply grabbing what you might consider as malformed HTTP traffic (it’s not really malformed, users have just typed the wrong domain names and URLs into the address bar of their browsers), and we are then forwarding it onto “www.chrisbinnie.tld” so that our precious brand remains intact.

EOF

The next time an unexpected issue arises, you will now be armed with the excellent redir utility along with a smattering of IPtables rules to solve your headaches. For my purposes (short-lived port redirections), the redir utility is usually my tool of choice.

This is thanks to the fact that I tend to have IPtables running on my machines and obviously prefer to avoid breaking something which I know that works correctly (especially if the ports that I want to redirect already have holes punched through via existing IPtables rules). I really enjoy the simplicity of the excellent redir utility, too; that means there’s much less chance of typos.

We’ve only looked at a few scenarios with which traffic redirection can assist. There are many other circumstances when it could be used, especially during migrations of servers between datacenters or internal upgrades that require the renumbering of machines.

If you test that the syntax works locally first then you can rest assured that you can’t break too many production services. After all, you are pointing at what should be an already running service and simply sending some more traffic its way. Ultimately, the traffic will either be served or rejected depending on it its suitability for the daemon listening.

Learn more about essential sysadmin skills: Download the Future Proof Your SysAdmin Career ebook now.

Chris Binnie’s latest book, Linux Server Security: Hack and Defend, shows how hackers launch sophisticated attacks to compromise servers, steal data, and crack complex passwords, so you can learn how to defend against these attacks. In the book, he also talks you through making your servers invisible, performing penetration testing, and mitigating unwelcome attacks. You can find out more about DevSecOps and Linux security via his website (http://www.devsecops.cc).

Out-of-Band Management with Redfish and Ansible

In this article, I’ll explain how Redfish and Ansible can be used together to fully automate, at large scale, systems management tasks from one central location, significantly reducing complexity and helping improve the productivity of IT administrators.

Redfish is an open industry-standard specification published by the Distributed Management Task Force (DMTF) designed for modern and secure management of platform hardware. On Dell EMC PowerEdge servers, the Redfish management APIs are available via the integrated Dell Remote Access Controller (iDRAC), an out-of-band management controller used to remotely manage all hardware components on a server. 

If you’d like to learn more, please join Jose Delarosa for Open Source Summit Europe 2017 on October 23, 2017. In his presentation, Automated Out-of-Band Management with Ansible and Redfish session, he’ll share more details on using open source tools and open industry standards to achieve scalable, automated out-of-band systems management.

Read more at OpenSource.com

APIStrat Conference Workshops Cover API Integration, Security, Testing, and More

The API Strategy & Practice conference (APIStrat) – taking place Oct. 31 through Nov. 2 in Portland – features three days of technical sessions, keynotes, and more, including several workshops providing hands-on learning opportunities. These sessions cover topics such as RESTful API integration, OpenID Connect, API security, and REST API testing.

Check out the following workshops happening at APIStrat:

Connect Your RESTful API to Hundreds of Others in Minutes (Zapier and other Integration Platforms) – Sean Matthews, Left Hook Digital

In this workshop, the Left Hook team will show how to connect your app to hundreds of others on Zapier’s platform in a matter of minutes. We’ll walk you through a quick integration, and then talk about the pros and cons of 30+ different integration platforms out there, as well as highlighting platforms upon which developers can build out their own API connectors today.

Read more at The Linux Foundation

The Role of API Gateways in Microservice Architectures

Despite their differences in nomenclature, newly emerging service meshesaren’t all that different that API Gateways, and the similarities between the two will continue to grow over time, so predicts Marco Palladino, Chief Technology Officer of API Gateway provider Mashape.

The two technologies actually offer quite similar functionality, Palladino noted. API Gateways, such as Amazon Web Services‘ API Gateway or Mashape’s own open source Kong, have been primarily used over the last decade or so for mapping external traffic to internal resources, whereas the more recently developed service meshes — such as Lyft’s Envoy or Uber’s Catylist— have been primarily been on brokering internal resources in a microservices architecture.

“When you think of gateways, you usually think of a centralized layer, an extra hop in the network that is processing additional features. But that doesn’t necessarily have to be true,” Palladino said, speaking at MesosCon 2017, held last week in Los Angeles. 

Read more at The New Stack

Mastering File Searches on Linux

There are many ways to search for files on Linux systems and the commands can be very easy or very specific — narrowing down your search criteria to find what just you’re looking for and nothing else. In today’s post, we’re going to examine some of the most useful commands and options for your file searches. We’re going to look into:

  • Quick finds
  • More complex search criteria
  • Combining conditions
  • Reversing criteria
  • Simple vs. detailed responses
  • Looking for duplicate files

There are actually several useful commands for searching for files. 

Read more at Network World

Unix to GitHub: 10 Key Events in Free and Open Source Software History

It’s easy to take open source software for granted today, but free and open source software as we know it is the product of a long series of developments that stretch back a half-century. Here’s a look at some of the big moments in free and open source history — from the heyday of free Unix, to the birth of GNU and Linux, to the GitHub’s democratization of coding, and everything in between.

1969: Birth of Unix

In 1969 programmers at AT&T’s Bell Labs began work on Unix. Unix was never a free or open source operating system. It was born before the concept of free or open source software even existed. Until the early 1980s, source code was almost always available to anyone who wanted it. In this respect, Unix played little role in promoting the idea of sharing source code.

Read more at The VAR Guy