Skip to content

Conversation

@ajinkya1986
Copy link
Contributor

No description provided.


# Check if SRT access is enabled
if 'AutoRenew' in response and response['AutoRenew'] == 'ENABLED':
print("SRT has access to the AWS account.")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Secret: Secret Keyword

Click here for more details

Then, configure your AWS credentials. You can configure your credentials either by setting the following environment variables:
```
AWS_ACCESS_KEY_ID = 'your_access_key'
AWS_SECRET_ACCESS_KEY = 'your_secret_key'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Secret: Secret Keyword

Click here for more details


4. **Check for non-archived findings**: Now, you can iterate over all the detectors and check if they have non-archived findings enabled. If the `FindingPublishingFrequency` attribute of a detector is set to `FIFTEEN_MINUTES`, `ONE_HOUR`, or `SIX_HOURS`, it means that the detector is configured to automatically archive findings after the specified time period.

```python
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Secret: Secret Keyword

Click here for more details

# Create a session using your AWS credentials
session = boto3.Session(
aws_access_key_id='YOUR_ACCESS_KEY',
aws_secret_access_key='YOUR_SECRET_KEY',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Secret: Secret Keyword

Click here for more details


```python
regions = session.get_available_regions('macie2')

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Secret: Secret Keyword

Click here for more details


session = boto3.Session(
aws_access_key_id='YOUR_ACCESS_KEY',
aws_secret_access_key='YOUR_SECRET_KEY',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Secret: Secret Keyword

Click here for more details

print("Security Hub is enabled.")
except Exception as e:
print("Security Hub is not enabled:", str(e))
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Secret: Secret Keyword

Click here for more details


```
AWS_ACCESS_KEY_ID='your_access_key'
AWS_SECRET_ACCESS_KEY='your_secret_key'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Secret: Secret Keyword

Click here for more details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants