Jack of All Trades, Master of None

“Jack of all trades, master of none,” I’ve heard IT industry professionals scoff arrogantly several times in the past. That was their judgement of polyglot programmers, full stack developers, or any other people who had dabbled in more than one area of the kind of work we do.

Full stack. Heh heh. I took this picture at an eatery in San Francisco in February 2017.

I get where they’re coming from. Our industry is a very complicated one, and it’s really hard to learn much of anything if you don’t focus. Whether we’re talking about backend, frontend, databases, NoSQL and so on, there is an overwhelming number of technologies to discover and learn, and the information overload on the internet doesn’t help digest them.

The conventional wisdom is to be a “jack of all trades, master of one“, meaning you learn a number of different things but try to excel at at least one of them. This is great advice, but I’ve very rarely seen it happen in practice. People tend to either specialise in one thing in depth, or have a superficial knowledge of different things. Which of these would you choose?

Being just a master of one is a real problem I’ve seen for a long time. People who have only focused on one programming paradigm throughout their training and career tend to have trouble thinking outside the box and finding different ways to solve problems. Backend and frontend skills don’t easily transfer across, and most full stack developers are typically much stronger at one of these than the other. Most developers don’t understand enough about security, infrastructure and architecture.

The way I see it, that’s pretty bad. A developer who knows nothing about servers is a bit like a centre-forward who is so good that he can dribble past the opposing team’s defence, but fails to score every time.

That’s why even a semi-decent University education in this field doesn’t just teach programming. Learning CPU architecture, systems programming, Assembly language or C gives an idea what happens under the hood and teaches a certain appreciation of resources and doing things efficiently, a perspective that people having only experience with high-level languages often dismiss. Having a basic grasp of business and management prevents developers from idolising their code (“clean code” anyone?) and helps them to focus on solving real problems. Understanding a little about infrastructure helps them better understand architectural and security concerns that code-focused developers will often ignore.

Universities, in fact, produce instances of “jack of all trades, master of none”. Let’s face it: when you graduate, although your scores might give you confidence, you don’t really know much of anything. But thanks to your holistic training, you’re able to understand a variety of different problems, and gradually get a deeper understanding of what you need to solve them.

I also think there is a place for the “master of one” type of people who specialise very strongly in one area and mostly ignore the rest. I imagine these would be academics, or R&D specialists in big companies like Google. But, as much as we like drawing inspiration and borrowing ideas from successful companies, we always have to keep the context in mind. Who are we kidding? Most of us mere mortals don’t work at companies anything like Google.

So what I’m saying here is: it’s not bad to be a “jack of all trades, master of none” in our field. It is obviously better if you’re also “master of one”, but if I had to choose, I’d be (or hire) the one with the broad but superficial knowledge. Because when you are aware that something exists, then it’s not a huge leap to research it in more detail and get to the depth you need. It’s actually a good strategy to learn depth on an as-needed basis, especially given that you’ll never have enough time to learn everything in depth.

As in life, I’d rather know a little bit about many things that interest me, than bury myself in one thing and otherwise give the impression that I’ve been living under a rock.

Enabling and Enforcing HTTPS on a Subdomain with cPanel

Nowadays, there’s really no excuse not to enable HTTPS on a website, even a small personal one. It’s free and simple. In fact, chances are that whatever host you’re using offers a simple option you can just turn on. In this article, we’ll see how to set this up in cPanel, which is commonly used in Linux/PHP/MySQL web hosting services.

Set up the Subdomain

Subdomains service in cPanel

If you haven’t already, create a subdomain. To do this:

  1. Locate the Subdomains service in cPanel.
  2. Enter a name for the subdomain.
  3. Enter a path to a folder to be used as the document root for the subdomain.
  4. Click the Create button.

Enable HTTPS on the Subdomain

Let’s Encrypt™ SSL service in cPanel

New subdomains will by default run on HTTP, which is insecure. Enabling HTTPS requires an SSL or TLS certificate. To set this up:

  1. Locate the Let’s Encrypt™ SSL service in cPanel.
  2. Scroll towards the bottom of the page, and page through your subdomains until you locate the new one you want to apply HTTPS to.
  3. Click on the Issue action link next to it.
  4. Leave the settings as they are and click on the Issue button.

Enforce HTTPS on the Subdomain

Domains service in cPanel

Enabling HTTPS is only half good if people can still access the site insecurely over HTTP. It’s very easy to automatically redirect people from the HTTP endpoint to HTTPS. To do this:

  1. Locate the Domains service in cPanel.
  2. Locate the new subdomain, which may be on a different page.
  3. Turn on the switch in the Force HTTPS Redirect column.
  4. A success message should confirm that it’s been enabled.

Test the Subdomain

The subdomain is secure and running on HTTPS

To make sure everything is set up correctly, use a browser to ensure that the website at your subdomain is secure.

  1. Wait a few seconds. The redirect you just enabled might not kick in right away.
  2. Use an incognito session in your browser. Otherwise, if you visited the subdomain before enabling the redirect, it’s possible that the browser might still show it as insecure.
  3. Access your domain with the URL starting with https://. Ensure that your browser displays the padlock icon and reports the connection as secure.
  4. Access your domain with the URL starting with http://. Once the page loads, ensure that you are now on https:// and that the browser displays the padlock icon and reports the connection as secure. Optionally, you can also open your browser’s dev tools, switch to the Network tab, and observe a 301 redirect request.

Summary

As you can see, it’s super easy to get HTTPS working on a subdomain in cPanel. Just enable HTTPS for the subdomain, force the HTTPS redirect, and you’re done.

Azure Fundamentals Part 5 Summary

This is a summary of the Azure Fundamentals part 5: Describe identity, governance, privacy, and compliance features learning path. Aside from the usual “Introduction to Azure Fundamentals” module, repeated in every learning path in this series, there are three modules covering identity, cloud governance, and compliance, respectively. If you’re a developer, this learning path is easily the most boring of the lot, but it’s also very important from a cloud administration point of view.

Identity Services

This is a summary of the Secure access to your applications by using Azure identity services module. They love using wordy headings, don’t they?

Authentication vs authorization: who you are vs what you have access to.

Azure Active Directory (Azure AD):

  • Similar to Active Directory, but for the cloud
  • Monitors sign-in attempts, unlike the on-premises counterpart
  • Controls access to other Microsoft services such as Office 365
  • Has the concept of tenants, which represent organisations
  • Is an identity and access management service. It stores information about users (including passwords), and provides control over them (e.g. reset password, multifactor authentication, list of banned passwords, etc)
  • Also provides device management – devices can be registered to control which devices are allowed to access services.
  • Supports Single sign-on (SSO) to access multiple applications with the same credentials.
  • Azure AD Connect synchronises user identities between on-premises Active Directory and Azure AD. Users can use their same credentials to access on-premises and cloud services.

Multifactor authentication provides an additional layer of security over the usual username and password by requiring two or more authentication mechanisms, typically from the following categories:

  • Something the user knows (e.g. username and password)
  • Something the user has (e.g. code sent to mobile device)
  • Something the user is (biometric data, e.g. fingerprint)

Conditional access is a feature of Azure AD that applies multifactor authentication differently based on identity signals. This is basically a rule engine that can do things like request the second factor only if they’re in an unknown location, signing in from an unknown device, or accessing a particular application. Access could also be blocked entirely in some circumstances (e.g. signing in from a high-risk country). Conditional access is a premium feature that requires a special Azure AD licence.

Cloud Governance

This is a summary of the Build a cloud governance strategy on Azure module.

The Cloud Adoption Framework for Azure guides you towards migrating to the cloud. There are five steps:

  • Define your strategy: understand what benefits you’ll gain by moving to the cloud, get everyone on board, and choose the right proof of concept project to kick it off.
  • Make a plan: take stock of what you have on-premises, train up, and make a plan to migrate.
  • Ready your organisation: set up your Azure subscriptions and create a landing zone, basically an environment in the cloud to get you started.
  • Adopt the cloud: start migrating, review best practices, find ways to migrate more efficiently, and study ways to handle more complex migrations.
  • Govern and manage your cloud environments: define processes and policies that will apply to resources in the cloud, and maintain them as they evolve throughout the migration process.

Things to consider when deciding how to organise Azure subscriptions:

  • BIlling: you can create one billing report per subscription, so you can organise subscriptions by department or project.
  • Access control: subscriptions provide inherent isolation (e.g. between development and production environments).
  • Subscription limits: some resources are limited in the amount you can deploy per subscription, so you’ll need to allocate more subscriptions if necessary.

Role-based access control (RBAC) is used to grant or restrict access to resources. These roles are applied to a scope that could be:

  • A management group
  • A single subscription
  • A resource group
  • A single resource

Access control is inherited by child scopes, e.g. assigning a role to a single subscription means it is also applied to all resource groups and resources in that subscription.

RBAC is managed via Access control (IAM) in the Azure portal. RBAC rules are applied to any request to an Azure resource that passes through the Azure Resource Manager.

RBAC uses an allow model, so as long as you have a role that allows you to perform an action, you can do it; and if different roles give you different access (e.g. read and write), then they sum up (e.g. you get both read and write).

Resource locks are a simple setting against accidental modification or deletion. You can use either CanNotDelete (authorised users can read or write but not delete) or ReadOnly (authorised users can read a resource but can’t change or delete it). You can remove the lock to perform the restricted operation (e.g. to delete the resource).

You can use Azure Blueprints (more on this further below) to set a standard for resources across your organisation, which could include enforcement of resource locks among other things.

Resource tags are used to apply metadata to resources. They complement subscriptions and resource groups as another way to categorise and organise things. They help to:

  • Manage resources and locate them easily
  • Report on costs by particular tags
  • Group resources based on criticality and SLAs
  • Classify data security (e.g. confidential)
  • Regulatory compliance (e.g. ISO27001)
  • Run any kind of automation logic on resources with a particular tag

Azure Policy lets you create and enforce policies or initiatives (groups of policies) that apply to resources. To implement a policy, you:

  1. Create a policy definition
  2. Assign it to resources
  3. Review the evaluation results

A policy definition can be used to do things like:

  • Prevent VMs from being deployed in certain regions
  • Restrict which virtual machine sizes can be deployed
  • Enforce MFA on accounts with write permissions
  • Prevent CORS from allowing unrestricted access to web applications
  • Ensure updates are installed on VMs

Azure Blueprints lets you orchestrate things like role assignments, policy assignments, ARM templates and resource groups across your organisation so that you don’t need to set them up for each subscription. Blueprints are made up of artifacts, and they deploy different elements to each subscription (e.g. Allowed locations policy, resources from an ARM template, etc).

Data Protection & Compliance

This is a summary of the Examine privacy, compliance, and data protection standards on Azure module.

Some projects require compliance with certain standards, such as ISO 27001 or government-specific regulations. Azure is compliant with a huge number of these, so it’s quite likely you can use Azure even when working in some of the more regulated sectors.

You can also check the following documents:

  • Microsoft Privacy Statement: how Microsoft manages personal data
  • Online Services Terms: agreement between customer and Microsoft when using services such as Azure or Office 365
  • Data Protection Addendum: more specific about data protection

The Trust Center lets you find information about particular compliance offerings, such as ISO 27001, and how it applies to cloud services on Azure.

The Azure compliance documentation describes how Azure adheres to certain standards, e.g. PCI DSS.

Azure Government is a separate Azure offering for US government. It has the highest level of security, and data centres are physically isolated so they can’t be used by you and me outside the scope of the US government.

Azure China 21Vianet is the Azure offering in China. Microsoft can’t operate Azure directly in China because of local regulations, so they instead offer it via a partner, 21Vianet. Services offered are mostly the same, but they may vary a little.

Azure Fundamentals Part 4 Summary

This is a summary of the Azure Fundamentals part 4: Describe general security and network security features learning path. Aside from the usual “Introduction to Azure fundamentals” module repeated in every learning path in the series, there are only a couple of other modules on general and network security, respectively.

General Security

This is a summary of the Protect against security threats on Azure module.

Azure Security Center is a service that gives you visibility into the overall security of your Azure and on-premises services, referred to as your security posture. It provides ratings against different regulatory benchmarks such as Azure CIS or PCI DSS, and also provides an overall secure score. The Resource security hygiene section provides a breakdown of security warnings by service type.

Azure Security Center also provides additional security capabilities including:

  • Permitting temporary access to VMs that would normally be blocked to outside traffic
  • Controlling which applications can run on VMs
  • Recommendations for hardening network security groups
  • Monitoring system files on both Windows and Linux against tampering
  • Integration with Azure Logic Apps to automatically trigger actions based on threat detection alerts of Security Center recommendations.

Azure Sentinel is a security analytics service (the more formal term would be security information and event management (SIEM) system). It can:

  • Collect security information from different sources
    • Microsoft services such as Office 365 or Azure Active Directory
    • Non-Microsoft services such as AWS CloudTrail or Okta SSO
    • Other sources that use recognised formats including Common Event Format (CEF), Syslog, or REST API
  • Detect threats based on built-in or custom rules
  • Investigate incidents or suspicious activity
  • Use Azure Monitor Workbooks to automate responses to threats

Azure Key Vault is another security-related service used to store secrets, including passwords, encryption keys, and certificates. These secrets can also be protected by hardware security modules (HSMs). Access to the secrets can be easily monitored.

Azure Dedicated Host is a special VM offering where you have sole access to the physical hardware (as opposed to normal VMs which are shared). This can sometimes be required for compliance reasons.

  • A host group contains multiple dedicated hosts for high availability, similar to VM scale sets.
  • Maintenance control provides control over when regular maintenance updates occur, within a 35-day rolling window.
  • Pricing is per dedicated host, not per VM running on it. Additional charges apply for software licencing, storage, and network usage.

Network Security

This is a summary of the Secure network connectivity on Azure module.

Defence in depth refers to multiple layers of defence including:

  • Physical security: physical access to the data centre.
  • Identity & access: control access to infrastructure and change control. This includes use of SSO and multifactor authentication, as well as auditing events and changes.
  • Perimeter: DDoS protection and perimeter firewalls.
  • Network: use access control to limit communication between resources, and ensure any external connectivity (e.g. to on-premises networks) is secure.
  • Compute: secure access to VMs and ensure they have the latest security updates.
  • Application: ensure applications are free of vulnerabilities, and store secrets securely.
  • Data: store and transmit data securely, whether it’s in a database, VM disk, SaaS application (e.g. Office 365) or in other cloud storage.

Data protection is based on the CIA principles:

  • Confidentiality: Use the principle of least privilege to give access only to those who really need it. Protect secrets and resources from unauthorised access.
  • Integrity: Protect data at rest and in transit from tampering. Hash algorithms are usually used to verify whether data has changed.
  • Availability: Ensure services are able to run and that access to their data is not compromised, e.g. by DDoS attacks.

Azure Firewall is a highly available and scalable stateful firewall used to protect resources within virtual networks. It can be configured to allow or deny traffic based on rules including:

  • Source IP address
  • Protocol
  • Destination port
  • Destination address
  • Which domains can be accessed from a subnet

Network Address Translation (NAT) rules can also be configured in Azure Firewall.

Azure Application Gateway, Azure Front Door and Azure Content Delivery Network offer a different kind of firewall known as web application firewall (WAF), which provides protection tailored to web applications.

Azure DDoS Protection resists attempts to overwhelm or overallocate resources by flooding them with requests. This is available in two tiers:

  • Basic: free and automatically enabled. The Azure global network is used to distribute and mitigate attack traffic across Azure regions; it ensures that Azure infrastructure is not affected by DDoS attacks. Includes always-on traffic monitoring and real-time mitigation of common network-level attacks.
  • Standard: provides additional protection for virtual network resources linked to public IP addresses. Adapts mitigation measures via dedicated traffic monitoring and machine learning algorithms.

DDoS Protection can help prevent the following types of attacks:

  • Volumetric attacks: flood the network layer with requests.
  • Protocol attacks: exploit weaknesses in layer 3 or 4 protocols.
  • Resource/application-layer attacks (only with web application firewall): target HTTP endpoints that are relatively slow to process, so many such requests ultimately overwhelm the server and make it unable to process additional requests. This requires the HTTP-aware WAF to mitigate.

Network security groups (NSGs) are like internal firewalls. Whereas Azure Firewall controls what traffic comes from outside, NSGs can be used to allow or deny traffic between resources in a virtual network, based on things like source/destination IP (single address or range), protocol (TCP, UDP or both) and direction (incoming or outgoing traffic).

Azure Fundamentals Part 3 Summary

This is a summary of Azure Fundamentals part 3: Describe core solutions and management tools on Azure, one of the longer learning paths in the Azure Fundamentals series. The first of its seven modules is “Introduction to Azure fundamentals”, which is repeated in every learning path. The rest cover a number of different services spanning areas such as AI, source control and project management, observability, serverless, IoT, and different tools to interact with Azure.

This particular learning path uses a tedious format where each module discusses a couple of services, provides criteria to decide which to use, and then takes a while analysing those criteria for different use cases. This summary should save a lot of time if you’re preparing for the exam.

AI Services

This section is a summary of the Choose the best AI service for your needs module.

Approaches to AI:

  • Deep learning: based on neural networks. (The module doesn’t give this more than a brief mention.)
  • Machine learning: train a model and use it to make predictions.

AI services on Azure:

  • Azure Machine Learning: gives complete control to train a model using your own data. You can test it and then use it via a web API endpoint to make predictions.
  • Azure Cognitive Services: pre-built machine learning models covering:
    • Language: process natural language to identify meaning or sentiment
    • Speech: speech-to-text and text-to-speech, as well as translation and speaker recognition.
    • Vision: analyse pictures, videos and other visual content.
    • Decision: personalised recommendations (Azure Cognitive Services Personalizer), content moderation, and detection of anomalies in time-series data.
  • Azure Bot Service: used to develop chatbots. People can interact with these via text, interactive cards, and speech.

Source Control and Project Management

This section is a summary of the Choose the best tools to help organizations build better solutions module.

Azure DevOps Services is an offering similar to the Atlassian stack or GitHub, where you get Git repositories, task management, CI/CD, and more. Formerly known as (the dreaded) Team Foundation Server (TFS), this is now a SaaS product that includes:

  • Azure Repos: Git repositories
  • Azure Boards: task management, JIRA-style
  • Azure Pipelines: CI/CD
  • Azure Artifacts: hosts artifacts to be fed into later stages of a pipeline (e.g. testing or deployment)
  • Azure Test Plans: automated test tool that runs as part of a CI/CD pipeline

GitHub needs no introduction, but was acquired by Microsoft and so it can now be considered as an alternative to Azure DevOps. It remains popular for open-source projects with public repositories and communities built around them. GitHub Actions can be used to automate workflows, for example to implement CI/CD.

Compared to GitHub, Azure DevOps is more intended for enterprise development, and it has heavier project management and reporting tools as well as finer-grained access control.

Azure DevTest Labs is used to automate the provisioning and teardown of pre-configured environments (containing VMs or other resources) to test builds.

Observability

This section is a summary of the Choose the best monitoring service for visibility, insight, and outage mitigation module.

Azure Advisor provides recommendations to make best use of Azure and minimise costs, across the following categories:

  • Reliability
  • Security
  • Performance
  • Cost
  • Operational Excellence

Azure Monitor is use to ingest and analyse log and metric data from various sources. The data can also be used to trigger logic based on particular events. Application Insights is a service that collects telemetry from applications, and uses Azure Monitor under the hood.

Azure Service Health is a personalised view of Azure services, regions and resources that affect you. It helps you keep up to date with and find detailed information about:

  • Service issues
  • Planned maintenance
  • Health advisories (e.g. service retirements and breaking changes)

Working with Azure

This section is a summary of the Choose the best tools for managing and configuring your Azure environment module.

The Azure portal is a web-based user interface used to manage Azure resources. It is friendly for new users, but is not a good choice if you need to automate tasks.

The Azure mobile app supports iOS and Android, and is handy to manage Azure resources remotely when a computer is not available. You can use it to:

  • Monitor health and status of Azure resources
  • Check and fix issues
  • Restart a web app or VM
  • Run Azure CLI or Azure PowerShell commands

Azure PowerShell and the Azure CLI are both used to script interactions with Azure (or execute one-off tasks), via commands which call the Azure REST API underneath. Both provide the same automation benefits and are available for Windows, Linux, Mac, or within Azure Cloud Shell. The only difference is the syntax, where proficient Windows users might prefer Azure PowerShell, whereas the Azure CLI is based on Bash which is more familiar to Linux and Mac users.

ARM templates are a declarative way of describing the resources that need to be deployed using JSON. The ARM template is verified before execution, and creation of resources occurs in parallel while taking dependencies between them in consideration (i.e. they are created in the right order). If an error occurs, it’s easier to rollback everything than with shell scripts. ARM templates are a repeatable way to deploy entire environments.

Note: Azure PowerShell and Azure CLI scripts can trigger ARM templates, and vice versa.

Serverless

This section is a summary of the Choose the best Azure serverless technology for your business scenario module.

Azure Functions can execute a single function.

  • They run in response to an event, such as a timer, HTTP request, or a new message on a queue.
  • They can be written in different programming languages including C#, Python, JavaScript, TypeScript, Java, and PowerShell.
  • They scale automatically.
  • They accrue charges only while they are running, based on number of executions and running time of each execution.
  • By default, they are stateless (they don’t normally keep state between executions).
  • Durable Functions are an extension allowing state to be preserved, and are used for more complex workflows involving multiple functions.
  • You just write the code and don’t manage any underlying infrastructure.

Azure Logic Apps:

  • Are a low-code/no-code service for automation and business integrations.
  • Are designed in a web-based designer.
  • Have triggers (events) that trigger actions (logic) via connectors.
  • Over 200 connectors are available to work with existing systems such as Salesforce, SAP, Oracle DB, etc.
  • You can also write your own connectors.
  • Billed based on number of executions and the type of connectors used.

Azure Functions and Azure Logic Apps can call each other.

Internet of Things (IoT)

This section is a summary of the Choose the best Azure IoT service for your application module.

IoT gathers data from devices in a backend system for processing and analysis. In this space, devices usually gather physical data via sensors, such as temperature or GPS. The devices can also be issued commands or have their firmware upgraded via an administrative portal.

Azure IoT Hub acts as a central message hub, allowing the backend IoT application and the devices to communicate in both directions. This includes command and control, where devices are controlled and issued commands directly. IoT Hub also tracks events such as device creation, failures and connections.

Azure IoT Central is another service providing a UI or dashboard on top of IoT Hub. It is a more complete solution and comes with starter templates to quickly get up and running, without writing any code (except for that which would run on the devices themselves).

Azure Sphere is an end-to-end IoT solution suitable for scenarios requiring the highest levels of security. This is based on three items:

  • The Azure Sphere micro-controller unit (MCU) which runs the operating system and processes signals from attached sensors.
  • A customised Linux OS that handles the security service and can run the vendor’s software.
  • Azure Sphere Security Service (AS3) ensures the security of the device by enforcing certificate-based authentication when the device connects to Azure, and checks for tampering. It also pushes any OS or other software updates to the device.

Devices based on Azure Sphere can talk to other Azure IoT services once they have been authenticated by AS3.

"You don't learn to walk by following rules. You learn by doing, and by falling over." — Richard Branson