

# Security in AWS Ops Agent for networking

Cloud security at AWS is the highest priority. As an AWS customer, you benefit from data centers and network architectures that are built to meet the requirements of the most security-sensitive organizations.

Security is a shared responsibility between AWS and you. The shared responsibility model describes this as security of the cloud and security in the cloud:
+ **Security of the cloud** – AWS is responsible for protecting the infrastructure that runs AWS services in the AWS Cloud. AWS also provides you with services that you can use securely.
+ **Security in the cloud** – Your responsibility is determined by the AWS service that you use. You are also responsible for other factors, including the sensitivity of your data, your company's requirements, and applicable laws and regulations.

This topic covers how AWS Ops Agent for networking uses IAM, how it handles data, and its security behaviors. For AWS Ops Agent security, see the *AWS Ops Agent User Guide*.

## Read-only by design
<a name="ops-agent-networking-security-read-only"></a>

AWS Ops Agent for networking reads only. It declines requests to create, change, or delete resources. The only changes are the network scope operations that AWS Ops Agent performs with your IAM identity when you change the Agent Space.

## Data protection
<a name="ops-agent-networking-security-data-protection"></a>

The AWS shared responsibility model applies to data protection in AWS Ops Agent for networking. As described in this model, AWS is responsible for protecting the global infrastructure that runs all of the AWS Cloud. You are responsible for maintaining control over your content that is hosted on this infrastructure.

### Encryption at rest
<a name="ops-agent-networking-security-encryption-rest"></a>

AWS Ops Agent for networking stores network security findings as service metadata. It encrypts this metadata at rest with AWS owned keys.

The network data that AWS Ops Agent for networking stores to map and investigate your network – the network scope, topology, and network security analysis – is not encrypted with the customer managed AWS KMS key that you configure for AWS Ops Agent. AWS Ops Agent uses your customer managed key to encrypt its record of networking activity.

### Encryption in transit
<a name="ops-agent-networking-security-encryption-transit"></a>

AWS encrypts data in transit using Transport Layer Security (TLS).

### Key management
<a name="ops-agent-networking-security-key-management"></a>

AWS owned keys encrypt the network security findings that AWS Ops Agent for networking stores. You can't view, manage, or audit AWS owned keys. The customer managed AWS KMS key that you configure for AWS Ops Agent does not encrypt this stored network data.

Investigation output follows the data-protection settings of the Agent Space.

## Identity and access management
<a name="ops-agent-networking-security-iam"></a>

IAM is an AWS service that helps an administrator securely control access to AWS resources. AWS Ops Agent for networking works with IAM identity-based policies. You grant permissions by attaching policies to IAM identities, such as users, groups, and roles.

The following AWS managed policies are referenced in this guide: `AWSNetworkManagerFullAccess`, `AIDevOpsAgentFullAccess`, `AIDevOpsAgentAccessPolicy`, and `AIDevOpsOrganizationsAccessPolicy`.

### Permissions for the person who sets up AWS Ops Agent for networking
<a name="ops-agent-networking-security-permissions"></a>

AWS Ops Agent uses your IAM identity for the network scope operations. The following table lists the permissions you need.


**Permissions to set up AWS Ops Agent for networking**  

| Task | Permissions | 
| --- | --- | 
| Add or remove the Networking specialist | aidevops:ListAssociations, aidevops:AssociateService, and aidevops:DisassociateService (in AIDevOpsAgentFullAccess) | 
| Create and manage the network scope | The AWSNetworkManagerFullAccess managed policy | 
| View network scopes only | networkmanager:GetNetworkScope, networkmanager:ListNetworkScopes, and networkmanager:ListNetworkScopePrincipals | 
| Turn on trusted access (organization mode) | See the prerequisites in [Setting up AWS Ops Agent for networking across an AWS Organization](ops-agent-networking-organization-setup.md) | 

For why each of the seven `networkmanager` scope and principal actions is needed, see [Why each network scope action is needed](#ops-agent-networking-security-action-rationale).

### Why each network scope action is needed
<a name="ops-agent-networking-security-action-rationale"></a>


**Network scope actions**  

| Action | Why it's needed | 
| --- | --- | 
| CreateNetworkScope | Create the network scope when you add AWS Ops Agent for networking. | 
| GetNetworkScope | View the scope's configuration and state. | 
| ListNetworkScopes | List the network scopes in your account. | 
| UpdateNetworkScope | Update the scope's Regions when you change AWS Ops Agent for networking. | 
| DeleteNetworkScope | Delete the scope when you remove AWS Ops Agent for networking. | 
| ListNetworkScopePrincipals | View the principals in a scope. | 
| DisassociateNetworkScopePrincipal | Remove a principal when you remove an account or OU. | 

### Roles that AWS Ops Agent for networking uses
<a name="ops-agent-networking-security-roles"></a>


**Roles**  

| Role | Where it lives | Policies | 
| --- | --- | --- | 
| Agent Space (monitor) role | Agent Space account | AIDevOpsAgentAccessPolicy; in organization mode, also AIDevOpsOrganizationsAccessPolicy | 
| AIDevOpsAgentSpaceRole-\* | Member accounts (StackSet-deployed) | Managed by AWS Ops Agent | 
| AWSServiceRoleForNetworkManager | Each account in the scope | Required for each account principal | 
| AWSServiceRoleForNetworkSecurityDirector | Accounts in the scope (organization mode) | Managed by the service | 

Account mode deploys no extra roles.

The `AIDevOpsAgentAccessPolicy` managed policy grants the Agent Space role the following read permissions:
+ `networkmanager:GetNetworkScope` – View the network scope's configuration and state, and look up the resources in it.
+ `networkmanager:ListFindings` – View network security findings for resources in the network scope.
+ `networkmanager:QueryTopology` – Analyze network paths and reachability between resources in the network scope.
+ `networkmanager:GetCoreNetworkPolicy` – Summarize the route changes that an AWS Cloud WAN core network policy version would make before you apply it.

### Service-linked roles
<a name="ops-agent-networking-security-slr"></a>

AWS Ops Agent for networking uses AWS service-linked roles. `AWSServiceRoleForNetworkManager` is required for each account in the network scope. In organization mode, `AWSServiceRoleForNetworkSecurityDirector` is also used in accounts in the scope. For where each role lives and the policies it uses, see [Roles that AWS Ops Agent for networking uses](#ops-agent-networking-security-roles).

### Cross-service confused deputy prevention
<a name="ops-agent-networking-security-confused-deputy"></a>

The confused deputy problem is a security issue where an entity that doesn't have permission to perform an action can coerce a more-privileged entity to perform it. In AWS, cross-service impersonation can result in the confused deputy problem.

To prevent it, the trust policy of the Agent Space (monitor) role pins the `aws:SourceAccount` and `aws:SourceArn` condition keys to the Agent Space. These conditions restrict the role so that it is assumed only on behalf of the Agent Space.

## Compliance validation
<a name="ops-agent-networking-security-compliance"></a>

To learn whether an AWS service is within the scope of specific compliance programs, see [AWS services in scope by compliance program](https://docs.aws.amazon.com/compliance/services-in-scope/) and choose the compliance program that you are interested in. For general information, see [AWS compliance programs](https://aws.amazon.com/compliance/programs/).

You can download third-party audit reports using AWS Artifact. For more information, see [Downloading reports in AWS Artifact](https://docs.aws.amazon.com/artifact/latest/ug/what-is-aws-artifact.html).

Your compliance responsibility when you use AWS Ops Agent for networking is determined by the sensitivity of your data, your company's compliance objectives, and applicable laws and regulations.

## Resilience
<a name="ops-agent-networking-security-resilience"></a>

The AWS global infrastructure is built around AWS Regions and Availability Zones. AWS Regions provide multiple physically separated and isolated Availability Zones, which are connected with low-latency, high-throughput, and highly redundant networking. With Availability Zones, you can design and operate applications and databases that automatically fail over between zones without interruption.

For more information about AWS Regions and Availability Zones, see [AWS global infrastructure](https://aws.amazon.com/about-aws/global-infrastructure/).

## Infrastructure security
<a name="ops-agent-networking-security-infrastructure"></a>

As a managed service, AWS Ops Agent for networking is protected by AWS global network security. For information about AWS security services and how AWS protects infrastructure, see [AWS Cloud Security](https://aws.amazon.com/security/). To design your AWS environment using the best practices for infrastructure security, see [Infrastructure protection](https://docs.aws.amazon.com/wellarchitected/latest/security-pillar/infrastructure-protection.html) in the *Security Pillar AWS Well-Architected Framework*.

You use AWS published API calls to access AWS Ops Agent for networking through the network. Clients must support Transport Layer Security (TLS). Requests must be signed using an access key ID and a secret access key that is associated with an IAM principal, or you can use the [AWS Security Token Service](https://aws.amazon.com/sts/) to generate temporary security credentials to sign requests.

## Incident response
<a name="ops-agent-networking-security-incident-response"></a>

AWS CloudTrail records the AWS Network Manager network scope operations and the AWS Ops Agent association operations. This activity history supports detection and investigation of security events. For more information, see [Logging](#ops-agent-networking-security-logging). For AWS Ops Agent incident response, see the *AWS Ops Agent User Guide*.

## Security best practices
<a name="ops-agent-networking-security-best-practices"></a>

Use the following best practices to help secure your use of AWS Ops Agent for networking.

### Preventative best practices
<a name="ops-agent-networking-security-best-practices-preventative"></a>
+ Don't edit the network security analysis policy.
+ Use service control policies (SCPs) carefully. Blocking the AWS Network Manager service-linked role, the network security analysis service-linked role, or the AWS Ops Agent role leaves accounts partly covered, and the scope reports `PRINCIPALS_NOT_FULLY_COVERED`.
+ Use a delegated administrator so that the team can run AWS Ops Agent for networking without management-account credentials.

### Detective best practices
<a name="ops-agent-networking-security-best-practices-detective"></a>
+ Removing an account's access isn't immediate. A deleted or unassumable secondary-account role can take up to 6 hours to detect and remove. To stop analysis immediately, remove the account from the Agent Space.
+ Review AWS CloudTrail logs to monitor the network scope operations and the AWS Ops Agent association operations. For more information, see [Logging](#ops-agent-networking-security-logging).

## Logging
<a name="ops-agent-networking-security-logging"></a>

AWS CloudTrail records the AWS Network Manager network scope operations and the AWS Ops Agent association operations.

## Related resources
<a name="ops-agent-networking-security-related"></a>
+ [How AWS Ops Agent for networking works](ops-agent-networking-how-it-works.md)
+ [Setting up AWS Ops Agent for networking across an AWS Organization](ops-agent-networking-organization-setup.md)
+ [Working with network scopes](ops-agent-networking-network-scopes.md)