Working With Nullable Ref. Types in C#: Tips & Tricks

Learn how to work with nullable reference types in C# and discover tips and tricks to help you get the most out of them!

# Nullable Reference Types: An Introduction

This is especially important when working with databases, where the data can be absent. Three years ago, C# introduced the ability to explicitly specify the nullability of reference types. This helps to avoid errors related to the absence of data.

Using Nullable Reference Types

Nullable reference types are used to indicate whether a variable can be null or not. To do this, the type of the variable is marked with a question mark. For example, string? name = null; means that the variable name can be null. The compiler will issue a warning if you try to assign a non-null value to a variable that can be null. This helps to avoid errors related to the absence of data.

In addition, the compiler can check for nullability when calling methods. For example, if you call a method that returns a string? type, the compiler will issue a warning if you do not check for null before using the result. This helps to avoid errors related to the absence of data.

Conclusion

Nullable reference types are an important tool for creating a better and safer application architecture. They help to avoid errors related to the absence of data by explicitly specifying the nullability of reference types and checking for null when calling methods. By using nullable reference types correctly, developers can create more reliable applications and ensure that their code is safe and secure.

Source de l’article sur DZONE

Finding REST: A Journey

to Mental Wellbeing

Take the first step towards a healthier mental wellbeing with “Finding REST: A Journey to Mental Wellbeing”. Discover how to find peace and balance in life.

## The Challenges of REST and a Review of the “API Design Patterns” Book

1. Resources

2. Representations

3. Hypermedia

In the past decade, the software industry has seen a surge in the development of RESTful APIs. This is due to the fact that they are easier to use, more efficient, and more secure than traditional APIs. RESTful APIs are based on the principles of Representational State Transfer (REST). This means that they are designed to be stateless, meaning that each request is independent of the other. This makes them easier to maintain and debug.

The development of RESTful APIs requires a deep understanding of the principles of REST. This includes understanding the concept of resources, representations, and hypermedia. Resources are the core of a RESTful API and represent the data that is being requested or manipulated. Representations are the format in which the data is presented, such as JSON or XML. Finally, hypermedia is used to link related resources together.

Developers must also be aware of the different types of requests that can be made to a RESTful API. These include GET, POST, PUT, PATCH, and DELETE requests. Each request type has its own purpose and should be used accordingly. For example, GET requests are used to retrieve data from a server, while POST requests are used to create new resources. PUT and PATCH requests are used to update existing resources, and DELETE requests are used to delete resources.

In addition to understanding the principles of REST and the different types of requests, developers must also be familiar with various software tools that can help them create and maintain RESTful APIs. These include frameworks such as ExpressJS, Flask, and Django, as well as libraries such as Axios and Restify. These tools provide developers with an easy way to create and maintain RESTful APIs.

Finally, developers must also be aware of best practices when creating and maintaining RESTful APIs. These include using authentication and authorization for secure access to resources, using versioning for backward compatibility, and using caching for improved performance. By following these best practices, developers can ensure that their APIs are secure, efficient, and reliable.

In conclusion, developing and maintaining RESTful APIs requires a deep understanding of the principles of REST and the different types of requests that can be made to them. Developers must also be familiar with various software tools that can help them create and maintain RESTful APIs. Finally, developers must also be aware of best practices when creating and maintaining RESTful APIs in order to ensure that their APIs are secure, efficient, and reliable. By following these guidelines, developers can ensure that their APIs are up to date with the latest standards and provide users with a great experience.

Source de l’article sur DZONE

Selecting Cloud Host for DevOps Tools

Choosing the right cloud host for your DevOps tools can be a daunting task. Let’s explore the best options available to make sure you get the most out of your DevOps setup.

## Challenges of Implementing a DevOps Strategy Without Adequate Storage Space

Architecture is the key to successful DevOps implementation. By designing an effective architecture, companies can ensure that their DevOps strategy is properly implemented and maintained. This article will discuss the importance of architecture in DevOps and provide tips on how to design an effective architecture.

The first step in designing an effective DevOps architecture is to identify the tools and technologies that will be used. This includes selecting the right tools for the job, such as a cloud-based platform or a container-based system. Once the tools have been selected, the next step is to create a plan for how they will be used. This includes deciding which tasks each tool will be responsible for, as well as how they will interact with each other.

The next step is to create an infrastructure that supports the chosen tools. This includes setting up servers, databases, and other components of the system. It also involves creating a secure environment that can protect the data and applications from external threats. Additionally, it is important to ensure that the infrastructure is scalable so that it can accommodate changes in the system over time.

Once the infrastructure is in place, it is time to configure the tools and applications. This includes setting up authentication protocols, configuring access control lists, and setting up monitoring systems. Additionally, it is important to ensure that the system is secure and reliable by implementing security measures such as encryption and firewalls.

Finally, it is important to test the system to ensure that it is functioning properly. This includes testing the performance of the system, as well as ensuring that all of the components are working together properly. Additionally, it is important to monitor the system over time to ensure that it remains secure and reliable.

By designing an effective architecture for DevOps, companies can ensure that their DevOps strategy is properly implemented and maintained. This includes selecting the right tools for the job, creating an infrastructure that supports them, configuring the tools and applications, and testing the system to ensure that it is functioning properly. Additionally, it is important to monitor the system over time to ensure that it remains secure and reliable. By following these steps, companies can ensure that their DevOps strategy is successful and that they are able to maximize their investment in DevOps technology.

Source de l’article sur DZONE

Original release date: January 25, 2023

Summary

The Cybersecurity and Infrastructure Security Agency (CISA), National Security Agency (NSA), and Multi-State Information Sharing and Analysis Center (MS-ISAC) (hereafter referred to as the “authoring organizations”) are releasing this joint Cybersecurity Advisory (CSA) to warn network defenders about malicious use of legitimate remote monitoring and management (RMM) software. In October 2022, CISA identified a widespread cyber campaign involving the malicious use of legitimate RMM software. Specifically, cyber criminal actors sent phishing emails that led to the download of legitimate RMM software—ScreenConnect (now ConnectWise Control) and AnyDesk—which the actors used in a refund scam to steal money from victim bank accounts.

Although this campaign appears financially motivated, the authoring organizations assess it could lead to additional types of malicious activity. For example, the actors could sell victim account access to other cyber criminal or advanced persistent threat (APT) actors. This campaign highlights the threat of malicious cyber activity associated with legitimate RMM software: after gaining access to the target network via phishing or other techniques, malicious cyber actors—from cybercriminals to nation-state sponsored APTs—are known to use legitimate RMM software as a backdoor for persistence and/or command and control (C2).

Using portable executables of RMM software provides a way for actors to establish local user access without the need for administrative privilege and full software installation—effectively bypassing common software controls and risk management assumptions.

The authoring organizations strongly encourage network defenders to review the Indicators of Compromise (IOCs) and Mitigations sections in this CSA and apply the recommendations to protect against malicious use of legitimate RMM software.

Download the PDF version of this report: pdf, 608 kb.

For a downloadable copy of IOCs, see AA23-025.stix (STIX, 19 kb).

Technical Details

Overview

In October 2022, CISA used trusted third-party reporting, to conduct retrospective analysis of EINSTEIN—a federal civilian executive branch (FCEB)-wide intrusion detection system (IDS) operated and monitored by CISA—and identified suspected malicious activity on two FCEB networks:

  • In mid-June 2022, malicious actors sent a phishing email containing a phone number to an FCEB employee’s government email address. The employee called the number, which led them to visit the malicious domain, myhelpcare[.]online.
  • In mid-September 2022, there was bi-directional traffic between an FCEB network and myhelpcare[.]cc.

Based on further EINSTEIN analysis and incident response support, CISA identified related activity on many other FCEB networks. The authoring organizations assess this activity is part of a widespread, financially motivated phishing campaign and is related to malicious typosquatting activity reported by Silent Push in the blog post Silent Push uncovers a large trojan operation featuring Amazon, Microsoft, Geek Squad, McAfee, Norton, and Paypal domains.

Malicious Cyber Activity

The authoring organizations assess that since at least June 2022, cyber criminal actors have sent help desk-themed phishing emails to FCEB federal staff’s personal, and government email addresses. The emails either contain a link to a “first-stage” malicious domain or prompt the recipients to call the cybercriminals, who then try to convince the recipients to visit the first-stage malicious domain. See figure 1 for an example phishing email obtained from an FCEB network.

 

Help desk-themed phishing email examplehservice[.]live, gscare[.]live, nhelpcare[.]info, deskcareme[.]live, nhelpcare[.]cc). According to Silent Push, some of these malicious domains impersonate known brands such as, Norton, GeekSupport, Geek Squad, Amazon, Microsoft, McAfee, and PayPal.[1] CISA has also observed that the first-stage malicious domain linked in the initial phishing email periodically redirects to other sites for additional redirects and downloads of RMM software.

Use of Remote Monitoring and Management Tools

In this campaign, after downloading the RMM software, the actors used the software to initiate a refund scam. They first connected to the recipient’s system and enticed the recipient to log into their bank account while remaining connected to the system. The actors then used their access through the RMM software to modify the recipient’s bank account summary. The falsely modified bank account summary showed the recipient was mistakenly refunded an excess amount of money. The actors then instructed the recipient to “refund” this excess amount to the scam operator.
Although this specific activity appears to be financially motivated and targets individuals, the access could lead to additional malicious activity against the recipient’s organization—from both other cybercriminals and APT actors. Network defenders should be aware that:

  • Although the cybercriminal actors in this campaign used ScreenConnect and AnyDesk, threat actors can maliciously leverage any legitimate RMM software.
  • Because threat actors can download legitimate RMM software as self-contained, portable executables, they can bypass both administrative privilege requirements and software management control policies.
  • The use of RMM software generally does not trigger antivirus or antimalware defenses.
  • Malicious cyber actors are known to leverage legitimate RMM and remote desktop software as backdoors for persistence and for C2.[2],[3],[4],[5],[6],[7],[8]
  • RMM software allows cyber threat actors to avoid using custom malware.

Threat actors often target legitimate users of RMM software. Targets can include managed service providers (MSPs) and IT help desks, who regularly use legitimate RMM software for technical and security end-user support, network management, endpoint monitoring, and to interact remotely with hosts for IT-support functions. These threat actors can exploit trust relationships in MSP networks and gain access to a large number of the victim MSP’s customers. MSP compromises can introduce significant risk—such as ransomware and cyber espionage—to the MSP’s customers.

The authoring organizations strongly encourage network defenders to apply the recommendations in the Mitigations section of this CSA to protect against malicious use of legitimate RMM software.

INDICATORS OF COMPROMISE

See table 1 for IOCs associated with the campaign detailed in this CSA.

Table 1: Malicious Domains and IP addresses observed by CISA

Domain

Description

Date(s) Observed

win03[.]xyz

Suspected first-stage malware domain

June 1, 2022

July 19, 2022

myhelpcare[.]online

Suspected first-stage malware domain

June 14, 2022

 

win01[.]xyz

Suspected first-stage malware domain

August 3, 2022

August 18, 2022

myhelpcare[.]cc

Suspected first-stage malware domain

September 14, 2022

247secure[.]us

Second-stage malicious domain

October 19, 2022

November 10, 2022

 

Additional resources to detect possible exploitation or compromise:

Mitigations

The authoring organizations encourage network defenders to:

  • Implement best practices to block phishing emails. See CISA’s Phishing Infographic for more information.
  • Audit remote access tools on your network to identify currently used and/or authorized RMM software.
  • Review logs for execution of RMM software to detect abnormal use of programs running as a portable executable.
  • Use security software to detect instances of RMM software only being loaded in memory.
  • Implement application controls to manage and control execution of software, including allowlisting RMM programs.
  • Require authorized RMM solutions only be used from within your network over approved remote access solutions, such as virtual private networks (VPNs) or virtual desktop interfaces (VDIs).
  • Block both inbound and outbound connections on common RMM ports and protocols at the network perimeter. 
  • Implement a user training program and phishing exercises to raise awareness among users about the risks of visiting suspicious websites, clicking on suspicious links, and opening suspicious attachments. Reinforce the appropriate user response to phishing and spearphishing emails.

RESOURCES

  • See CISA Insights Mitigations and Hardening Guidance for MSPs and Small- and Mid-sized Businesses for guidance on hardening MSP and customer infrastructure.
  • U.S. Defense Industrial Base (DIB) Sector organizations may consider signing up for the NSA Cybersecurity Collaboration Center’s DIB Cybersecurity Service Offerings, including Protective Domain Name System (PDNS) services, vulnerability scanning, and threat intelligence collaboration for eligible organizations. For more information on how to enroll in these services, email dib_defense@cyber.nsa.gov.
  • CISA offers several Vulnerability Scanning to help organizations reduce their exposure to threats by taking a proactive approach to mitigating attack vectors. See cisa.gov/cyber-hygiene-services.
  • Consider participating in CISA’s Automated Indicator Sharing (AIS) to receive real-time exchange of machine-readable cyber threat indicators and defensive measures. AIS is offered at no cost to participants as part of CISA’s mission to work with our public and private sector partners to identify and help mitigate cyber threats through information sharing and provide technical assistance, upon request, that helps prevent, detect, and respond to incidents.

PURPOSE

This advisory was developed by CISA, NSA, and MS-ISAC in furtherance of their respective cybersecurity missions, including their responsibilities to develop and issue cybersecurity specifications and mitigations.

DISCLAIMER

The information in this report is being provided “as is” for informational purposes only. CISA, NSA, and MS-ISAC do not endorse any commercial product or service, including any subjects of analysis. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply endorsement, recommendation, or favoring.

References

Revisions

  • January 25, 2023: Initial Version

This product is provided subject to this Notification and this Privacy & Use policy.

Source de l’article sur us-cert.gov

Test Website/App Accessibility

Ensuring websites and apps are accessible to all users is essential for creating an inclusive digital experience. Here, we’ll explore how to test for accessibility.

Adapting to the Current Digital World: Ensuring Accessibility for All Users

To ensure that the product meets the needs of all users, it is important to consider the data related to user requirements.

Data plays a crucial role in understanding the needs of users and developing a product that meets their expectations. By collecting data from different sources, organizations can gain insights into user behavior and preferences. This data can be used to create user-friendly features and functionalities that make the product more accessible and easier to use. Additionally, data can be used to identify potential areas of improvement and develop strategies for increasing user engagement.

Organizations must also use data to understand the current trends in the market and develop products that are in line with them. For example, if a company wants to launch a new product, it must analyze the data related to the current market trends and customer preferences. This will help them understand what features and functionalities are most important to users and how they can be incorporated into the product. Additionally, data can be used to identify potential competitors and develop strategies for staying ahead of them.

Data is an essential tool for understanding customer needs and developing products that meet their expectations. By collecting data from different sources, organizations can gain insights into user behavior and preferences. This data can be used to create user-friendly features and functionalities that make the product more accessible and easier to use. Additionally, data can be used to identify potential areas of improvement and develop strategies for increasing user engagement. Furthermore, data can be used to understand the current trends in the market and develop products that are in line with them. By leveraging data, organizations can ensure that their products are successful in the digital landscape.

Source de l’article sur DZONE

QA Engineers & AI: How, When, Why?

QA Engineers and AI are increasingly being used together to create more efficient and effective software. But how, when, and why should they be used?

“How AI Can Help QA Engineers”

AI can be used in many ways to help QA engineers. One of the most important applications of AI in testing is automation. Automation is the process of using software to perform tasks that would otherwise be done manually. AI-driven automation can be used to automate the process of running tests, analyzing results, and reporting on them. This can save time and money, as well as reduce the risk of human error.

AI can also be used to develop expert systems that simulate human behavior. These systems can be used to test software for usability, performance, and security. By simulating user behavior, these systems can identify potential issues before they become problems. This can help QA engineers identify problems more quickly and accurately, and provide feedback to developers so they can make improvements.

Finally, AI can be used to make data-driven decisions about test cases. AI-driven analytics can be used to analyze test results and determine which tests should be run and which should be skipped. This can help QA engineers focus on the most important tests and avoid wasting time on tests that are unlikely to yield useful results.

In conclusion, AI can be a powerful tool for QA engineers. It can help automate testing processes, develop expert systems that simulate user behavior, and make data-driven decisions about test cases. By leveraging the power of AI, QA engineers can work smarter and more efficiently, saving time and money while reducing the risk of human error. With the right implementation and proper testing, AI can help QA engineers improve the quality of their work and deliver better results for their clients.

Source de l’article sur DZONE

DragonSpark Malware Utilizing Golang Programming Language to Evade Detection by Chinese Hackers

DragonSpark malware is a sophisticated threat leveraging Golang programming language to evade detection by Chinese hackers.

new attack targeting Organizations in East Asia: DragonSpark and its Uncommon Tactics

feature of the attacks is the use of legitimate Windows tools to move laterally within the network and to exfiltrate data.

Organizations in East Asia have been targeted by a likely Chinese-speaking actor, dubbed DragonSpark, using uncommon tactics to go past security layers. According to a report released by SentinelOne, the attacks are characterized by the use of the little known open source SparkRAT and malware that attempts to evade detection through Golang source code interpretation.

What makes the attacks particularly concerning is the use of legitimate Windows tools to move laterally within the network and to exfiltrate data. This means that the malicious actors can move around the network undetected and steal confidential information without being detected. The use of legitimate Windows tools also makes it more difficult for security teams to detect and stop the attack.

The DragonSpark campaign is a reminder that organizations need to be vigilant in their security measures and have a comprehensive strategy in place to protect their data. Organizations should ensure that their networks are regularly monitored for suspicious activity and that they have a robust system in place to detect and respond to any potential threats. Additionally, organizations should ensure that they have a comprehensive data backup plan in place so that any data that is stolen can be recovered quickly and securely. Finally, organizations should ensure that they have an incident response plan in place so that they can respond quickly and effectively in the event of a security breach.

Source de l’article sur The Hacker News

Understanding the PHP Implode and Explode Functions

Learn how to use the powerful PHP Implode and Explode functions to manipulate strings and arrays quickly and easily!

Imploding and Exploding with PHP: A Code Sample Guide

Implode is a PHP function that takes an array and converts it into a string. This is useful when you need to store the array elements in a database or when you want to send the array elements as a single string in an email. To use implode, you must first define the array. Then, you can pass the array and the glue string to the implode function. The glue string is the character or characters that will be used to separate the elements of the array. For example, if you wanted to separate each element with a comma, you would use a comma as the glue string.

Explode is a PHP function that takes a string and converts it into an array. This is useful when you need to break up a string into multiple parts for further processing. To use explode, you must first define the string. Then, you can pass the string and the delimiter to the explode function. The delimiter is the character or characters that will be used to separate the elements of the string. For example, if you wanted to separate each element with a comma, you would use a comma as the delimiter.

Software developers often use these two functions in combination with each other. For example, they may use implode to convert an array into a string, then use explode to break up the string into multiple parts. This allows them to process the data in different ways depending on their needs. Additionally, these functions can be used in conjunction with other PHP functions such as trim(), substr(), and str_replace() to manipulate strings and arrays in various ways. By understanding how implode and explode work, software developers can quickly and easily manipulate strings and arrays in their code.

Source de l’article sur DZONE

Understanding Core Machine Learning Performance Metrics

Gain a deeper understanding of core machine learning performance metrics and how they can be used to evaluate and improve ML models.

Evaluating Model Performance in Machine Learning: True/False Negatives/Positives, Accuracy, Precision, Recall, Calibration Error, and the Confusion Matrix

Data is an essential part of machine learning. It is used to train and evaluate models, and it is also used to make predictions. Evaluating model performance is a critical task that requires understanding of various metrics. True/false positives/negatives are the fundamental metrics used to measure model performance. True positives are the number of correct predictions made by the model, while false positives are the number of incorrect predictions made by the model. False negatives are the number of correct predictions that were not made by the model, and true negatives are the number of incorrect predictions that were not made by the model.

Accuracy, precision, recall, and calibration error are more complex metrics used to evaluate model performance. Accuracy is the ratio of correctly predicted samples to the total number of samples. Precision is the ratio of correctly predicted positive samples to the total number of predicted positive samples. Recall is the ratio of correctly predicted positive samples to the total number of actual positive samples. Calibration error measures the difference between predicted probabilities and actual probabilities.

The confusion matrix is a visual representation of model performance that can be used to interpret the metrics mentioned above. It is a table that contains true/false positives/negatives as well as accuracy, precision, recall, and calibration error. A confusion matrix can be created using a simple code snippet in Python:

from sklearn.metrics import confusion_matrix

cm = confusion_matrix(y_true, y_pred)

print(cm)

In conclusion, data is an important part of machine learning and understanding how to evaluate model performance is essential for success. True/false positives/negatives are basic metrics used to measure model performance, while accuracy, precision, recall, and calibration error are more complex metrics that can be used to gain further insight into a model’s performance. The confusion matrix is a visual representation of model performance that can be used to interpret these metrics.

Source de l’article sur DZONE