Insights Remediations is a generator of Ansible playbooks that remediate issues discovered by Red Hat Insights.
Insights Remediations supports the following types of remediations:
-
Rule-based
This remediation type is used by Insights. Templates from insights-playbooks repository are used. See project wiki for more details.
-
CVE-based
This remediation type is used by the Vulnerability application. A single generic template, which remediates the given set of CVEs by upgrading relevant packages, is used.
-
Erratum-based
This remediation type is used by the System Patch Manager application. A single generic template, which remediates the given set of erratum by upgrading relevant packages, is used.
-
SCAP Security Guide (SSG)
This remediation type is used by the Compliance application. Templates from SCAP Security Guide are used.
- node.js 16
docker-compose -f build/docker-compose.yml up- open http://localhost:9002
docker-compose -f build/docker-compose.yml up dbdocker-compose -f build/docker-compose.yml up redisnpm cinpm run db:imsnpm start- open http://localhost:9002
To use the demo database seeder, prepend DEMO_MODE=true to each of the above commands.
Database container has to be running as a prerequisite for tests:
docker-compose -f build/docker-compose.yml up db
To run the linter, unit and integration tests run:
npm run verify
To run a single test run:
npm test <path-to-test-file>
To develop with RBAC and Kessel for permissions and access features you will need the inventory-api repository which implements a common inventory system with eventing.
- Clone https://github.com/project-kessel/inventory-api
- Run
make inventory-up
Application configuration can be changed using environmental variables.
The application supports feature flags via Unleash. In Clowder-managed environments, the Unleash connection is automatically configured. For local development, you can configure it manually.
| Environment Variable | Description | Default |
|---|---|---|
FEATURE_FLAGS_ENABLED |
Enable Unleash feature flags integration | false |
FEATURE_FLAGS_HOST |
Unleash API URL (auto-configured by Clowder) | `` |
FEATURE_FLAGS_TOKEN |
Unleash client access token (auto-configured by Clowder) | `` |
FEATURE_FLAGS_APP_NAME |
Application name for Unleash client identification | remediations |
FEATURE_FLAGS_REFRESH_INTERVAL |
Interval in ms to poll Unleash for flag updates | 15000 |
FEATURE_FLAGS_METRICS_INTERVAL |
Interval in ms to send metrics to Unleash | 60000 |
FEATURE_FLAGS_IMPL |
Set to mock to use mock implementation for testing |
`` |
Usage in code:
const featureFlags = require('./connectors/featureFlags');
// Check if a feature is enabled
if (featureFlags.isEnabled('my-feature', { userId: '123' })) {
// feature is enabled
}
// Get a variant
const variant = featureFlags.getVariant('my-feature');If your local database isn't updating, or it's not running as expected, run this command to remove old containers:
docker-compose -f build/docker-compose.yml rm -vf
Then, rebuild the image:
docker-compose -f build/docker-compose.yml build
Upon any change in the master branch the branch is tested, an image is built and deployed in CI and QA environments automatically. This process is controlled by the deployment Jenkinsfile.
The image can then be promoted to production using a Jenkins job. Use the git commit SHA as the REVISION when running the job.
For questions or comments join #platform-data-pipeline-standup at ansible.slack.com.