Tag: web development

  • A DevSecOps Process for Node.js Projects

    A DevSecOps Process for Node.js Projects

    Node.js is an open source development platform for running JavaScript code on the server side. Node is useful for developing applications that require a persistent browser-server connection and is often used for real-time applications such as chat, social applications, or news feeds. 

    DevSecOps is a way for development, security, and operations teams to work together throughout the project life cycle. It is often implemented by adding security to existing DevOps teams and agile processes.

    The idea behind this collaboration is to incorporate security early in the development process. This is called shifting security left. As security moves to the “left” of the development process, application vulnerabilities and bugs are discovered and addressed faster. This leads to more secure product releases with a reduced need to apply patches and troubleshoot in production. Applying DevSecOps to Node.js development can improve both the efficiency and security of Node.js projects.

    Common Node.js Attack Vectors

    Here are a few cyber threats that affect many Node.js applications.

    Cross-Site Scripting (XSS)

    XSS attacks inject manipulated client-side JavaScript code. Web apps are vulnerable to XSS if they don’t validate inputted hostnames from the DNS. Attackers can use forms to enter malicious scripts and hack into the system. In some cases, entering code into the filename can trigger cross-site scripting in the target browser. 

    A hacker can use your file upload form to hack into your system. There are many ways for this vulnerability to lead to a system compromise. Though usually mitigated by modern front-end frameworks, in some cases it may happen that putting javascript into the filename will trigger XSS in a user’s browser, allowing the theft of session IDs. In other cases, an attacker might get sensitive server information by uploading a file to the Node.js server and running it by exploiting a path traversal vulnerability.

    Code Injection

    Developers are responsible for writing secure application code, but it’s impossible to fully guarantee the code’s security when using open source components. A code injection attack involves injecting malicious code into the target system and forcing the application to execute it, allowing attackers to access the codebase. Inadequate data validation often results in code injection vulnerabilities.

    Default Cookie Names

    Cookies help web apps identify specific users by storing user actions in the underlying infrastructure (e.g., an eCommerce shopping cart that remembers the items a customer selects). 

    Developers should use custom names for cookies (rather than defaults) to prevent attackers from identifying and targeting cookies and extracting data. 

    Brute Force Attacks

    Brute force attacks often affect Node.js applications. An attacker randomly generates millions of passwords to find one that works, logging in to the application. You can prevent brute force attacks by strengthening the authentication mechanisms, limiting the number of permitted login attempts from a single IP, and encrypting stored passwords (using bcrypt.js).

    Cross-Site Resource Forgery (CSRF)

    This type of session hijacking forces an authenticated user to execute malicious actions on the target web application. The attacker hijacks a legitimate user’s session to bypass security controls and change the application’s state. CSRF can force users to transfer funds or change their account details, potentially compromising the web application’s security. 

    Node.js Security Best Practices

    Implement Strong Authentication

    A compromised, weak, or incomplete authentication mechanism is a common vulnerability. Many developers think of authentication as something that “just works”. However, authentication can easily be bypassed by attackers if not implemented correctly.

    In Node.js, you have the option of using the default Node.js authentication solution. There are a few things to keep in mind: 

    • Do not use Node.js’s built-in password library when generating passwords, use Bcrypt. 
    • Limit failed login attempts and do not notify users if their username or password is incorrect. Instead, return a generic “Invalid Credentials” error. 
    • Have a robust session management strategy. 
    • Implement two factor authentication (2FA). This can be done using modules like node-2fa.

    Alternatively, use one of many third-party solutions available for application authentication, which may be superior to built-in Node.js functionality. 

    Avoid Errors That Reveal Too Much

    There are many things to consider when building error handling functionality: 

    • Don’t give the user any details they don’t really need. Never return the entire error object to the client. It may contain information that you do not want to disclose, such as paths, other libraries you are using, or secrets. 
    • Wrap the path in a catch clause so that Node.js doesn’t crash if the request triggers an error. This prevents the app from crashing continuously, allowing attackers to send malicious requests that cause the app to crash.
    • Don’t expose your Node.js app directly to the internet. Use a component like a load balancer, cloud firewall or gateway. This means DoS attacks will be one step removed from your Node.js application.

    Using Security Linters to Capture Vulnerabilities in Code

    Code linters help identify various issues in code before compiling. They let you detect the most common issues and ensure you follow best practices.

    Code linters have their own rules, which you can customize according to your requirements. Before using a linter, make sure you enable rules related to security vulnerability detection in the linter configuration.

    Server-side Logging and Monitoring

    A good logging library provides developers with powerful troubleshooting and monitoring capabilities. On the other hand, unnecessary or excessive logging affects application performance and consumes more resources. Therefore, you should only use reasonable log levels when deploying applications to production environments.

    When constructing log messages, they must be in a format that can be read and understood by humans and machines. Logging ambiguous messages can lead to misunderstandings among developers. An error message must not only describe the problem but also advise what the user can or should do to fix it.

    It is also important to ensure that your logging mechanism captures all relevant information such as IP addresses, usernames, and actions taken. 

    Never retrieve or store sensitive information in application logs. This violates compliance standards such as PCI and GDPR. However, there are times when you need to record this information for troubleshooting – in this case, it is recommended to mask or anonymize sensitive information before writing it to the log.

    Implementing Node.js Security in a DevSecOps Organization

    Node.js security best practices are well known and security awareness is growing among Node.js developers. However, many organizations don’t have a clear organizational structure for implementing development best practices. Here are a few steps your organization can take to transition a Node.js development team to a full DevOps model:

    1. Adding mandatory guard rails for developers

    For example, adding static application security testing (SAST) within the IDE and on every commit. Linters should be deployed centrally with a consistent configuration for all developers in the team.

    1. Automated security testing in staging environments

    During the CI/CD process, when a Node.js application is deployed to a staging environment, there should be automated tests that can identify security misconfigurations and integration-related vulnerabilities. Dynamic application security testing (DAST) tools are ideal for this purpose.

    1. Runtime protection

    No DevSecOps process is complete without a safety net to identify security issues in production. This requires the use of tools like web application firewalls (WAFs), which can detect and block malicious traffic, and runtime application self-protection (RASP), which can proactively respond to attacks. Both these tools provide feedback to DevOps teams to help them identify and remediate vulnerabilities in the underlying application.

    By implementing these three stages, you can be sure that Node.js security is not just an ad-hoc practice but a formalized, coordinated process involving developers, operations teams and security experts. 

    Conclusion

    In this article, I explained the basics of DevSecOps and how to secure Node.js:

    • Implement strong authentication—In Node.js, you have the option of using the default Node.js authentication solution.
    • Avoid errors that reveal too much—Don’t give users more details than they actually need when displaying errors.
    • Using security linters to capture vulnerabilities in code—Code linters help identify various issues in code before compiling.
    • Server-side logging and monitoring—A good logging library provides developers with powerful troubleshooting and monitoring capabilities.

    I hope this will be useful as you implement Node.js security in your DevSecOps organization.

  • Using Internal Wikis for Web Development Projects

    Using Internal Wikis for Web Development Projects

    A team-based web development project is always a complex endeavor. It involves different developers with varying levels of experience, different fields of expertise, milestones to accomplish and a timeline to achieve.

    To facilitate the sharing of information, it’s not always enough to use project management tools like Asana or Jira. Sometimes, a wiki may be needed to help distribute knowledge and best practices to everyone working on the project.

    In this guide, we discuss the practicality of using wiki tools for information sharing among web devs.

    What is a Wiki?

    A wiki is a program that enables users to collaborate in the creation and population of the content for a website. The word comes from the “wikiwiki,” which is Hawaiian for “fast.” In other words, a wiki is an app that allows for crowdsourced content to create pages of information.

    In addition to wiki pages, Web 2.0 tools allow users to connect and share information via rich media such as RSS, OpenSocial and OpenID. Another use for wiki tools is to share creative content such as photography and design concepts. A very simple way of sharing web pages on the wiki is to add a share icon at the top of the page. Simply add the share icon to a wiki page.

    The Benefits of Wikis

    Wikis bring a number of benefits to web dev teams, such as:

    Knowledge Sharing

    Since people working on the project have different levels of expertise and experience, the wiki allows subject matter experts to contribute information based on their specialization. This valuable knowledge can be accessed by others who need such information and dispels the formation of “information silos” that usually impede teams working in isolation from each other.

    Searchable

    The information stored in a wiki is categorized and organized in hierarchical and logical structures. It allows users to easily search for information based on topic, field or category, and learn what they need in an instant. This improves productivity and minimizes the need to chase other colleagues down in the search for data.

    Single Source of Truth

    By acting as a central repository of information, all data gets vetted before making it into the wiki. This makes the stored information verified and accurate and the wiki acts as the single source of truth for the whole team.

    Easy Updates

    The wiki allows contributors to update information easily and conveniently. As such, all references are up-to-date–a critical factor for any web dev project.

    Wikis and Web Development

    Wikis have the potential to make it easier to share knowledge with stakeholders as well as spread the expertise of a motivated development team, leading to better management and accountability. 

    Many wikis are publicly funded in different ways. For instance, several open source wikis exist, such as BikiWiki, ObjectiveWiki, GrowWiki and PDFLabs wiki, but we can see a few web-based initiatives in this space as well. These include Virgil Technology wiki and KnowledgeVerify.

    Microsoft’s SharePoint platform is arguably one of the best solutions for online collaboration on web-based projects. Because SharePoint is integrated with almost all major applications (Windows, Word, Excel, PowerPoint, etc.), users can create shared webpages based on SharePoint site templates and share these with their colleagues. While it’s true that SharePoint cannot solve all the problems related to information sharing and preservation, it provides a great starting point for finding common ground on project development.

    The Advantage of Wikis Over Other Collaborative Tools

    While project management tools usually incorporate collaborative functions, they are not as full-featured as a wiki is when it comes to knowledge sharing. The wiki is notable for having the following features that other tools may lack:

    Search functionality: Wikis have full-featured search capabilities to aid in the search for information. No need to drill down tree structures and categorical hierarchies.

    Comments: Adding comments to a page is an efficient and fast way to contribute and help others.

    Content creation: You can write wiki articles using any text editor, or you can write it using the wiki syntax—it largely depends on the platform. The wiki syntax is quite similar to the HTML format. One thing that makes wikis useful is that when you share a wiki page, everyone can see the changes as they are made. So sharing works through a web link instead of having to publish to a file.

    The wiki markup is a sequence of tags that represent the structure of a page. There are two main types of wikitext; the wiki syntax and the HTML syntax. The wiki syntax comes from Wikipedia, which is a popular wiki. Both are immediately available to devs, making content creation and editing easier.

    Access control: Since wikis can change based on edits and the number of links get added to the pages, they use an access control and version management system.

    With its growing array of software options and constant framework decisions, the world of web development always needs quick, organized patches of information. Rapid creation and publishing options mean that, for an almost 20-year-old technology, wikis can still be a valuable tool for web devs today.

  • 8 Web Development Trends to Follow

    8 Web Development Trends to Follow

    Since the inception of the internet in 1983, many web development tools have been introduced to simplify complex processes that would otherwise take months to finish and cost companies a great deal of money.

    According to internet live statistics, over 1.5 billion websites and more than five billion active daily internet users visit multiple sites around the clock. That number is expected to grow as businesses (and website owners) offer personalized experiences to users, make their websites more user-friendly and introduce navigation that visitors prefer.

    Website development has changed and is still evolving quickly. As a website owner, it’s imperative to watch out for new trends that are being introduced in the industry. Neglecting to adopt current trends might affect your website’s functionality, user experience and network. You risk falling behind your rivals and losing visitors to websites with superior user experiences and network scalability.

    The best way to maintain competitiveness is to make sure your website is consistently updated, fresh and that it follows current trends. Here are eight to watch out for.

    Progressive Web Apps (PWAs)

    PWAs speed up website loading times and enable offline functionality in multiple applications. PWAs have already been used by businesses like Starbucks, Uber, Pinterest and Twitter to improve user experience.

    It is crucial to transform web apps into PWAs, given the increased shift toward smartphones and tablets for various online functions. PWAs offer a superior user experience, increased engagement and conversion rates and lower development costs.

    Motion UI

    Motion UI is used to create fully responsive site designs. Motion UI enables developers to produce motion in a native app environment, and with a built-in motion, it can be used for any design project. A website needs to be appealing and offer the information a user seeks. Your target audience is more likely to notice websites that look good.

    Motion UI is easy to implement as the developer doesn’t need to be an expert in JavaScript. It also assists people in finding the precise information they need and improves the effectiveness of site design.

    Privacy Center

    Privacy is a core component of ensuring your customers have a safe user experience when navigating your website. Privacy Center is an intuitive way of cataloging your privacy policy and notices, terms of service, cookie policy, refund policy, data subject requests and more on a single page.

    Privacy Center enables users to obtain information regarding a company’s data activities from a single source without having to navigate multiple pages and scroll through endless paragraphs to identify the information they need.

    Privacy Center is a growing trend for web developers as data privacy laws impose strict obligations on companies, necessitating the need to implement intuitive privacy centers that address all concerns of users.

    Dark Mode

    Although dark mode was first introduced in 2016, it wasn’t until 2020 and 2021 that it gained popularity as a standard practice in web building. Essentially, dark mode refers to a site’s color scheme. In other words, the website has a darker background with light-colored text and other UI elements.

    Dark mode typically lessens eye strain, especially in dim lighting. When dark mode is used instead of light mode on a mobile device, it uses less battery. People with light sensitivity or vision impairments have also found it to be beneficial.

    Accelerated Mobile Pages (AMP)

    Accelerated mobile pages, better known as AMP, is an initiative that resulted from Google and Twitter working together to provide quicker mobile pages. Pages that are AMP-optimized load quicker, thus ranking better than pages that take more time to load. Compared to non-AMP pages, which may take up to 22 seconds to load, AMP pages do so in roughly two seconds.

    In web development, AMP is a simple search engine optimization method that reduces bounce rates, adapts to any browser and doesn’t need sitemaps to be discovered by search engines.

    AI Chatbots

    AI chatbots are intuitive, enabling businesses to operate more quickly over voice or text chats while enhancing the consumer experience. The technology provides a more human-like experience to visitors with the help of machine learning (ML) and Natural Language Processing (NLP) that understand the user’s intent and responds accordingly. Many well-known enterprises already use AI chatbots to communicate with their clients.

    Industry experts predict that AI chatbots or self-learning bots are the way of the future, and organizations can save money by using them instead of human customer support representatives, especially for simple queries and FAQs. AI chatbots are a long-term investment as they process orders, respond to users’ questions, connect them with the relevant department and quickly resolve any complaints, resulting in an improved user experience.

    Voice Search Optimization

    The practice of optimizing web pages to show up in voice searches is known as voice search optimization. Voice assistants and the internet of things (IoT) have helped voice recognition devices become increasingly widespread.

    Google launched voice search in 2012. Since then, the market for voice search tools—such as virtual assistants like Alexa and Siri—has seen exceptional growth. The trend is only expected to grow since virtual assistants are not currently being integrated into many internet-enabled devices.

    By 2023, eight billion digital voice assistants are predicted to be in use worldwide. Due to this enormous expansion, voice search optimization will become indispensable among the newest web development technologies.

    Push Notifications

    When users browse, push notifications—clickable pop-ups—appear before them. Companies employ this technology as a speedy route for communicating information, such as promotions and announcements. Push notifications can be integrated on any device, including laptops, cellphones and tablets.

    Push notifications are an effective tool that significantly improves users’ experience, drives visitors to your website, improves click rates, aids in grabbing users’ attention and improves conversion rates. Web applications from internet behemoths like Facebook and Google already use the technology.

    Conclusion

    Though it has been around for decades, web development continues to innovate and improve as organizations strive to influence the future delivery of web experiences. To give your users the best experience, raise the search rating of your website and reach new heights, it is crucial to keep up with these trends.

  • The Risks of Shadow Code

    The Risks of Shadow Code

    As the economy struggles to recover after the last two years of the COVID-19 pandemic, we have all learned a thing or two about supply chains—and what happens when they break down. But many people do not realize that modern websites also have digital supply chains, third-party ones that can be compromised in myriad ways. And just like the disruption of the physical supply chain affects things like pricing, availability and inventory, digital supply chains found on today’s websites play a big role in critical areas like site performance, customer experience and overall analytics. As a result, businesses today need to be aware of how the digital supply chain can introduce significant risk, especially when third parties do not adhere to their own set of stringent standards around security and compliance.

    According to a recent study by Source Defense, organizations that collect and use sensitive data—such as health care, finance, travel and online retailers—need to strengthen their focus on third-party risk management. As a result of mandates like GDPR and PCS DSS, these companies are now bound by compliance requirements to ensure their client-side threats are avoided and/or mitigated. This effort means recognizing more than just how to protect private data—it means understanding the properties of malicious code known as “shadow code” on modern websites and how it generates risk from dynamic and unpredictable scripts. Companies dealing in data today need to be aware of the different ways shadow code can affect their security, as well as the productivity and integrity of their DevOps teams.

    Third-Party Scripts and Shadow Code

    Shadow code refers to code that is baked into an application without proper vetting by the website’s IT department. This malicious code thrives in the cloud landscape, primarily because it allows for ease of deployment through CI/CD automation.

    When a web page calls in a third-party script, it loads directly into the browser from a remote server, which means general security controls such as firewalls and network monitoring tools are bypassed. And if one of these scripts has been compromised by a bad actor, shadow code can be embedded within. Sometimes these scripts include open source software that hasn’t been tested well—or at all. Other times, the code may be pulled from another layer of the organization where malicious code is hiding.

    Shadow code presents an array of threat opportunities, including the ability to mount an attack through digital supply chain partners. When these compromised scripts are used to steal data, redirect web traffic,or any other malicious activity, a clear path is essentially created into thousands of different websites, in almost every industry that collects data or deals in digital transactions. When a third-party script with shadow code enters a system, it gains the ability to:

    • Record keystrokes
    • Redirect visitors to malicious websites
    • Monitor clicks and track website activity
    • Change content on websites, including images and text
    • Steal credentials, such as personal logins and social security numbers

    As we know, these digital activities can lead to big consequences, like data breaches, fraud, theft, compliance violations, loss of reputation and hefty fines. Although code reviews can provide some software quality assurance, the process is not effective against shadow code, mostly because these scripts are constantly altered by third-parties. And when the threat is underestimated and unattended, these malicious scripts have the potential to permeate every area of a company’s web property.

    Because the benefits of using these types of third-party scripts are considerable, it can be hard to find a modern enterprise or agency that does not rely on at least a few to run web applications. In fact, many enterprises and government agencies today are running third-party scripts on every page of their sites. Even though these organizations are technically not responsible for this harmful code, regulators can (and do) hold web property owners accountable for any digital maleficence on their sites.

    DevOps Teams and Shadow Code

    Websites can provide rich experiences to visitors largely because developers use client-side JavaScript to improve the look and feel of these digital properties—all without the need for ongoing maintenance. Today, DevOps professionals can access vast libraries of these free and low-cost scripts from many different sources, such as allied coder groups, open source organizations, social media companies, web analytics firms, content delivery networks and more.

    But the reality is, code libraries accessed by DevOps teams are not always secure or trustworthy. Considering these packages often contain code from fourth and fifth parties, DevOps folks face the unavoidable possibility of tainted code—hard to identify and dangerous to use. In fact, the Source Defense report revealed that one in four scripts represented fourth- or fifth-party code, on average. Because developers tend to focus on keeping their code updated and as capable as possible, they often pull from the dynamic library from their repository. If there is a CI/CD process happening, DevOps teams will pull their library from that point. This is where shadow code introduces new vulnerabilities for developers.

    Shadow code also jeopardizes the integrity of DevOps work. Most developers take pride in what they do and are not interested in creating unsecure or low-quality code—not purposefully, anyway. And given that speed, productivity and constant innovation are all business goals for DevOps teams, it’s important to recognize how problematic shadow code can be for those in the business of building secure and high-quality software.

  • Jamstack Will Revolutionize How Websites Are Built

    Jamstack Will Revolutionize How Websites Are Built

    Today, every organization wants a website that loads quickly and looks sharp. The reasons go much deeper than cosmetic motivations, though—even a slight delay in loading can cause users to exit a page prematurely and site performance plays an important role in search engine rankings. Meanwhile, threats like ransomware and phishing are everywhere and are constantly evolving, requiring organizations to look for more ways to improve site security and protect user data from bad actors. Then, of course, there’s the need to quickly and easily scale websites to meet sudden spikes in demand. The need to adapt quickly has become especially apparent over the last two years as we have come to rely on the internet in new and profound ways compared to pre-pandemic times. Fortunately, a relatively new but popular approach to web development—Jamstack—is taking websites to a nearly infinite level of scalability and performance, serving up only what you need, when you need it. To understand the value that Jamstack brings today, it’s helpful to take a look at how we got here. 

    Throughout the history of the internet, web and database servers were the primary infrastructure for site hosting. When websites got more complicated, another layer, called the application tier, would take on more complex aspects of the site (like an API, for example). As traffic increased, web servers were scaled out to add capacity with the help of load balancers. Scaling in this manner wasn’t always easy or cost-effective, given how unpredictable consumer demand and spikes in traffic often are. Later, content delivery networks (CDNs) came into the picture, taking a load off web servers by pushing static content to the edge. But, for most traffic, the origin servers would still have to be ready to serve site visitors. In this approach, website development and management were often costly and difficult to scale, and sites faced constant security risks. 

    Enter Jamstack. With Jamstack, all site content sits on a CDN, ready to be served. Web pages are pre-rendered instead of being rendered in real-time (as was the case in pre-Jamstack days). As such, content is closer to the end user, pages load faster and sites can easily scale up or down to handle unexpected shifts in traffic.

    Jamstack represents an exciting and fundamental shift in how we have traditionally approached web development—one that is inclusive of the needs for performance, security, availability and scalability and at a much lower cost to the developer. It’s no surprise that Jamstack has taken the web development world by storm over the last couple of years; in 2020, the number of sites developed with Jamstack jumped 85% from the year prior. Here, I’ll share some basic tips for getting the most out of Jamstack.

    Adding Dynamic Features to Static Sites

    Jamstack starts with the idea of a static site—pre-building as much of a site as is practical—and incorporates dynamic elements to achieve fast websites with fewer attack vectors. The term, which was coined in 2015 as JAMstack, derives from: 

    • J = JavaScript, the website’s programming language 
    • A = APIs, which enable dynamic content on an otherwise static page
    • M = Markup, which is the HTML and CSS code that provides formatting instructions to the browser 

    By combining these three elements, Jamstack allows developers to quickly create and maintain websites that can be served efficiently to users. A static site renders well for mobile, web and video while relying on APIs for dynamic features. High page speed is achievable by pre-building as much of a site as possible and then using a CDN to deliver the page to users around the world. When a user visits a website, they see a pre-rendered page delivered by the CDN with no dedicated servers needed.

    Notably, the page’s static nature does not require the content to be static. Leveraging third-party APIs can enable dynamic content such as search, payment processing and real-time data. This modular approach allows for flexibility and avoids vendor lock-in—swapping out different APIs as technology changes and new tools become available is easy. The ability to integrate with serverless functions also lends itself to Jamstack sites becoming more dynamic.

    Without the need for web application servers and database servers, Jamstack pages scale well as visitors increase, improving both the experience of the visitor and the organization’s bottom line.

    In essence, a Jamstack site has no backend that needs to be managed by a developer. The static nature of the page means there is no link between the website and a database, which reduces the security attack surface. Since all site elements are delivered from the CDN or an API, potential attackers aren’t able to hack web application servers or database servers.

    When an organization creates a website with this approach, there are no servers to maintain and no staging environments to create, so there is less of a need for complex DevOps resources. Jamstack’s simplicity means there are fewer moving parts than in a traditional site and less room for error. Because of this decoupling between the frontend and backend, Jamstack sites are faster to launch and more reliable.

    Another advantage of the static setup is that reverting to an earlier version of a page is simple. This is possible through the concept of atomic deploys, where the entire site is updated at once, creating a new version. With Jamstack, developers have more freedom to experiment and avoid the tiring trial and error of traditional sites—if something does not render as intended, switching the entire site back to a previous version is painless. 

    Assembling a Jamstack Toolkit

    Jamstack’s tools, processes, and best practices are evolving rapidly, and an important part of diving in is remaining open to experimentation and tracking emerging developments. Getting started is simple since Jamstack integrates with existing workflows and many organizations have established relationships with vendors already in place for key technologies, speeding up the decision-making process. These technologies include:

    • CDN: To deliver pages from locations close to users—a requirement for achieving fast performance. 
    • Static site generator (SSG): To generate the site using raw data and templates—automating the process of coding pages and ensuring they are pre-built and ready for users.
    • Content management system (CMS): To act as a content repository. A CMS for a Jamstack website is described as “headless,” which means that content is stored outside of the codebase and delivered via APIs for seamless display across different devices.

    Expanding the Value of Jamstack

    We are still in the early years of Jamstack’s maturation, and not all deployments are equally effective. For example, some Jamstack platforms are hosted out of centralized data centers coupled with a CDN, which slows performance relative to delivering sites directly from the edge. Some Jamstack hosts also charge more to add developer seats, which discourages collaboration among large teams and can result in unpredictable pricing. 

    Regardless, Jamstack is one of the best technological solutions to come to developers in recent years and one which will surely influence the future of web development. Not only does it make websites faster, more secure, and easier to scale, but it builds on many of the tools developers already know and love—empowering them to achieve their maximum productivity.

  • Can Web 3.0 Solve the Linkrot Crisis?

    Can Web 3.0 Solve the Linkrot Crisis?

    Data on the web is more ephemeral than you realize. A recent examination of linkrot and content drift by Harvard Law School found that as time progresses, web-based content is becoming more and more lost. By analyzing half a million links within New York Times articles, 6% of deep links from 2018 were found to be inaccessible, and 72% of links from 1998 were completely dead.

    The rotting web could have severe consequences that affect society’s collective understanding. Consider links used to substantiate pivotal arguments in the course of law. Studies now show that 49% of hyperlinks in Supreme Court decisions no longer function. The linkrot situation undermines humanity’s shared intelligence, which the Internet once promised.

    So much of the content on the web is outdated, inaccurate or has changed its URL destination, a problem known as content drift. Therefore, band-aids like the Wayback Machine internet archive have risen as a steward of the historical web archives. However, some proponents in the industry argue we need a more modern, decentralized, immutable reference for this historical data. You may have guessed where this article is heading—blockchain.

    I recently met with Jonathan Victor, Protocol Labs, to see how Web 3.0 and blockchain might be used to solve the linkrot endemic. According to Victor, smart contracts that reference canonical URLs could help create a more resilient web. This would, in effect, require a peer-to-peer model with shared ownership and incentive models to sustain content longevity.

    The State of Linkrot

    The longer data sits, the higher the likelihood of losing track of it. Forgotten databases and rising data storage costs can easily lead to whole networks of websites and user data being accidentally (or intentionally) destroyed. Putting so much faith in private companies to preserve data indefinitely is not viable, explained Victor.

    Public data isn’t really as public as you think it is. And older, user-generated content is often the first domino to fall. For example, a massive amount of media on MySpace was deleted in a botched server migration in 2015. In 2021, Yahoo Answers similarly erased 16 years of user-generated content in its shutdown. Surprisingly, users have little ownership or control of their data on forums and social media. A ban on Twitter, for example, could result in inactive links within posts.

    When an article points to a website, this imbues an implicit dependency on an external organization to keep the domain live, said Victor. The second dependency is on the domain owner to keep content unchanged. “If we can talk about content and how to reference it in a different way, maybe we can create references that are much more resilient,” suggested Victor.

    How Web 3.0 Can Help

    One way to solve the linkrot issue is to create a ‘fingerprint’ for web resources. This could be a canonical reference to specific pieces of content. Organizations would store and retrieve content based on a hash of that contract itself, Victor explained. Such a system would likely require an incentive-based, non-exploitative, decentralized network where web users own their data and control who profits from it.

    Some have coined this concept Web 3.0. Victor describes Web 3.0 as a broad classification of distributed technologies and tools that enable a peer-to-peer internet underpinned by blockchain.

    For example, one open source project spearheading progress on this front is IPFS, the InterPlanetary File System. IPFS is a peer-to-peer hypermedia protocol that uses blockchain to store cryptographic hashes. The project is “designed to preserve and grow humanity’s knowledge by making the web upgradeable, resilient and more open.” With IPFS, a client requests content using the hash and retrieves content. IPFS is based on Filecoin, a permissionless storage network.

    Benefits

    A decentralized nature fits the original goal of the open web, allowing creators to own and share content horizontally. If you can decouple data storage and retrieval from a specific location, it gives you an impressive ability to rearchitect modern communication, said Victor. This could have a number of benefits:

    • Redundancy: First off, a major benefit is the redundancy of data. Distributed nodes assure data is globally available and temporally accessible. Resources are in multiple locations, ensuring better global availability and temporal persistence.
    • Incentives: An incentive-based decentralized network could use block rewards to subsidize costs, helping fund storage initiatives. Building on the blockchain can also ease payment acceptance aspects — great for donation-based data hosting groups.
    • Efficiency: By using smart contracts, you can programmatically handle storage requests. “Blockchain gives you higher-level primitives to run this stuff automatically,” said Victor. This helps tie on-chain activities to real-world storage, Victor added.
    • Low-cost: It can be cheaper to store content on distributed networks than a typical cloud provider. Impressively, Victor estimated it would cost 1/1000 of the cost of Amazon. A distributed environment could also bring speed gains; similar to torrenting, seeding from distributed sources increases speed in orders of magnitude, said Victor.
    • Communal ownership: Such a model could spur more communal ownership for some content. This could benefit public-good assets that don’t have a clear owner. According to Victor, this aspect especially benefits universities and open source data initiatives that rely on public support to function.

    A Compelling Problem

    Constructing a new peer-to-peer Internet obviously has significant barriers. Namely, a decentralized structure requires a large group effort, and this community action may be difficult to encourage, let alone coordinate. It will also require consolidation around open standards and protocols, as many different decentralized projects crowd the scene. Shifting pre-existing architectures to this new style could also introduce roadblocks.

    “A lot of content on the internet becomes a public good,” says Victor. Yet, perpetual access to this content is fickle, even for well-established online communities. Some research has found the average lifespan of a website to only be 100 days. Hosting fees or accidental failures are often root causes for the loss of data.

    The fragility of the web is an issue that will take not only innovative development effort, but a radically new mindset to tackle. “It’s a really compelling problem,” added Victor. Using blockchain-based smart contracts to store canonical references for content is one proposed solution. But Web 3.0 is in a primitive stage, and to progress, it will take significant community action.

    Doing so in a way that is sustainable will be the trick. Open standards and blockchain-based protocols could allow the technical means for such a network to flourish. And a cryptocurrency backing could help incentivize participation and provide a means of funding. This decentralized non-ephemeral storage could help enable perpetual storage for the web’s most precious resources.

  • Languages and DevOps: Web Development

    Languages and DevOps: Web Development

    Web development has changed a lot since DevOps first hit the scene. The languages used have shifted, where languages are used has shifted, the likely back-end hosting environment has changed – but DevOps has folded these issues in and just kept plugging along.

    We’re going to approach this from two angles – what languages you’re likely to use, and what DevOps offers. This is not a “Best Billion Web Development Languages for 2021!” article; there are plenty of those out there, and you are more than welcome to read them. This is more about using these languages in a DevOps environment, which has become standard for web apps more than any other type of development.

    We’ll start by observing that your web app is, more than likely, going to have at least three parts – HTML, CSS and JavaScript. This is not news to those of you doing it daily, but we’re just setting the bar, here. Other languages may be used to generate or populate any/all of the above, but, in the end, these three languages get sent to the browser, so will be part of the equation.

    Backends add an incredible amount of complexity to this equation. I’ve done Ruby backends that did most of their work in C++ and Java; I’ve done pure Java backends that spit out the required three components; I’ve done Node backends that had very little actual HTML/JavaScript source code, but generated a ton of both – it’s all there. And the hosting environments for backends have changed. When DevOps started, most hosts were virtual machines (VMs) or hardware, whereas now we’re mostly running cloud instances or containers. Those backends have to be configured and managed, too, along with all of the dependencies that your application requires. When you think about it, we really have created quite a messy environment.

    But DevOps has risen to this challenge.

    I’ve long been an Atlassian fan, and find them to be a great tool for managing the agile side of DevOps. Add in Ansible, for the operations side, and you have a good thing going. I recently looked into GitLab, and GitOps – through GitLab – offers a compelling alternative to Atlassian’s offerings; more so since Atlassian made some rather unpopular changes right about the time I was wrapping up my look at GitLab.

    The key is that Git holds all the code. By adding in the scripts to spin up those increasingly complex backends and secure the entire infrastructure, you get an “App in a (virtual) box.” No matter what DevOps toolchain you use, tying this in is simple, because it already works well with Git and associated tools.

    Developers tend to care more about the development side of the equation (imagine that!), so let’s talk a bit about what’s going on out there.

    PHP is hanging on solidly, with a bulk of applications and (perhaps more importantly) libraries to keep it in the running. PHP is one of the original “generate an HTML page” languages, and is slowly being displaced. It isn’t a bad choice for your web projects, but it isn’t the only – or at this point, the most popular – choice.

    Java is still somewhat popular, and while it offers good support for web development, it is … heavy? Is that the word? It’s something for this type of development, and has ceded ground to other languages when it comes to pure-play web development. The skills are transferrable to other targets, so it is a good broad-use language. Like the other serious players in this space, there are web-centric libraries and frameworks that make Java hum. I’m a fan of Spring, but the options are pretty broad.

    JavaScript wins this race today. It is used on both client and server, there are a ton of developers and DevOps people available who can be productive in JavaScript from day one, and it is increasingly used in other contexts – meaning skills could transfer to other projects. Like any language, there are trade-offs, but the portability aspect makes the trade-offs things that many are willing to work to overcome. Libraries and frameworks abound to make JS development faster and more dynamic. Personally, I like Node for server-side development, and Angular for clients that need more than straight HTML/CSS offers (probably because it’s the one I’ve used the most).

    Python is definitely a contender in this space, as it is in most others today. With Django (or whatever your framework of choice), it functions well for web development, and its popularity has given it a host of support libraries to get things done. Developers are easy to find, and skills are broadly applicable, as Python is used in most areas of Dev and Ops at this point.

    Windows aficionados are still using C#, and it does have good hooks into Microsoft DevOps tools, so any Microsoft shop should include it in evaluations. I’ve done C# on Azure for web apps, and for me it was … different, but not broken. In a Microsoft shop, C# will be familiar, and at this point, most developers are familiar with web clients, so merging the two is only a tiny bit of a learning curve, but not a major one.

    Ruby does seem to have ceded its spot to Python. It is unlikely you’ll find a steady flow of ruby developers to fill those positions, but it is a highly intuitive language that you can train Java, and even Python developers in, if necessary. Ruby is well-supported for web development; indeed, it feels more natural using Ruby for web work than command line tools (at least to me, YMMV). There are web frameworks to make Ruby more intuitive in web development, and jRuby offers deep integration with Java to make use of already existing Java classes.

    All in all, JavaScript should be the strong contender for a new project today, but any of these tools will serve the need. They are all well-supported, and DevOps tools start with integration to most of these languages. Do what’s best for your environment, and keep rocking it.

  • JAMstack Boards the Enterprise

    JAMstack Boards the Enterprise

    Set course for development via JavaScript, APIs and Markup. Engage.

    In recent years, the JAMstack web development trend has garnered interest among front-end web designers. A 2020 study by Netlify found 1 in 3 sites serving a million users use JAMstack.

    JAMstack has been viewed as a development style for blogs and startups, but lately, some proponents believe it’s time for enterprise adoption. So, what benefits could JAMstack and serverless offer enterprise architecture? I recently talked with Ryan Coleman, vice president of engineering and product at Stackery, to find out.

    Defining JAMstack

    First off, what is JAMstack? JAM stands for JavaScript, APIs and Markup. It’s is a new(ish) style for building websites and applications based on modern tools and serverless web architectures. We’ve seen its adoption grow exponentially within the last five years or so.

    As defined at jamstack.org, JAMstack enables fast and secure sites that pre-render files directly from a CDN. This avoids tight-coupling between the client and the server, also known as headless. Applied in the right context, it can bring performance, security, scalability and developer experience benefits.

    Admittedly, there is some variation on implementation of this style—PayPal’s Jamund Ferguson simply calls them static apps—but, “the thing that they all have in common is that they don’t depend on a web server,” noted jamstack.org. Jekyll, Hugo, Nuxt, Next and Gatsby are among many JAMstack frameworks and static site generators, and many adopters are listed here.

    JAMstack Benefits

    No longer are IT teams operating a web farm. Rather, they are shifting the process of interacting with live web servers left. According to Coleman, JAMstack is more aligned with these modern practices across the board. Therefore, he sees many potential benefits for its use within enterprise environments.

    Serverless

    With JAMstack, web pages are built during the build process attached to a CDN pipeline. “Instead of running a server farm, you are externalizing it,” notes Coleman. “It’s the CDN’s problem.”

    JAMstack plays nicely with a serverless mentality. “JAMstack helps rethink what production footprint actually looks like,” Coleman said. By reducing your active server footprint, serverless implementations decrease infrastructure costs.

    Security

    With the proliferation of web vulnerabilities, companies are seeking new ways to limit their exposure and avoid catastrophic breaches. JAMstack can help enterprises keep pace, offering a “much tighter place to apply security controls,” he said.

    It allows teams to think of their security infrastructure in smaller pieces, which affords better control and scalability for things such as authorization. “Serverless architecture helps enable enterprise-grade SAML-based Auth tied into your stack,” Coleman noted.

    Democratization Effect

    Coleman also sees opportunities for small teams to disrupt the dominant players by utilizing it. “Companies need to move quickly, achieve enterprise-grade architecture and secure products with less investment on the onset,” he said. These abilities could, for example, enable a FinTech startup to compete on the same playing field as an established bank.

    “How do you create an architecture that is living, and how do you make sure it is as secure and clean as possible?” he asked. “How do you get a whole team together where actually doesn’t have to use 1,000 lines of YAML, and how do we continue to maintain?”

    Since JAMstack adopts APIs, companies could rapidly stitch together high-performing applications. Furthermore, by pairing low-code tooling and JAMstack, teams could drag-and-drop snippets of AWS-managed services to construct web applications very quickly.

    Bi-Directional Interactivity

    JAMstack has a reputation for creating compelling user-facing apps. Yet, Coleman acknowledged a common misconception: JAMstack is static and, therefore, not for enterprise.

    However, JAMstack can be more than a static app; the structure can support secure interactive capabilities. By taking CDNs and buckets and utilizing API connections to rich features such as AWS managed services, it can essentially reach the same enterprise-grade capabilities as other development styles, he said.

    JAMstack: No Longer Only for Blogs

    “Serverless + JAMstack is where web app architectures are going,” Coleman wrote in a recent blog post. Though many view it as a static app, there is growing potential for using this development approach to enable applications with dynamic interactivity. “With AWS in the backend, you can create an interactive enterprise-grade app.”

    Another benefit of JAMstack is the decoupled nature between client and server. This abstraction layer makes for building web applications across multi-cloud arrangements. And as web APIs become more accessible through low-code, the entry barrier to connecting to a MySQL or Postgres database—or handling identity management, for instance—is lowering.

    Once only viewed as good for blogs, JAMstack is gaining more credibility within enterprise architecture as APIs and serverless become more commonplace, offering the potential to increase performance, increase rapid web application delivery and solve other concerns within enterprise situations.

    Coleman described JAMstack as enabling developers to “build that web application the way you want.” How, then, do you want to build?