AWS

Download 604
Last updated Dec 1, 2026

3-3. Roles Anywhere

Use IAM Roles Anywhere when the Logpresso Sonar server cannot hold a long lived access key. The server proves its identity with an X.509 certificate, obtains temporary credentials, and calls AWS APIs with them. The Roles Anywhere connection profile is supported from AWS 2.0.2612.0.

If you use an access key or STS, skip this page and follow 3-1. IAM User or 3-2. STS instead.

AWS Configuration

  1. In Trust anchors of the IAM Roles Anywhere console, create a trust anchor and register the CA certificate that issues your certificates. Copy the trust anchor ARN.

  2. In Profiles, create a Roles Anywhere profile and register the IAM role to assume. Copy the profile ARN.

  3. Add the Roles Anywhere service to the trust policy of that IAM role, and attach the policy created in 2. IAM Policy Configuration to the role.

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Effect": "Allow",
          "Principal": { "Service": "rolesanywhere.amazonaws.com" },
          "Action": ["sts:AssumeRole", "sts:TagSession", "sts:SetSourceIdentity"]
        }
      ]
    }
    
  4. Prepare the end entity certificate issued by the CA of the trust anchor, and its private key.

Note
The acceptRoleSessionName option of a Roles Anywhere profile is off by default. Entering a session name in the Sonar connection profile while it is off fails with "Not authorized to set roleSessionName".

Two ways to hold the identity

The fields of the connection profile depend on where the certificate and private key live. Use one way only; filling in fields of both ways fails when the profile is saved.

WayWhen to useFields to fill inExtra install
Pasted certificateThe certificate and private key can be stored as PEM textCertificate, Private KeyNone
Signing helperThe private key lives in a PKCS#11 token or HSM, a TPM, or an OS certificate store, where the JVM cannot read itSigning Helper Path and the locator fields belowCredential Helper required

The pasted certificate way signs inside the Sonar process with the IAM Roles Anywhere Java plugin bundled in the app, so no external program is needed. Once Signing Helper Path is filled in, the Certificate and Private Key fields are ignored and the Credential Helper below signs instead.

Installing the Credential Helper

Needed only for the signing helper way. Download the AWS IAM Roles Anywhere Credential Helper (binary name aws_signing_helper) onto the Logpresso Sonar server. Sonar runs its credential-process command to obtain temporary credentials.

1. Download

The paths below are for version 1.8.6 as of December 2026. For the latest version, the macOS builds, and the SHA256 checksum of each file, see the AWS documentation.

OSArchitectureDownload URL
Linuxx86-64https://rolesanywhere.amazonaws.com/releases/1.8.6/X86_64/Linux/Amzn2023/aws_signing_helper
LinuxAarch64https://rolesanywhere.amazonaws.com/releases/1.8.6/Aarch64/Linux/Amzn2023/aws_signing_helper
Windowsx86-64https://rolesanywhere.amazonaws.com/releases/1.8.6/X86_64/Windows/Server2022/aws_signing_helper.exe
curl -o /opt/logpresso/bin/aws_signing_helper \
  https://rolesanywhere.amazonaws.com/releases/1.8.6/X86_64/Linux/Amzn2023/aws_signing_helper
sha256sum /opt/logpresso/bin/aws_signing_helper
chmod +x /opt/logpresso/bin/aws_signing_helper
Caution
Compare the SHA256 checksum of the downloaded file with the value published in the AWS documentation before using it.

2. Check the execute permission

The account that runs the Sonar service must be able to execute the file. Sonar does not use PATH; it runs exactly the path entered in the connection profile, so enter an absolute path in Signing Helper Path.

sudo -u logpresso test -x /opt/logpresso/bin/aws_signing_helper && echo ok

3. Check that the certificate can be read

Reading the certificate with the helper alone, before creating the connection profile, separates a Sonar configuration problem from a key store problem.

# Print the certificate given as a file path or a PKCS#11 URI
/opt/logpresso/bin/aws_signing_helper read-certificate-data \
  --certificate 'pkcs11:object=My%20RA%20key'

# Test-sign with the certificate picked from an OS store by a selector
/opt/logpresso/bin/aws_signing_helper sign-string \
  --cert-selector 'Key=x509Subject,Value=CN=logpresso-sonar'

With a selector, read-certificate-data prints every matching certificate, so narrow the selector when more than one appears. For PKCS#11 it also prints a URI per certificate; enter that value in Helper Certificate as is.

Note
Sonar calls the credential-process command only. The serve and update commands described in the AWS documentation are not used for the Sonar integration.

Adding the connection profile

Go to Settings > Connect Profiles, click Add, and select AWS (Roles Anywhere) as the Type.

The common fields are the same as in 5. Connection Profile. The Roles Anywhere fields are as follows.

GroupFieldValue
RequiredTrust Anchor ARNARN copied in AWS configuration step 1 (arn:aws:rolesanywhere:{region}:{account}:trust-anchor/{identifier})
RequiredProfile ARNARN copied in AWS configuration step 2 (arn:aws:rolesanywhere:{region}:{account}:profile/{identifier})
RequiredRole ARNARN of the IAM role to assume. It must be listed in the Roles Anywhere profile
OptionalRole Session NameFill in only when acceptRoleSessionName is enabled on the Roles Anywhere profile. When empty, the service derives the name from the certificate
OptionalSession DurationLifetime of the temporary credentials in seconds (900 to 43200). AWS uses 3600 when empty. The call fails if it exceeds the maximum session duration of the role
Pasted certificateCertificatePEM text of the end entity certificate
Pasted certificatePrivate KeyPEM text of the private key; stored encrypted
Pasted certificateKey AlgorithmRSA or EC. Inferred from the key when empty
Pasted certificateCertificate ChainConcatenated PEM of the intermediate certificates, when the certificate does not chain directly to the trust anchor
Signing helperSigning Helper PathPath to the aws_signing_helper binary. Setting it switches the profile to out of process signing
Signing helperHelper CertificateA file path or a pkcs11: URI
Signing helperHelper Private KeyA file path, a pkcs11: URI, or a TPM handle
Signing helperCertificate SelectorPicks a certificate out of an OS certificate store. Format Key=x509Subject,Value=CN=name; the x509Issuer and x509Serial keys also work
Signing helperSystem Store NameName of the OS certificate store, usually MY on Windows
Signing helperPKCS#11 LibraryPath to the PKCS#11 module of the token or HSM
Signing helperPKCS#11 PINPIN of the token; stored encrypted
Signing helperReuse PKCS#11 PINtrue for tokens that use the user PIN as the signing PIN
Signing helperTPM Key PasswordOnly for a password protected TPM key; stored encrypted
Caution
The signing helper way requires either Helper Private Key or Certificate Selector. The connection profile cannot be saved when both are empty. If the token needs a PIN and PKCS#11 PIN is left empty, collection does not start - the helper cannot prompt for a PIN from the Sonar console.
Note
To use Roles Anywhere on a closed network, add the sts and rolesanywhere keys to VPC Endpoints of the connection profile.

Verifying the setup

After saving the connection profile, run a query command to confirm that credentials are issued. Replace {profile name} with the name of the connection profile.

aws-regions profile={profile name}

A list of regions means the app obtained temporary credentials through Roles Anywhere and called the AWS API with them.

References