AWS CodePipeline adds support for Branch-based development and Monorepos

Post Syndicated from Michael Ohde original https://aws.amazon.com/blogs/devops/aws-codepipeline-adds-support-for-branch-based-development-and-monorepos/

AWS CodePipeline is a managed continuous delivery service that automates your release pipelines for application and infrastructure updates. Today, CodePipeline adds triggers and new execution modes to support teams with various delivery strategies. These features give customers more choice in the pipelines they build.

In this post, I am going to show you how to use triggers and pipeline execution modes together to create three pipeline designs. These examples are requested by customers that practice branch-based development or manage multiple projects within a monorepo.

  • Pipeline #1: Create a GitFlow (multi-branch) release pipeline.
  • Pipeline #2: Run a pipeline on all pull requests (PRs).
  • Pipeline #3: Run a pipeline on a single folder within a monorepo.

As I walkthrough each of the pipelines you will learn more about these features and how to use them. After completing the blog, you can use triggers and execution modes to adapt these examples to your pipeline needs.

Pipeline #1 – Create a GitFlow (multi-branch) release pipeline

GitFlow is a development model that manages large projects with parallel development and releases using long-running branches. GitFlow uses two permanent branches, main and develop, along with supporting feature, release, and hotfix branches. Since I will cover triggering a pipeline from multiple branches, these concepts can be applied to simplify other multi-branch pipeline strategies such as GitHub flow.

I can create pipelines using the AWS Management Console, AWS CLI, AWS CloudFormation, or by writing code that calls the CodePipeline CreatePipeline API. In this blog, I will keep things simple by creating two pipelines, a release pipeline and a feature development pipeline. I start by navigating to the CodePipeline console and choosing Create pipeline.

In the first step, Pipeline settings, as per Figure 1 below, you will now see options for the newly added Execution modesQueued and Parallel.

Example GitFlow release pipeline settings for Queued execution mode.
Figure 1. Example GitFlow release pipeline settings for Queued execution mode.

The execution mode of the pipeline determines the handling of multiple executions:

  • Superseded – an execution that started more recently can overtake one that began earlier. Before today, CodePipeline only supported Superseded execution mode.
  • Queued – the executions wait and do not overtake executions that have already started. Executions are processed one by one in the order that they are queued.
  • Parallel – the executions are independent of one another and do not wait for other executions to complete before starting.

The first pipeline, release pipeline, will trigger for main, develop, hotfix, and release branches. I select Queued, since I want to run every push to these branches in the order triggered by the pipeline. I make sure the Pipeline type chosen is V2 and I click Next.

Example source connection and repository.
Figure 2. Example source connection and repository.

In step two, Add source stage, I select my Source provider, Connection, Repository name, and Default branch. I need to use a source provider that uses a connection to my external code repository, in this example I’m using GitHub so I select Connect to GitHub. Connections authorize and establish configurations that associate a third-party provider such as GitHub with CodePipeline.

Now that I have my Source setup, I’m going to configure a Trigger. Triggers define the event type that starts the pipeline, such as a code push or pull request. I select the Specify filter from the Trigger types, since I want to add a filtered trigger.

For this pipeline, I select Push for the Event type. A push trigger starts a pipeline when a change is pushed to the source repository. The execution uses the files in the branch that is pushed to, the destination branch. Next, I select the Filter type of Branch. The branch filter type specifies the branches in GitHub connected repository that the trigger monitors in order to know when to start an execution.

There are two types of branch filters:

  • Include – the trigger will start a pipeline if the branch name matches the pattern.
  • Exclude – the trigger will NOT start a pipeline if the branch name matches the pattern.

Note: If Include and Exclude both have the same pattern, then the default is to exclude the pattern.

Branching patterns are entered in the glob format, detailed in Working with glob patterns in syntax, to specify the branch I want to trigger, I enter main,develop,hotfix/**,release/** in Include and I leave Exclude empty.

Example GitFlow release pipeline for push event type and branch filters.
Figure 3. Example GitFlow release pipeline for push event type and branch filters.

I am done configuring the filters and I click Next.

To keep the focus of the blog on the pipeline and not the application, I will skip ahead to Create pipeline. If you are curious about by my application and build step, I followed the example in AWS CodeBuild adds support for AWS Lambda compute mode.

Next, I create the feature development pipeline. The feature development pipeline will trigger for feature branches. This time, I select the Parallel Execution mode, as developers should not be blocked by their peers working in other feature branches. I make sure the Pipeline type chosen is V2 and I click Next.

Example GitFlow feature pipeline settings for Queued execution mode.
Figure 4. Example GitFlow feature pipeline settings for Queued execution mode.

In Step 2, the source provider and connection is setup the same as per the previous release pipeline, see Figure 2 above. Once the Source step is complete, I configure my Trigger with an Event type of Push, but this time I only enter feature/** for Include.

Example GitFlow feature pipeline for push event type and branch filters.
Figure 5. Example GitFlow feature pipeline for push event type and branch filters.

I am done configuring the filters and I skip forward to Create pipeline.

After the pipeline is finished creating, I can now see both of the pipelines I created – the release pipeline and the feature development pipeline.

Example GitFlow pipelines.
Figure 6. Example GitFlow pipelines.

To verify my pipeline setup, I create and merge multiple code changes to feature branches and to the release branches – develop, release, and main. The Pipeline view now displays the executions that have been triggered by the matching branches. Note how these executions have been successfully added to the queue by the pipeline.

Example GitFlow release executions queued.
Figure 7. Example GitFlow release executions queued.

I have now implemented a GitFlow release pipeline. By using Branch filter types and Push event triggers, you can now extend this example to meet your branch-based development needs.

Pipeline #2 – Run a pipeline on all pull requests (PRs)

Before proceeding, I recommend you review the concepts covered in Pipeline #1, as you will build on that knowledge.

Triggering a pipeline on a pull request (PR) is a common continuous integration pattern to catch build and test failures before the PR is merged into the branch. A PR pipeline is often faster and lighter than the full release by limiting tests like security scans, validation tests, or performance tests to the changes in the PR rather than running them on every commit. Having a single pipeline triggered for all PRs allows reviewing and validating any proposed changes to the repository before merging.

To start I create a new pipeline, by clicking Create Pipeline. I change the Execution mode to Parallel. I choose Parallel because the development team will be working on multiple features at the same time and it is wasteful to wait for other executions to finish. I make sure the Pipeline type chosen is V2 and I click Next.

Example PR pipeline settings for Parallel execution mode.
Figure 8. Example PR pipeline settings for Parallel execution mode.

As per the previous pipeline, the Source provider and connection is setup as show in Figure 2 above. Once the Source step is setup, I configure my Pull Request Trigger.

For this pipeline, I select Pull Request for the Event type. A pull request trigger starts a pipeline when a pull request is opened, updated, or closed in the source repository. The execution will use the files in the branch that the change is being pulled from, the source branch. Next, I select Pull request is created and New revision is made to pull request for Events for pull request. To match pull requests for all branches, I enter ** under Include for Branches and leave Exclude empty.

Example PR pipeline for pull request event type.
Figure 9. Example PR pipeline for pull request event type.

I will fast-forward to the Create pipeline, skipping the details of the build and deploy steps, similar to what I did in Pipeline #1.

Once the pipeline has finished creating, I open a few PRs in my GitHub repository as a test. Back in CodePipeline when I click on my pipeline, I notice the pipeline takes me straight to the Execution history view. The reason I’m redirected to the execution history is the pipeline execution mode is Parallel and all executions are independent. From this view, I see the Trigger column displaying details about each pull request that has triggered the pipeline.

Example PR pipeline with executions in parallel.
Figure 10. Example PR pipeline with executions in parallel.

Note: To view an individual execution Pipeline, click the Execution ID.

I have now implemented a PR validation pipeline for all PRs across branches. By using Pull request event triggers and Branch filter types, you can now extend this example to meet your PR pipeline needs.

Pipeline #3 – Run a pipeline on a single folder within a monorepo

Before proceeding, I recommend you review the concepts covered in Pipeline #1, as you will build on that knowledge.

A monorepo is a software-development strategy where a single repository is used to contain the code for multiple projects. Running pipelines for each project contained in the monorepo on every commit can be inefficient, especially when each project requires different pipelines. For this pipeline example, I want to limit pipeline executions to only changes inside the infrastructure folder in the main branch. This can reduce cost, speed up deployments, and optimize resource usage.

To start, I create a new pipeline by clicking Create Pipeline. For this example, I keep the default Execution mode as Suspended, since I do not have any specific execution mode requirements. I make sure the Pipeline type chosen is V2 and I click Next.

As per the previous pipeline, the Source provider and connection is setup as per Figure 2 above. Once the Source step is complete, I configure my Trigger to focus on the infrastructure folder in the main branch.

For this pipeline, I select Push for the Event type. Next, I select the Filter type of Branch.  To match pushes to only main, I enter main under Include for Branches and leave Exclude empty. Under File paths, for Include, I enter infrastructure/** and I leave Exclude empty. The file paths filter type specifies file path names in the source repository that the trigger monitors in order to know when to start an execution. Similar to branch filters, I can specify file path name patterns in glob format under Include and Exclude.

Example monorepo pipeline for push event type and file path filters.
Figure 11. Example monorepo pipeline for push event type and file path filters.

I click Next, since I am done configuring the filters.

I will jump ahead to the Create pipeline, omitting the details of the build and deploy steps, like I did in Pipeline #1.

Once the pipeline has been created, I can test the pipeline Trigger in GitHub by making changes on the main branch inside and outside the infrastructure folder. To verify it is only invoking the pipelines inside the infrastructure folder, I open the History for the pipeline in CodePipeline. I confirm that only the changes I’m expecting are running.

Example monorepo pipeline with only infrastructure executions.
Figure 12. Example monorepo pipeline with only infrastructure executions.

I have now selectively invoked a pipeline based on repository changes in a monorepo. By using File paths filter types, you can now extend this example to meet your monorepo release pipelines.

Conclusion

AWS CodePipeline’s new triggers and execution modes unlock new patterns for building pipelines on AWS. In this post, I discussed the new features and three popular pipeline patterns you can build. If you are creating GitFlow or your own multi-branch strategy, CodePipeline simplifies managing release pipelines for multi-branch models. Whether you are using File path filter types for monorepos or leveraging Parallel execution mode to unblock developers, CodePipeline accelerates the delivery of your software. Check out the AWS CodePipeline User Guide and hands-on tutorials to automate your delivery workflows today.

Michael Ohde

Michael Ohde is a Senior Solutions Architect from Long Beach, CA. As a Product Acceleration Solution Architect at AWS, he currently assists Independent Software Vendor (ISVs) in the GovTech and EdTech sectors, by building modern applications using practices like serverless, DevOps, and AI/ML.

How to enforce creation of roles in a specific path: Use IAM role naming in hierarchy models

Post Syndicated from Varun Sharma original https://aws.amazon.com/blogs/security/how-to-enforce-creation-of-roles-in-a-specific-path-use-iam-role-naming-in-hierarchy-models/

An AWS Identity and Access Management (IAM) role is an IAM identity that you create in your AWS account that has specific permissions. An IAM role is similar to an IAM user because it’s an AWS identity with permission policies that determine what the identity can and cannot do on AWS. However, as outlined in security best practices in IAM, AWS recommends that you use IAM roles instead of IAM users. An IAM user is uniquely associated with one person, while a role is intended to be assumable by anyone who needs it. An IAM role doesn’t have standard long-term credentials such as a password or access keys associated with it. Instead, when you assume a role, it provides you with temporary security credentials for your role session that are only valid for certain period of time.

This blog post explores the effective implementation of security controls within IAM roles, placing a specific focus on the IAM role’s path feature. By organizing IAM roles hierarchically using paths, you can address key challenges and achieve practical solutions to enhance IAM role management.

Benefits of using IAM paths

A fundamental benefit of using paths is the establishment of a clear and organized organizational structure. By using paths, you can handle diverse use cases while creating a well-defined framework for organizing roles on AWS. This organizational clarity can help you navigate complex IAM setups and establish a cohesive structure that’s aligned with your organizational needs.

Furthermore, by enforcing a specific structure, you can gain precise control over the scope of permissions assigned to roles, helping to reduce the risk of accidental assignment of overly permissive policies. By assisting in preventing inadvertent policy misconfigurations and assisting in coordinating permissions with the planned organizational structure, this proactive solution improves security. This approach is highly effective when you consistently apply established naming conventions to paths, role names, and policies. Enforcing a uniform approach to role naming enhances the standardization and efficiency of IAM role management. This practice fosters smooth collaboration and reduces the risk of naming conflicts.

Path example

In IAM, a role path is a way to organize and group IAM roles within your AWS account. You specify the role path as part of the role’s Amazon Resource Name (ARN).

As an example, imagine that you have a group of IAM roles related to development teams, and you want to organize them under a path. You might structure it like this:

Role name: Dev App1 admin
Role path: /D1/app1/admin/
Full ARN: arn:aws:iam::123456789012:role/D1/app1/admin/DevApp1admin

Role name: Dev App2 admin
Role path: /D2/app2/admin/
Full ARN: arn:aws:iam::123456789012:role/D2/app2/admin/DevApp2admin

In this example, the IAM roles DevApp1admin and DevApp2admin are organized under two different development team paths: D1/app1/admin and D2/app2/admin, respectively. The role path provides a way to group roles logically, making it simpler to manage and understand their purpose within the context of your organization.

Solution overview

Figure 1: Sample architecture

Figure 1: Sample architecture

The sample architecture in Figure 1 shows how you can separate and categorize the enterprise roles and development team roles into a hierarchy model by using a path in an IAM role. Using this hierarchy model, you can enable several security controls at the level of the service control policy (SCP), IAM policy, permissions boundary, or the pipeline. I recommend that you avoid incorporating business unit names in paths because they could change over time.

Here is what the IAM role path looks like as an ARN:

arn:aws:iam::123456789012:role/EnT/iam/adm/IAMAdmin

In this example, in the resource name, /EnT/iam/adm/ is the role path, and IAMAdmin is the role name.

You can now use the role path as part of a policy, such as the following:

arn:aws:iam::123456789012:role/EnT/iam/adm/*

In this example, in the resource name, /EnT/iam/adm/ is the role path, and * indicates any IAM role inside this path.

Walkthrough of examples for preventative controls

Now let’s walk through some example use cases and SCPs for a preventative control that you can use based on the path of an IAM role.

PassRole preventative control example

The following SCP denies passing a role for enterprise roles, except for roles that are part of the IAM admin hierarchy within the overall enterprise hierarchy.

		{
	"Version": "2012-10-17",
	"Statement": [
		{
			"Sid": "DenyEnTPassRole",
			"Effect": "Deny",
			"Action": "iam:PassRole",
			"Resource": "arn:aws:iam::*:role/EnT/*",
			"Condition": {
				"ArnNotLike": {
					"aws:PrincipalArn": "arn:aws:iam::*:role/EnT/fed/iam/*"
				}
			}
		}
	]
}

With just a couple of statements in the SCP, this preventative control helps provide protection to your high-privilege roles for enterprise roles, regardless of the role’s name or current status.

This example uses the following paths:

  • /EnT/ — enterprise roles (roles owned by the central teams, such as cloud center of excellence, central security, and networking teams)
  • /fed/ — federated roles, which have interactive access
  • /iam/ — roles that are allowed to perform IAM actions, such as CreateRole, AttachPolicy, or DeleteRole

IAM actions preventative control example

The following SCP restricts IAM actions, including CreateRole, DeleteRole, AttachRolePolicy, and DetachRolePolicy, on the enterprise path.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "DenyIAMActionsonEnTRoles",
            "Effect": "Deny",
            "Action": [
                "iam:CreateRole",
                "iam:DeleteRole",
                "iam:DetachRolePolicy",
                "iam:AttachRolePolicy"
            ],
            "Resource": "arn:aws:iam::*:role/EnT/*",
            "Condition": {
                "ArnNotLike": {
                    "aws:PrincipalArn": "arn:aws:iam::*:role/EnT/fed/iam/*"
                }
            }
        }
    ]
}

This preventative control denies an IAM role that is outside of the enterprise hierarchy from performing the actions CreateRole, DeleteRole, DetachRolePolicy, and AttachRolePolicy in this hierarchy. Every IAM role will be denied those API actions except the one with the path as arn:aws:iam::*:role/EnT/fed/iam/*

The example uses the following paths:

  • /EnT/ — enterprise roles (roles owned by the central teams, such as cloud center of excellence, central security, or network automation teams)
  • /fed/ — federated roles, which have interactive access
  • /iam/ — roles that are allowed to perform IAM actions (in this case, CreateRole, DeteleRole, DetachRolePolicy, and AttachRolePolicy)

IAM policies preventative control example

The following SCP policy denies attaching certain high-privilege AWS managed policies such as AdministratorAccess outside of certain IAM admin roles. This is especially important in an environment where business units have self-service capabilities.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "RolePolicyAttachment",
            "Effect": "Deny",
            "Action": "iam:AttachRolePolicy",
            "Resource": "arn:aws:iam::*:role/EnT/fed/iam/*",
            "Condition": {
                "ArnNotLike": {
                    "iam:PolicyARN": "arn:aws:iam::aws:policy/AdministratorAccess"
                }
            }
        }
    ]
}

AssumeRole preventative control example

The following SCP doesn’t allow non-production roles to assume a role in production accounts. Make sure to replace <Your production OU ID> and <your org ID> with your own information.

{
	"Version": "2012-10-17",
	"Statement": [
		{
			"Sid": "DenyAssumeRole",
			"Effect": "Deny",
			"Action": "sts:AssumeRole",
			"Resource": "*",
			"Condition": {
				"StringLike": {
					"aws:PrincipalArn": "arn:aws:iam::*:role/np/*"
				},
				"ForAnyValue:StringLike": {
					"aws:ResourceOrgPaths": "<your org ID>/r-xxxx/<Your production OU ID>/*"
				}
			}
		}
	]
}

This example uses the /np/ path, which specifies non-production roles. The SCP denies non-production IAM roles from assuming a role in the production organizational unit (OU) (in our example, this is represented by <your org ID>/r-xxxx/<Your production OU ID>/*”). Depending on the structure of your organization, the ResourceOrgPaths will have one of the following formats:

  • “o-a1b2c3d4e5/*”
  • “o-a1b2c3d4e5/r-ab12/ou-ab12-11111111/*”
  • “o-a1b2c3d4e5/r-ab12/ou-ab12-11111111/ou-ab12-22222222/”

Walkthrough of examples for monitoring IAM roles (detective control)

Now let’s walk through two examples of detective controls.

AssumeRole in CloudTrail Lake

The following is an example of a detective control to monitor IAM roles in AWS CloudTrail Lake.

SELECT
    userIdentity.arn as "Username", eventTime, eventSource, eventName, sourceIPAddress, errorCode, errorMessage
FROM
    <Event data store ID>
WHERE
    userIdentity.arn IS NOT NULL
    AND eventName = 'AssumeRole'
    AND userIdentity.arn LIKE '%/np/%'
    AND errorCode = 'AccessDenied'
    AND eventTime > '2023-07-01 14:00:00'
    AND eventTime < '2023-11-08 18:00:00';

This query lists out AssumeRole events for non-production roles in the organization for AccessDenied errors. The output is stored in an Amazon Simple Storage Service (Amazon S3) bucket from CloudTrail Lake, from which the csv file can be downloaded. The following shows some example output:

Username,eventTime,eventSource,eventName,sourceIPAddress,errorCode,errorMessage
arn:aws:sts::123456789012:assumed-role/np/test,2023-12-09 10:35:45.000,iam.amazonaws.com,AssumeRole,11.11.113.113,AccessDenied,User: arn:aws:sts::123456789012:assumed-role/np/test is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::123456789012:role/hello because no identity-based policy allows the sts:AssumeRole action

You can modify the query to audit production roles as well.

CreateRole in CloudTrail Lake

Another example of a CloudTrail Lake query for a detective control is as follows:

SELECT
    userIdentity.arn as "Username", eventTime, eventSource, eventName, sourceIPAddress, errorCode, errorMessage
FROM
    <Event data store ID>
WHERE
    userIdentity.arn IS NOT NULL
    AND eventName = 'CreateRole'
    AND userIdentity.arn LIKE '%/EnT/fed/iam/%'
    AND eventTime > '2023-07-01 14:00:00'
    AND eventTime < '2023-11-08 18:00:00';

This query lists out CreateRole events for roles in the /EnT/fed/iam/ hierarchy. The following are some example outputs:

Username,eventTime,eventSource,eventName,sourceIPAddress,errorCode,errorMessage

arn:aws:sts::123456789012:assumed-role/EnT/fed/iam/security/test,2023-12-09 16:31:11.000,iam.amazonaws.com,CreateRole,10.10.10.10,AccessDenied,User: arn:aws:sts::123456789012:assumed-role/EnT/fed/iam/security/test is not authorized to perform: iam:CreateRole on resource: arn:aws:iam::123456789012:role/EnT/fed/iam/security because no identity-based policy allows the iam:CreateRole action

arn:aws:sts::123456789012:assumed-role/EnT/fed/iam/security/test,2023-12-09 16:33:10.000,iam.amazonaws.com,CreateRole,10.10.10.10,AccessDenied,User: arn:aws:sts::123456789012:assumed-role/EnT/fed/iam/security/test is not authorized to perform: iam:CreateRole on resource: arn:aws:iam::123456789012:role/EnT/fed/iam/security because no identity-based policy allows the iam:CreateRole action

Because these roles can create additional enterprise roles, you should audit roles created in this hierarchy.

Important considerations

When you implement specific paths for IAM roles, make sure to consider the following:

  • The path of an IAM role is part of the ARN. After you define the ARN, you can’t change it later. Therefore, just like the name of the role, consider what the path should be during the early discussions of design.
  • IAM roles can’t have the same name, even on different paths.
  • When you switch roles through the console, you need to include the path because it’s part of the role’s ARN.
  • The path of an IAM role can’t exceed 512 characters. For more information, see IAM and AWS STS quotas.
  • The role name can’t exceed 64 characters. If you intend to use a role with the Switch Role feature in the AWS Management Console, then the combined path and role name can’t exceed 64 characters.
  • When you create a role through the console, you can’t set an IAM role path. To set a path for the role, you need to use automation, such as AWS Command Line Interface (AWS CLI) commands or SDKs. For example, you might use an AWS CloudFormation template or a script that interacts with AWS APIs to create the role with the desired path.

Conclusion

By adopting the path strategy, you can structure IAM roles within a hierarchical model, facilitating the implementation of security controls on a scalable level. You can make these controls effective for IAM roles by applying them to a path rather than specific roles, which sets this approach apart.

This strategy can help you elevate your overall security posture within IAM, offering a forward-looking solution for enterprises. By establishing a scalable IAM hierarchy, you can help your organization navigate dynamic changes through a robust identity management structure. A well-crafted hierarchy reduces operational overhead by providing a versatile framework that makes it simpler to add or modify roles and policies. This scalability can help streamline the administration of IAM and help your organization manage access control in evolving environments.

If you have feedback about this post, submit comments in the Comments section below. If you have questions about this post, start a new thread on the AWS Security, Identity, & Compliance re:Post or contact AWS Support.

Want more AWS Security news? Follow us on Twitter.

Varun Sharma

Varun Sharma

Varun is an AWS Cloud Security Engineer who wears his security cape proudly. With a knack for unravelling the mysteries of Amazon Cognito and IAM, Varun is a go-to subject matter expert for these services. When he’s not busy securing the cloud, you’ll find him in the world of security penetration testing. And when the pixels are at rest, Varun switches gears to capture the beauty of nature through the lens of his camera.

Metasploit Weekly Wrap-Up 02/09/2024

Post Syndicated from Jack Heysel original https://blog.rapid7.com/2024/02/09/metasploit-weekly-wrap-up-02-09-2024/

Go go gadget Fortra GoAnywhere MFT Module

Metasploit Weekly Wrap-Up 02/09/2024

This Metasploit release contains a module for one of 2024’s hottest vulnerabilities to date: CVE-2024-0204. The path traversal vulnerability in Fortra GoAnywhere MFT allows for unauthenticated attackers to access the InitialAccountSetup.xhtml endpoint which is used during the products initial setup to create the first administrator user. After setup has completed, this endpoint is supposed to be no longer available. Attackers can use this vulnerability to create a user with Administrator privileges. Once Administrative privileges have been obtained for the GoAnywhere MFT application, uploading a .jsp payload in order to achieve RCE is trivial.

New module content (3)

runc (docker) File Descriptor Leak Privilege Escalation

Authors: Rory McNamara and h00die
Type: Exploit
Pull request: #18780 contributed by h00die
Path: linux/local/runc_cwd_priv_esc

Description: This adds a local privilege escalation exploit that leverages an internal file descriptor leak in runc versions prior to 1.1.12. An attacker with docker privileges is able write an arbitrary file on the host file system with the permissions of runc (typically root). With this, the module uploads a payload, sets the execute and the SUID permissions to escalate privileges.

Cacti RCE via SQLi in pollers.php

Authors: Aleksey Solovev and Christophe De La Fuente
Type: Exploit
Pull request: #18769 contributed by cdelafuente-r7
Path: multi/http/cacti_pollers_sqli_rce

Description: This PR adds an exploit module which leverages a SQLi (CVE-2023-49085) and a LFI (CVE-2023-49084) vulnerability in Cacti versions prior to 1.2.26 to achieve RCE.

Fortra GoAnywhere MFT Unauthenticated Remote Code Execution

Authors: James Horseman, Zach Hanley, and sfewer-r7
Type: Exploit
Pull request: #18762 contributed by sfewer-r7
Path: multi/http/fortra_goanywhere_mft_rce_cve_2024_0204

Description: This pull request adds an exploit module for CVE-2024-0204 which is a path traversal vulnerability which results in unauthenticated RCE in Fortra GoAnywhere MFT. GoAnywhere MFT versions 6.x from 6.0.1, and 7.x before 7.4.1 are vulnerable.

Enhancements and features (3)

  • #18696 from zgoldman-r7 – Introduces a standalone MSSQL client class that can be used in new contexts not tied to a specific module.
  • #18718 from cgranleese-r7 – Updates the auxiliary/scanner/mysql/mysql_login.rb module to include a new CreateSession option that opens an interactive session. This functionality is currently behind a feature flag which can be enabled with features set mysql_session_type true.
  • #18761 from dwelch-r7 – Adds a user notification that new modules support a CreateSession option. This functionality is currently behind a feature flag which can be enabled with the features command.

Bugs fixed (3)

  • #18704 from dwelch-r7 – Fixes a bug with framework having 0 registered nop modules when the defer-module-loads feature was enabled.
  • #18773 from sjanusz-r7 – Fixes an issue where Ctrl+Z and Ctrl+C when in the context of an interactive PostgreSQL shell prompt inside the PostgreSQL session type did work correctly.
  • #18803 from dwelch-r7 – Fixes a crash when using exploit/multi/handler with an invalid payload name.

Documentation added (1)

You can always find more documentation on our docsite at docs.metasploit.com.

Get it

As always, you can update to the latest Metasploit Framework with msfupdate
and you can get more details on the changes since the last blog post from
GitHub:

If you are a git user, you can clone the Metasploit Framework repo (master branch) for the latest.
To install fresh without using git, you can use the open-source-only Nightly Installers or the
commercial edition Metasploit Pro

От Homo sapiens към Homo digitalis

Post Syndicated from original https://www.toest.bg/ot-homo-sapiens-kum-homo-digitalis/

От Homo sapiens към Homo digitalis

Интернет зависимостта се превръща в глобален здравен проблем пред очите ни. Полагат се все повече усилия за характеризиране на рисковите фактори, които биха могли да доведат до пристрастяване към интернет. През последните години комбинирането на класически подходи от психологията, изследващи промените в личността, с невронаучни, изобразяващи мозъка чрез различни техники, имат за цел да изготвят теоретична концепция за причините за пристрастяването към интернет.

От глобалната компютърна мрежа до днес

Интернет започва да се разработва още през 60-те години на миналия век. Първоначално се е използвал за военни цели, а след това става средство за комуникация между учени от различни точки на света. За рожден ден на интернет се счита 1 януари 1983 г. Преди това различните компютърни мрежи не са имали стандартен начин за комуникация помежду си. Създаден е нов комуникационен протокол, наречен Протокол за контрол на трансфера/Интернет протокол (TCP/IP).

По-малко от 10 години след това, през 1992-ра, IBM показва пред света първия смартфон, наречен Simon Personal Communicator (SPC). SPC е първият телефон със сензорен екран и екранна клавиатура, с възможности за изпращане и получаване на имейли и факс, плюс още екстри, като календар, адресна книга и планер.

Еволюцията на смартфоните настъпва едва след 15 години, когато Стив Джобс представя iPhone – първото устройство, предлагащо пълната неограничена версия на интернет. В този период навлизат и социалните мрежи като средство за комуникация.

И вече така са навлезли, че прекомерната им употреба повдига множество въпроси относно ефекта им върху физическото и психическото здраве. Известно е, че прекаляването със социалните мрежи води до загуба на концентрация, нарушения на съня и др. В настоящия момент социалните медии заемат най-голям дял от общото онлайн време, като почти 4 на всеки 10 минути, прекарани онлайн, са обвързани с дейности в социалните медии.

Нашият мозък в дигиталния свят

Интернет драматично променя начина, по който живеем, и въпреки многобройните предимства, които са резултат от дигиталната революция, учените стават все по-загрижени по отношение на потенциалния вреден ефект върху психичното ни здраве от прекомерната употреба на интернет.

Въпреки че все още не е официална диагноза, терминът „интернет пристрастяване“ е въведен преди 20 години от Кимбърли Янг. Сред симптомите са прекомерна заетост с интернет, отдръпване, когато не сте онлайн, и други отрицателни последици в личния живот.

Събират се множество доказателства от психологически и невронаучни изследвания, които показват приликите между разстройствата, свързани с употребата на наркотични вещества, злоупотребата с алкохол и прекомерната употреба на интернет. Затова и пристрастяването към интернет се характеризира като вид поведенческа зависимост. Установени са и структурни нарушения на мозъка, например намален обем и плътност на сивото вещество в предния цингуларен кортекс или увеличена сензитивност на стриатума към сигнали, свързани с прием на някои лекарства. Засегнати са и подкорови системи, като мезолимбичната. По отношение на психологията може да се отбележи, че в петото издание на Диагностичния и статистически наръчник на психичните разстройства на Американската психиатрична асоциация е включен терминът „разстройство, свързано с играене на интернет игри“.

Въпреки че вече разполагаме с голямо количество информация за мозъчните структури, участващи в интернет пристрастяването, молекулярната основа на основните мозъчни (дис)функции е с далеч повече неизвестни. Има проучвания, в които се посочват някои генетични маркери, асоциирани с проблема, предлагат се и психофармакологични подходи за справяне с него. Например конкретна генетична вариация на гена CHRNA4, свързана с развитието на тревожност и с тютюнопушенето, също е от значение за пристрастяването към интернет. Тези проучвания, наред с други, дават и доказателства за ролята на допаминергичните и серотонинергичните системи в пристрастяването към интернет по подобие на други видове зависимости.

На този етап проучванията, търсещи причинно-следствена връзка на вече споменатите изменения на някои мозъчни структури с интернет пристрастяването, са малко на брой, но в бъдеще такъв тип изследвания биха откроили ясното изменение и оформяне на нашите мозъци и умове вследствие на взаимодействието с дигиталния свят.

Докато много изследователи се занимават с въпроса дали използването на една от най-големите социални мрежи – Facebook, води до възникването на депресивни симптоми, проучвания изясняват механизмите, поради които толкова много хора прекарват голяма част от свободното си време (а и не само) в тези социални онлайн платформи. Доказателство за ролята на nucleus accumbens (т.нар. център на удоволствието) при използването на Facebook идва от скорошно проучване на структурата на мозъка, което изследва връзката между по-малките обеми на nucleus accumbens с по-често ползване и по-дълъг престой във Facebook. Въпросът, който остава неизяснен, е дали по-малките обеми на nucleus accumbens са рисков фактор за пристрастяване към интернет, или са следствие от прекомерната му употреба.

Продължаващите изследвания в тази посока ще дадат отговор на много неизяснени до момента въпроси, включително на микрониво – дали нашият епигеном ще се повлияе/измени вследствие на дигиталния стресор, който е почти непрекъснат.

Бъдещото дигитално общество

Създаването на работни места с обособени зони за почивка ще бъде голямо предизвикателство в близкото бъдеще. В контекста на нововъзникващата дисциплина психоинформатика се предлагат няколко съвета за създаване на баланс с цел предотвратяване на зависимост от дигиталния свят:

• търсене на стратегии за насърчаване на задържането на вниманието във времена на фрагментиран начин на живот;

• проучване на въпроса как цифровият свят оформя човешкия мозък и как можем да попречим на вредното му въздействие;

• избор на начини за пълноценна социална комуникация в присъствието на множество цифрови дистрактори.

През последните години понятието „дигитална зависимост“ добива все по-голяма популярност. Въпреки че все още е въпрос на дебат дали това състояние може да се диагностицира като заболяване, свързано с психичното здраве, неоспорим е фактът, че има нужда от подходи за превенция и интервенция, които ще насърчат хората да се контролират повече при употребата на дигитални устройства.

No, Toothbrushes Were Not Used in a Massive DDoS Attack

Post Syndicated from Bruce Schneier original https://www.schneier.com/blog/archives/2024/02/no-toothbrushes-were-not-used-in-a-massive-ddos-attack.html

The widely reported story last week that 1.5 million smart toothbrushes were hacked and used in a DDoS attack is false.

Near as I can tell, a German reporter talking to someone at Fortinet got it wrong, and then everyone else ran with it without reading the German text. It was a hypothetical, which Fortinet eventually confirmed.

Or maybe it was a stock-price hack.

[$] Gnuplot 6 comes with pie

Post Syndicated from LWN.net original https://lwn.net/Articles/961003/

Gnuplot 6.0 was released in
December 2023, bringing a host of significant improvements and new
capabilities to the open-source graphing tool. Here we survey the major
new features, including
filled contours in 3D, adaptive plotting resolution, watchpoints, clipping
of surfaces, sector plots for making things like pie charts, and new
syntax for conditionals in gnuplot’s scripting language. In addition, there
are
detailed examples of the features described.

[$] Gnuplot 6 comes with pie

Post Syndicated from jake original https://lwn.net/Articles/961003/

Gnuplot 6.0 was released in
December 2023, bringing a host of significant improvements and new
capabilities to the open-source graphing tool. Here we survey the major
new features, including
filled contours in 3D, adaptive plotting resolution, watchpoints, clipping
of surfaces, sector plots for making things like pie charts, and new
syntax for conditionals in gnuplot’s scripting language. In addition, there
are
detailed examples of the features described.

Rowley: What’s new in the Postgres 16 query planner / optimizer

Post Syndicated from LWN.net original https://lwn.net/Articles/961545/

David Rowley looks
deeply
into the improvements coming to the query planner in
PostgreSQL 16.

For a long time now, PostgreSQL has been able to remove a LEFT JOIN
where no column from the left joined table was required in the
query and the join could not possibly duplicate any rows.

However, in versions prior to PostgreSQL 16, there was no support
for left join removals on partitioned tables. Why? Because the
proofs that the planner uses to determine if there’s any
possibility any inner-side row could duplicate any outer-side row
were not present for partitioned tables.

The PostgreSQL 16 query planner now allows the LEFT JOIN removal
optimization with partitioned tables.

Rowley: What’s new in the Postgres 16 query planner / optimizer

Post Syndicated from corbet original https://lwn.net/Articles/961545/

David Rowley looks
deeply
into the improvements coming to the query planner in
PostgreSQL 16.

For a long time now, PostgreSQL has been able to remove a LEFT JOIN
where no column from the left joined table was required in the
query and the join could not possibly duplicate any rows.

However, in versions prior to PostgreSQL 16, there was no support
for left join removals on partitioned tables. Why? Because the
proofs that the planner uses to determine if there’s any
possibility any inner-side row could duplicate any outer-side row
were not present for partitioned tables.

The PostgreSQL 16 query planner now allows the LEFT JOIN removal
optimization with partitioned tables.

Security updates for Friday

Post Syndicated from LWN.net original https://lwn.net/Articles/961584/

Security updates have been issued by Debian (webkit2gtk), Fedora (atril, chromium, gnutls, python-aiohttp, and webkitgtk), Gentoo (libxml2), Mageia (gnutls, gpac, kernel, kernel-linus, microcode, pam, and postfix), Red Hat (container-tools:2.0, container-tools:3.0, container-tools:4.0, container-tools:rhel8, gimp, libmaxminddb, python-pillow, runc, and unbound), SUSE (cosign, netpbm, python, python-Pillow, python3, and python36), and Ubuntu (libde265, linux-gcp, linux-gcp-5.4, and linux-intel-iotg).

Security updates for Friday

Post Syndicated from jake original https://lwn.net/Articles/961584/

Security updates have been issued by Debian (webkit2gtk), Fedora (atril, chromium, gnutls, python-aiohttp, and webkitgtk), Gentoo (libxml2), Mageia (gnutls, gpac, kernel, kernel-linus, microcode, pam, and postfix), Red Hat (container-tools:2.0, container-tools:3.0, container-tools:4.0, container-tools:rhel8, gimp, libmaxminddb, python-pillow, runc, and unbound), SUSE (cosign, netpbm, python, python-Pillow, python3, and python36), and Ubuntu (libde265, linux-gcp, linux-gcp-5.4, and linux-intel-iotg).

Все по-уютно преди ротацията

Post Syndicated from Емилия Милчева original https://www.toest.bg/vse-po-uyutno-predi-rotatsiyata/

Все по-уютно преди ротацията

Нов тътен друса сглобената по нетрадиционен начин 2+1 власт на България, където „две“ е динамична конструкция – ту е ПП–ДБ и ГЕРБ–СДС, ту пък ГЕРБ–СДС и ДПС. Формално е ПП–ДБ и ГЕРБ–СДС. Шумът не е заради опасност от разпадане, както се опитват да внушат ангажираните със специалните ефекти, включващи и протести, а поради наместване на чарковете. Договарят се нови позиции и от ГЕРБ демонстрират, че са хората с пръст на детонатора за стабилността на управлението. ДПС помагат.

Пиротехнически ефекти

Така беше и преди приемането на бюджет 2024, когато на външни наблюдатели им се струваше, че аха-аха сглобката ще се разтури. Поради големите интереси при разпределяне на 24 млрд. лв. бюджетни разходи положението беше сеизмично. Но след като министърът на финансите Асен Василев прие поисканото от ГЕРБ и ДПС, а депутатите от евроатлантическото мнозинство гласуваха, трусовете спряха. 

Сега предстои не просто ротация на премиери и минимални промени в състава на правителството, които неизбежно ще се осъществят през март, но и договарянето на десетки позиции в регулатори и в съдебната система. Извиването на ръце в управляващото мнозинство заради ротацията включва всякакви методи, в това число размразяване на работата на блокирания Столичен общински съвет (СОС) с избора на председател. СОС гласува вчера председател до края на юли да е Цветомир Петров от ПП–ДБ–„Спаси София“. Петров беше избран след осмия опит, но и след заканата на Борисов, изпусната тази седмица – „защо да няма нови [местни – б.а.] избори в София“. Така в един ден беше избран председател на СОС и на масата беше сложена заявката на ГЕРБ да получат Външното министерство, след като Мария Габриел бъде избрана за премиер. Най-вероятно ще го получат – ако не стане, значи са договорили други постове. 

Раздорът

Че бившата еврокомисарка иска да съвместява поста министър на външните работи с министърпредседателския, в политическите среди е известно от поне два месеца. В приетата в края на май 2023 г. Декларация за национално отговорно управление на ПП–ДБ и ГЕРБ–СДС e записано:

Министър-председател за първия период от 9 месеца ще бъде акад. Николай Денков, а Мария Габриел – заместник министър-председател и министър на външните работи, а за втория период от 9 месеца министър-председател ще бъде Мария Габриел, а акад. Николай Денков – заместник министър-председател.

Настоящият премиер не желае да поеме поста министър на образованието и науката, какъвто е бил в три кабинета – два служебни и един редовен. В коалицията ПП–ДБ дори имаше идея за създаване на ново министерство, след като бъде избран за вицепремиер. Сега се оказва, че МВнР е министерство, което ПП–ДБ настоява да получи. Позицията на Николай Денков е ротацията да продължи, както е била договорена, и след това да се види дали може да се постигне пълен мандат, като за целта ще бъде подготвена управленска програма до края на мандата. Сега такава има до края на 2024 г.

Аз не искам поста на външен министър като такъв, но искам гласът на ПП–ДБ да е достатъчно силен, така че да се чува в чужбина.

За по-малко от 9 месеца като премиер академикът показа добро възпитание, здрави нерви, но най-важното – срещна се с европейски лидери и има своите заслуги (не министърът на вътрешните работи Калин Стоянов) за първия етап от приемането на България в Шенген по вода и въздух, подготвяйки и същинския с очаквана дата за приемането по суша. Денков се срещна с френския президент Макрон на погребението на един от архитектите на ЕС – Жак Делор. Разговаря на четири очи с германския канцлер Олаф Шолц в Брюксел, наскоро се видя с датската премиерка Мете Фредериксен, а тази седмица – и с министър-председателя на Нидерландия Марк Рюте, насърчил България за еврозоната и Шенген.

Присъединяването на България към европейския валутен съюз от 1 януари 2025 г. е все по-видимо, шансовете за Шенген са реални, въпреки че парламентарните избори в Австрия, която се противопоставя на разширяването, ще се проведат най-късно през септември. Тези (вероятни) успехи носят своите дивиденти за партиите – и във вътрешен, и във външнополитически план. ГЕРБ биха могли да си припишат заслугите за еврото – управителят на БНБ Димитър Радев, преизбран миналото лято за втори мандат на поста, е тяхна номинация. България влезе в Европейския валутен механизъм (ERM II), известен като „преддверието за еврото“ в последната година от третото правителство на Борисов. На министъра на финансите, в случая Асен Василев, е отредена доста по-скромна роля. 

Мария Габриел ще бъде премиер от партия, принадлежаща към най-голямото политическо семейство в ЕС – ЕНП, на което проучванията отреждат първо място след евроизборите през юни. Нейните контакти като бивш еврокомисар, активността ѝ като външен министър и синхронът между нея и Денков могат да бъдат отчетени като успехи. Но ГЕРБ не направи никакъв пробив за Шенген по време на трите редовни правителства на Бойко Борисов.

Освен обявилия, че ще напусне правителството и поста министър на здравеопазването Христо Хинков, сериозни промени няма да има. Една от причините е, че още при първоначалното сглобяване някои министри не са били на ПП–ДБ, както се разбра преди време за министъра на вътрешните работи Калин Стоянов. „Подаден“ от Борисов, одобрен от Пеевски. 

Министрите на ресурсните министерства пък продължават политиката, позната от времената на Бойко Борисов. Наскоро Mediapool.bg съобщи, че дни преди Коледа Агенция „Пътна инфраструктура“ е разпределила няколко милиарда с обичайни и известни от времето на ГЕРБ победители. А вчера лидерът на ГЕРБ каза, че в държавния тец и в мини в Маришкия басейн ще бъдат налети нови 160 млн. лв., договорени на среща между него, премиера Николай Денков, съпредседателя на ПП Кирил Петков и председателя на ПГ на ДПС Делян Пеевски. Иначе, ТЕЦ „Марица-изток 2“, която рано или късно ще спре работа заради края на въглищната индустрия, щяла да фалира. Със 150 млн. лв. ще бъдат подкрепени и протестиращите земеделски производители.

Приятелски, уютни разговори

Ето такива договорки се правят в кабинетите в парламента, скрито за журналистите, които нямат достъп до кулоарите, след като депутатите се преместиха в сградата на Партийния дом. За тях съобщи Борисов, по-късно го подкрепи и Пеевски. Не се обади никой от лидерите на ПП–ДБ.

Вчера с Кирил Петков близо три часа сме били заедно в моя кабинет – приятелски, уютен разговор. Всеки ден г-н Петков, Христо Иванов, когато е тук, Атанас Атанасов, Делян Пеевски идват и обикновено Делян Пеевски идва с Кирил Петков и водят изключително приятелски разговор. Данчо Цонев [Йордан Цонев от ДПС – б.а.] и Асен Василев са неразделни. Даже аз два месеца не си говорих с Кирил Петков и ми го доведе Данчо Цонев да ми го сдобрява.

Ето така го обясни Борисов, раздразнен от телевизионно интервю на Лена Бориславова от ПП, в което тя обясни подкрепата на ДПС чрез ГЕРБ. „Искат да ползват целия комфорт на подкрепата на ДПС, а в същото време да излиза, че аз я осигурявам. Това няма да се случва повече“, каза лидерът на ГЕРБ. По-късно, запитан кой му е по-близък – Кирил Петков или Борисов, Пеевски отговори:

Приятелски, политически и двамата са ми много близки. Много ги обичам и двамата.

Независимо от публичните изявления изглежда, че либералите от ПП са намерили път към либералите от ДПС и дистанцията отдавна е скъсена. От ПП–ДБ се мръщят на въпроса какво правят ДПС на всички разговори между двете сили в номиналната сглобка, използвайки различни опорки. Едната е, че партията на Доган подкрепя някои приоритети (твърдят го от „Демократична България“). Другата е, че Движението е заедно с ГЕРБ (любима теза на „Продължаваме промяната“). А всъщност в триъгълника на властта го покани именно коалицията ПП–ДБ, в името на „конституционното мнозинство“. И едните, и другите изчакват журналистите да се уморят да питат, тъй като участието на ДПС и глаголенето на санкционирания за корупция по закона „Магнитски“ Делян Пеевски вече е по подразбиране.

Какво показва „издайническото“ споделяне на информация от Борисов пред камерите и микрофоните? Решенията се вземат в много тесен лидерски кръг. Уверенията, че Денков и Габриел правят оценка на министрите, не са правдоподобни – парламентът, дори не парламентът, а партийните лидери имат думата. 

Как ще бъдат излъчени първите номинации за регулатори в такъв случай? Никой в управляващата коалиция не говори за механизъм за такъв кадрови подбор – чуват се само политически заклинания, че ще бъдат избрани професионалисти, които се ползват с обществена подкрепа.

Става все по-уютно. И е стабилно.

The collective thoughts of the interwebz